Skip to main content

hanzo_client/apis/
iam_api.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13use serde::{Deserialize, Serialize, de::Error as _};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration, ContentType};
16
17
18/// struct for typed errors of method [`add_provider`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum AddProviderError {
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`add_token`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum AddTokenError {
29    UnknownValue(serde_json::Value),
30}
31
32/// struct for typed errors of method [`add_webauthn_credential`]
33#[derive(Debug, Clone, Serialize, Deserialize)]
34#[serde(untagged)]
35pub enum AddWebauthnCredentialError {
36    UnknownValue(serde_json::Value),
37}
38
39/// struct for typed errors of method [`create_organization`]
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(untagged)]
42pub enum CreateOrganizationError {
43    UnknownValue(serde_json::Value),
44}
45
46/// struct for typed errors of method [`create_session`]
47#[derive(Debug, Clone, Serialize, Deserialize)]
48#[serde(untagged)]
49pub enum CreateSessionError {
50    UnknownValue(serde_json::Value),
51}
52
53/// struct for typed errors of method [`delete_iam_applications_by_owner_by_name`]
54#[derive(Debug, Clone, Serialize, Deserialize)]
55#[serde(untagged)]
56pub enum DeleteIamApplicationsByOwnerByNameError {
57    UnknownValue(serde_json::Value),
58}
59
60/// struct for typed errors of method [`delete_iam_audit_logs_by_owner_by_name`]
61#[derive(Debug, Clone, Serialize, Deserialize)]
62#[serde(untagged)]
63pub enum DeleteIamAuditLogsByOwnerByNameError {
64    UnknownValue(serde_json::Value),
65}
66
67/// struct for typed errors of method [`delete_iam_certs_by_owner_by_name`]
68#[derive(Debug, Clone, Serialize, Deserialize)]
69#[serde(untagged)]
70pub enum DeleteIamCertsByOwnerByNameError {
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`delete_iam_invitations_by_owner_by_name`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum DeleteIamInvitationsByOwnerByNameError {
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`delete_iam_keys_by_owner_by_name`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum DeleteIamKeysByOwnerByNameError {
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`delete_iam_mfa`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum DeleteIamMfaError {
92    UnknownValue(serde_json::Value),
93}
94
95/// struct for typed errors of method [`delete_iam_permissions_by_owner_by_name`]
96#[derive(Debug, Clone, Serialize, Deserialize)]
97#[serde(untagged)]
98pub enum DeleteIamPermissionsByOwnerByNameError {
99    UnknownValue(serde_json::Value),
100}
101
102/// struct for typed errors of method [`delete_iam_projects_by_owner_by_name`]
103#[derive(Debug, Clone, Serialize, Deserialize)]
104#[serde(untagged)]
105pub enum DeleteIamProjectsByOwnerByNameError {
106    UnknownValue(serde_json::Value),
107}
108
109/// struct for typed errors of method [`delete_iam_roles_by_owner_by_name`]
110#[derive(Debug, Clone, Serialize, Deserialize)]
111#[serde(untagged)]
112pub enum DeleteIamRolesByOwnerByNameError {
113    UnknownValue(serde_json::Value),
114}
115
116/// struct for typed errors of method [`delete_iam_scim_v2_users_by_owner_by_name`]
117#[derive(Debug, Clone, Serialize, Deserialize)]
118#[serde(untagged)]
119pub enum DeleteIamScimV2UsersByOwnerByNameError {
120    UnknownValue(serde_json::Value),
121}
122
123/// struct for typed errors of method [`delete_iam_service_accounts_by_name`]
124#[derive(Debug, Clone, Serialize, Deserialize)]
125#[serde(untagged)]
126pub enum DeleteIamServiceAccountsByNameError {
127    UnknownValue(serde_json::Value),
128}
129
130/// struct for typed errors of method [`delete_iam_users_by_owner_by_name`]
131#[derive(Debug, Clone, Serialize, Deserialize)]
132#[serde(untagged)]
133pub enum DeleteIamUsersByOwnerByNameError {
134    UnknownValue(serde_json::Value),
135}
136
137/// struct for typed errors of method [`delete_iam_users_by_owner_by_name_keys`]
138#[derive(Debug, Clone, Serialize, Deserialize)]
139#[serde(untagged)]
140pub enum DeleteIamUsersByOwnerByNameKeysError {
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`delete_iam_workspaces_by_owner_by_name`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum DeleteIamWorkspacesByOwnerByNameError {
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`delete_organization`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum DeleteOrganizationError {
155    UnknownValue(serde_json::Value),
156}
157
158/// struct for typed errors of method [`delete_provider`]
159#[derive(Debug, Clone, Serialize, Deserialize)]
160#[serde(untagged)]
161pub enum DeleteProviderError {
162    UnknownValue(serde_json::Value),
163}
164
165/// struct for typed errors of method [`delete_session`]
166#[derive(Debug, Clone, Serialize, Deserialize)]
167#[serde(untagged)]
168pub enum DeleteSessionError {
169    UnknownValue(serde_json::Value),
170}
171
172/// struct for typed errors of method [`delete_token`]
173#[derive(Debug, Clone, Serialize, Deserialize)]
174#[serde(untagged)]
175pub enum DeleteTokenError {
176    UnknownValue(serde_json::Value),
177}
178
179/// struct for typed errors of method [`delete_webauthn_credential`]
180#[derive(Debug, Clone, Serialize, Deserialize)]
181#[serde(untagged)]
182pub enum DeleteWebauthnCredentialError {
183    UnknownValue(serde_json::Value),
184}
185
186/// struct for typed errors of method [`get_iam_account`]
187#[derive(Debug, Clone, Serialize, Deserialize)]
188#[serde(untagged)]
189pub enum GetIamAccountError {
190    UnknownValue(serde_json::Value),
191}
192
193/// struct for typed errors of method [`get_iam_applications`]
194#[derive(Debug, Clone, Serialize, Deserialize)]
195#[serde(untagged)]
196pub enum GetIamApplicationsError {
197    UnknownValue(serde_json::Value),
198}
199
200/// struct for typed errors of method [`get_iam_applications_by_owner_by_name`]
201#[derive(Debug, Clone, Serialize, Deserialize)]
202#[serde(untagged)]
203pub enum GetIamApplicationsByOwnerByNameError {
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`get_iam_audit_logs`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum GetIamAuditLogsError {
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`get_iam_audit_logs_by_owner_by_name`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum GetIamAuditLogsByOwnerByNameError {
218    UnknownValue(serde_json::Value),
219}
220
221/// struct for typed errors of method [`get_iam_auth_application`]
222#[derive(Debug, Clone, Serialize, Deserialize)]
223#[serde(untagged)]
224pub enum GetIamAuthApplicationError {
225    Status400(models::IamPeriodAnswer),
226    UnknownValue(serde_json::Value),
227}
228
229/// struct for typed errors of method [`get_iam_auth_methods`]
230#[derive(Debug, Clone, Serialize, Deserialize)]
231#[serde(untagged)]
232pub enum GetIamAuthMethodsError {
233    Status400(models::IamPeriodAnswer),
234    UnknownValue(serde_json::Value),
235}
236
237/// struct for typed errors of method [`get_iam_certs`]
238#[derive(Debug, Clone, Serialize, Deserialize)]
239#[serde(untagged)]
240pub enum GetIamCertsError {
241    UnknownValue(serde_json::Value),
242}
243
244/// struct for typed errors of method [`get_iam_certs_by_owner_by_name`]
245#[derive(Debug, Clone, Serialize, Deserialize)]
246#[serde(untagged)]
247pub enum GetIamCertsByOwnerByNameError {
248    UnknownValue(serde_json::Value),
249}
250
251/// struct for typed errors of method [`get_iam_consent`]
252#[derive(Debug, Clone, Serialize, Deserialize)]
253#[serde(untagged)]
254pub enum GetIamConsentError {
255    UnknownValue(serde_json::Value),
256}
257
258/// struct for typed errors of method [`get_iam_invitations`]
259#[derive(Debug, Clone, Serialize, Deserialize)]
260#[serde(untagged)]
261pub enum GetIamInvitationsError {
262    UnknownValue(serde_json::Value),
263}
264
265/// struct for typed errors of method [`get_iam_invitations_by_owner_by_name`]
266#[derive(Debug, Clone, Serialize, Deserialize)]
267#[serde(untagged)]
268pub enum GetIamInvitationsByOwnerByNameError {
269    UnknownValue(serde_json::Value),
270}
271
272/// struct for typed errors of method [`get_iam_keys`]
273#[derive(Debug, Clone, Serialize, Deserialize)]
274#[serde(untagged)]
275pub enum GetIamKeysError {
276    UnknownValue(serde_json::Value),
277}
278
279/// struct for typed errors of method [`get_iam_keys_by_owner_by_name`]
280#[derive(Debug, Clone, Serialize, Deserialize)]
281#[serde(untagged)]
282pub enum GetIamKeysByOwnerByNameError {
283    UnknownValue(serde_json::Value),
284}
285
286/// struct for typed errors of method [`get_iam_keys_org`]
287#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum GetIamKeysOrgError {
290    UnknownValue(serde_json::Value),
291}
292
293/// struct for typed errors of method [`get_iam_keys_principal`]
294#[derive(Debug, Clone, Serialize, Deserialize)]
295#[serde(untagged)]
296pub enum GetIamKeysPrincipalError {
297    UnknownValue(serde_json::Value),
298}
299
300/// struct for typed errors of method [`get_iam_linked_accounts`]
301#[derive(Debug, Clone, Serialize, Deserialize)]
302#[serde(untagged)]
303pub enum GetIamLinkedAccountsError {
304    UnknownValue(serde_json::Value),
305}
306
307/// struct for typed errors of method [`get_iam_memberships`]
308#[derive(Debug, Clone, Serialize, Deserialize)]
309#[serde(untagged)]
310pub enum GetIamMembershipsError {
311    Status400(models::IamPeriodAnswer),
312    UnknownValue(serde_json::Value),
313}
314
315/// struct for typed errors of method [`get_iam_oauth_authorize`]
316#[derive(Debug, Clone, Serialize, Deserialize)]
317#[serde(untagged)]
318pub enum GetIamOauthAuthorizeError {
319    UnknownValue(serde_json::Value),
320}
321
322/// struct for typed errors of method [`get_iam_oauth_callback`]
323#[derive(Debug, Clone, Serialize, Deserialize)]
324#[serde(untagged)]
325pub enum GetIamOauthCallbackError {
326    UnknownValue(serde_json::Value),
327}
328
329/// struct for typed errors of method [`get_iam_oauth_logout`]
330#[derive(Debug, Clone, Serialize, Deserialize)]
331#[serde(untagged)]
332pub enum GetIamOauthLogoutError {
333    UnknownValue(serde_json::Value),
334}
335
336/// struct for typed errors of method [`get_iam_oauth_userinfo`]
337#[derive(Debug, Clone, Serialize, Deserialize)]
338#[serde(untagged)]
339pub enum GetIamOauthUserinfoError {
340    UnknownValue(serde_json::Value),
341}
342
343/// struct for typed errors of method [`get_iam_period_well_known_jwks`]
344#[derive(Debug, Clone, Serialize, Deserialize)]
345#[serde(untagged)]
346pub enum GetIamPeriodWellKnownJwksError {
347    UnknownValue(serde_json::Value),
348}
349
350/// struct for typed errors of method [`get_iam_period_well_known_oauth_authorization_server`]
351#[derive(Debug, Clone, Serialize, Deserialize)]
352#[serde(untagged)]
353pub enum GetIamPeriodWellKnownOauthAuthorizationServerError {
354    UnknownValue(serde_json::Value),
355}
356
357/// struct for typed errors of method [`get_iam_period_well_known_openid_configuration`]
358#[derive(Debug, Clone, Serialize, Deserialize)]
359#[serde(untagged)]
360pub enum GetIamPeriodWellKnownOpenidConfigurationError {
361    UnknownValue(serde_json::Value),
362}
363
364/// struct for typed errors of method [`get_iam_permissions`]
365#[derive(Debug, Clone, Serialize, Deserialize)]
366#[serde(untagged)]
367pub enum GetIamPermissionsError {
368    UnknownValue(serde_json::Value),
369}
370
371/// struct for typed errors of method [`get_iam_permissions_by_owner_by_name`]
372#[derive(Debug, Clone, Serialize, Deserialize)]
373#[serde(untagged)]
374pub enum GetIamPermissionsByOwnerByNameError {
375    UnknownValue(serde_json::Value),
376}
377
378/// struct for typed errors of method [`get_iam_projects`]
379#[derive(Debug, Clone, Serialize, Deserialize)]
380#[serde(untagged)]
381pub enum GetIamProjectsError {
382    UnknownValue(serde_json::Value),
383}
384
385/// struct for typed errors of method [`get_iam_projects_by_owner_by_name`]
386#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum GetIamProjectsByOwnerByNameError {
389    UnknownValue(serde_json::Value),
390}
391
392/// struct for typed errors of method [`get_iam_registry_jwks`]
393#[derive(Debug, Clone, Serialize, Deserialize)]
394#[serde(untagged)]
395pub enum GetIamRegistryJwksError {
396    UnknownValue(serde_json::Value),
397}
398
399/// struct for typed errors of method [`get_iam_registry_token`]
400#[derive(Debug, Clone, Serialize, Deserialize)]
401#[serde(untagged)]
402pub enum GetIamRegistryTokenError {
403    UnknownValue(serde_json::Value),
404}
405
406/// struct for typed errors of method [`get_iam_roles`]
407#[derive(Debug, Clone, Serialize, Deserialize)]
408#[serde(untagged)]
409pub enum GetIamRolesError {
410    UnknownValue(serde_json::Value),
411}
412
413/// struct for typed errors of method [`get_iam_roles_by_owner_by_name`]
414#[derive(Debug, Clone, Serialize, Deserialize)]
415#[serde(untagged)]
416pub enum GetIamRolesByOwnerByNameError {
417    UnknownValue(serde_json::Value),
418}
419
420/// struct for typed errors of method [`get_iam_scim_v2_resourcetypes`]
421#[derive(Debug, Clone, Serialize, Deserialize)]
422#[serde(untagged)]
423pub enum GetIamScimV2ResourcetypesError {
424    UnknownValue(serde_json::Value),
425}
426
427/// struct for typed errors of method [`get_iam_scim_v2_resourcetypes_by_name`]
428#[derive(Debug, Clone, Serialize, Deserialize)]
429#[serde(untagged)]
430pub enum GetIamScimV2ResourcetypesByNameError {
431    Status404(serde_json::Value),
432    UnknownValue(serde_json::Value),
433}
434
435/// struct for typed errors of method [`get_iam_scim_v2_schemas`]
436#[derive(Debug, Clone, Serialize, Deserialize)]
437#[serde(untagged)]
438pub enum GetIamScimV2SchemasError {
439    UnknownValue(serde_json::Value),
440}
441
442/// struct for typed errors of method [`get_iam_scim_v2_schemas_by_id`]
443#[derive(Debug, Clone, Serialize, Deserialize)]
444#[serde(untagged)]
445pub enum GetIamScimV2SchemasByIdError {
446    Status404(serde_json::Value),
447    UnknownValue(serde_json::Value),
448}
449
450/// struct for typed errors of method [`get_iam_scim_v2_serviceproviderconfig`]
451#[derive(Debug, Clone, Serialize, Deserialize)]
452#[serde(untagged)]
453pub enum GetIamScimV2ServiceproviderconfigError {
454    UnknownValue(serde_json::Value),
455}
456
457/// struct for typed errors of method [`get_iam_scim_v2_users`]
458#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum GetIamScimV2UsersError {
461    UnknownValue(serde_json::Value),
462}
463
464/// struct for typed errors of method [`get_iam_scim_v2_users_by_owner_by_name`]
465#[derive(Debug, Clone, Serialize, Deserialize)]
466#[serde(untagged)]
467pub enum GetIamScimV2UsersByOwnerByNameError {
468    UnknownValue(serde_json::Value),
469}
470
471/// struct for typed errors of method [`get_iam_service_accounts`]
472#[derive(Debug, Clone, Serialize, Deserialize)]
473#[serde(untagged)]
474pub enum GetIamServiceAccountsError {
475    Status400(models::IamPeriodAnswer),
476    UnknownValue(serde_json::Value),
477}
478
479/// struct for typed errors of method [`get_iam_users`]
480#[derive(Debug, Clone, Serialize, Deserialize)]
481#[serde(untagged)]
482pub enum GetIamUsersError {
483    UnknownValue(serde_json::Value),
484}
485
486/// struct for typed errors of method [`get_iam_users_by_owner_by_name`]
487#[derive(Debug, Clone, Serialize, Deserialize)]
488#[serde(untagged)]
489pub enum GetIamUsersByOwnerByNameError {
490    UnknownValue(serde_json::Value),
491}
492
493/// struct for typed errors of method [`get_iam_web3_nonce`]
494#[derive(Debug, Clone, Serialize, Deserialize)]
495#[serde(untagged)]
496pub enum GetIamWeb3NonceError {
497    UnknownValue(serde_json::Value),
498}
499
500/// struct for typed errors of method [`get_iam_webauthn_signin_begin`]
501#[derive(Debug, Clone, Serialize, Deserialize)]
502#[serde(untagged)]
503pub enum GetIamWebauthnSigninBeginError {
504    UnknownValue(serde_json::Value),
505}
506
507/// struct for typed errors of method [`get_iam_webauthn_signup_begin`]
508#[derive(Debug, Clone, Serialize, Deserialize)]
509#[serde(untagged)]
510pub enum GetIamWebauthnSignupBeginError {
511    UnknownValue(serde_json::Value),
512}
513
514/// struct for typed errors of method [`get_iam_whoami`]
515#[derive(Debug, Clone, Serialize, Deserialize)]
516#[serde(untagged)]
517pub enum GetIamWhoamiError {
518    UnknownValue(serde_json::Value),
519}
520
521/// struct for typed errors of method [`get_iam_workspaces`]
522#[derive(Debug, Clone, Serialize, Deserialize)]
523#[serde(untagged)]
524pub enum GetIamWorkspacesError {
525    UnknownValue(serde_json::Value),
526}
527
528/// struct for typed errors of method [`get_iam_workspaces_by_owner_by_name`]
529#[derive(Debug, Clone, Serialize, Deserialize)]
530#[serde(untagged)]
531pub enum GetIamWorkspacesByOwnerByNameError {
532    UnknownValue(serde_json::Value),
533}
534
535/// struct for typed errors of method [`get_organization`]
536#[derive(Debug, Clone, Serialize, Deserialize)]
537#[serde(untagged)]
538pub enum GetOrganizationError {
539    UnknownValue(serde_json::Value),
540}
541
542/// struct for typed errors of method [`get_provider`]
543#[derive(Debug, Clone, Serialize, Deserialize)]
544#[serde(untagged)]
545pub enum GetProviderError {
546    UnknownValue(serde_json::Value),
547}
548
549/// struct for typed errors of method [`get_session`]
550#[derive(Debug, Clone, Serialize, Deserialize)]
551#[serde(untagged)]
552pub enum GetSessionError {
553    UnknownValue(serde_json::Value),
554}
555
556/// struct for typed errors of method [`get_token`]
557#[derive(Debug, Clone, Serialize, Deserialize)]
558#[serde(untagged)]
559pub enum GetTokenError {
560    UnknownValue(serde_json::Value),
561}
562
563/// struct for typed errors of method [`get_webauthn_credential`]
564#[derive(Debug, Clone, Serialize, Deserialize)]
565#[serde(untagged)]
566pub enum GetWebauthnCredentialError {
567    UnknownValue(serde_json::Value),
568}
569
570/// struct for typed errors of method [`list_organizations`]
571#[derive(Debug, Clone, Serialize, Deserialize)]
572#[serde(untagged)]
573pub enum ListOrganizationsError {
574    UnknownValue(serde_json::Value),
575}
576
577/// struct for typed errors of method [`list_providers`]
578#[derive(Debug, Clone, Serialize, Deserialize)]
579#[serde(untagged)]
580pub enum ListProvidersError {
581    UnknownValue(serde_json::Value),
582}
583
584/// struct for typed errors of method [`list_sessions`]
585#[derive(Debug, Clone, Serialize, Deserialize)]
586#[serde(untagged)]
587pub enum ListSessionsError {
588    UnknownValue(serde_json::Value),
589}
590
591/// struct for typed errors of method [`list_tokens`]
592#[derive(Debug, Clone, Serialize, Deserialize)]
593#[serde(untagged)]
594pub enum ListTokensError {
595    UnknownValue(serde_json::Value),
596}
597
598/// struct for typed errors of method [`list_webauthn_credentials`]
599#[derive(Debug, Clone, Serialize, Deserialize)]
600#[serde(untagged)]
601pub enum ListWebauthnCredentialsError {
602    UnknownValue(serde_json::Value),
603}
604
605/// struct for typed errors of method [`patch_iam_scim_v2_users_by_owner_by_name`]
606#[derive(Debug, Clone, Serialize, Deserialize)]
607#[serde(untagged)]
608pub enum PatchIamScimV2UsersByOwnerByNameError {
609    UnknownValue(serde_json::Value),
610}
611
612/// struct for typed errors of method [`post_iam_admin_provision`]
613#[derive(Debug, Clone, Serialize, Deserialize)]
614#[serde(untagged)]
615pub enum PostIamAdminProvisionError {
616    UnknownValue(serde_json::Value),
617}
618
619/// struct for typed errors of method [`post_iam_applications`]
620#[derive(Debug, Clone, Serialize, Deserialize)]
621#[serde(untagged)]
622pub enum PostIamApplicationsError {
623    UnknownValue(serde_json::Value),
624}
625
626/// struct for typed errors of method [`post_iam_assume`]
627#[derive(Debug, Clone, Serialize, Deserialize)]
628#[serde(untagged)]
629pub enum PostIamAssumeError {
630    Status400(models::IamPeriodAnswer),
631    Status401(models::IamPeriodAnswer),
632    Status403(models::IamPeriodAnswer),
633    Status404(models::IamPeriodAnswer),
634    UnknownValue(serde_json::Value),
635}
636
637/// struct for typed errors of method [`post_iam_audit_logs`]
638#[derive(Debug, Clone, Serialize, Deserialize)]
639#[serde(untagged)]
640pub enum PostIamAuditLogsError {
641    UnknownValue(serde_json::Value),
642}
643
644/// struct for typed errors of method [`post_iam_certs`]
645#[derive(Debug, Clone, Serialize, Deserialize)]
646#[serde(untagged)]
647pub enum PostIamCertsError {
648    UnknownValue(serde_json::Value),
649}
650
651/// struct for typed errors of method [`post_iam_delete_membership`]
652#[derive(Debug, Clone, Serialize, Deserialize)]
653#[serde(untagged)]
654pub enum PostIamDeleteMembershipError {
655    UnknownValue(serde_json::Value),
656}
657
658/// struct for typed errors of method [`post_iam_invitations`]
659#[derive(Debug, Clone, Serialize, Deserialize)]
660#[serde(untagged)]
661pub enum PostIamInvitationsError {
662    UnknownValue(serde_json::Value),
663}
664
665/// struct for typed errors of method [`post_iam_keys`]
666#[derive(Debug, Clone, Serialize, Deserialize)]
667#[serde(untagged)]
668pub enum PostIamKeysError {
669    UnknownValue(serde_json::Value),
670}
671
672/// struct for typed errors of method [`post_iam_link`]
673#[derive(Debug, Clone, Serialize, Deserialize)]
674#[serde(untagged)]
675pub enum PostIamLinkError {
676    UnknownValue(serde_json::Value),
677}
678
679/// struct for typed errors of method [`post_iam_login`]
680#[derive(Debug, Clone, Serialize, Deserialize)]
681#[serde(untagged)]
682pub enum PostIamLoginError {
683    UnknownValue(serde_json::Value),
684}
685
686/// struct for typed errors of method [`post_iam_memberships`]
687#[derive(Debug, Clone, Serialize, Deserialize)]
688#[serde(untagged)]
689pub enum PostIamMembershipsError {
690    UnknownValue(serde_json::Value),
691}
692
693/// struct for typed errors of method [`post_iam_mfa_preferred`]
694#[derive(Debug, Clone, Serialize, Deserialize)]
695#[serde(untagged)]
696pub enum PostIamMfaPreferredError {
697    UnknownValue(serde_json::Value),
698}
699
700/// struct for typed errors of method [`post_iam_mfa_setup_enable`]
701#[derive(Debug, Clone, Serialize, Deserialize)]
702#[serde(untagged)]
703pub enum PostIamMfaSetupEnableError {
704    UnknownValue(serde_json::Value),
705}
706
707/// struct for typed errors of method [`post_iam_mfa_setup_initiate`]
708#[derive(Debug, Clone, Serialize, Deserialize)]
709#[serde(untagged)]
710pub enum PostIamMfaSetupInitiateError {
711    UnknownValue(serde_json::Value),
712}
713
714/// struct for typed errors of method [`post_iam_oauth_authorize`]
715#[derive(Debug, Clone, Serialize, Deserialize)]
716#[serde(untagged)]
717pub enum PostIamOauthAuthorizeError {
718    UnknownValue(serde_json::Value),
719}
720
721/// struct for typed errors of method [`post_iam_oauth_device`]
722#[derive(Debug, Clone, Serialize, Deserialize)]
723#[serde(untagged)]
724pub enum PostIamOauthDeviceError {
725    UnknownValue(serde_json::Value),
726}
727
728/// struct for typed errors of method [`post_iam_oauth_device_info`]
729#[derive(Debug, Clone, Serialize, Deserialize)]
730#[serde(untagged)]
731pub enum PostIamOauthDeviceInfoError {
732    UnknownValue(serde_json::Value),
733}
734
735/// struct for typed errors of method [`post_iam_oauth_federation_mfa`]
736#[derive(Debug, Clone, Serialize, Deserialize)]
737#[serde(untagged)]
738pub enum PostIamOauthFederationMfaError {
739    UnknownValue(serde_json::Value),
740}
741
742/// struct for typed errors of method [`post_iam_oauth_introspect`]
743#[derive(Debug, Clone, Serialize, Deserialize)]
744#[serde(untagged)]
745pub enum PostIamOauthIntrospectError {
746    UnknownValue(serde_json::Value),
747}
748
749/// struct for typed errors of method [`post_iam_oauth_logout`]
750#[derive(Debug, Clone, Serialize, Deserialize)]
751#[serde(untagged)]
752pub enum PostIamOauthLogoutError {
753    UnknownValue(serde_json::Value),
754}
755
756/// struct for typed errors of method [`post_iam_oauth_revoke`]
757#[derive(Debug, Clone, Serialize, Deserialize)]
758#[serde(untagged)]
759pub enum PostIamOauthRevokeError {
760    UnknownValue(serde_json::Value),
761}
762
763/// struct for typed errors of method [`post_iam_oauth_token`]
764#[derive(Debug, Clone, Serialize, Deserialize)]
765#[serde(untagged)]
766pub enum PostIamOauthTokenError {
767    UnknownValue(serde_json::Value),
768}
769
770/// struct for typed errors of method [`post_iam_oauth_userinfo`]
771#[derive(Debug, Clone, Serialize, Deserialize)]
772#[serde(untagged)]
773pub enum PostIamOauthUserinfoError {
774    UnknownValue(serde_json::Value),
775}
776
777/// struct for typed errors of method [`post_iam_onboard`]
778#[derive(Debug, Clone, Serialize, Deserialize)]
779#[serde(untagged)]
780pub enum PostIamOnboardError {
781    UnknownValue(serde_json::Value),
782}
783
784/// struct for typed errors of method [`post_iam_permissions`]
785#[derive(Debug, Clone, Serialize, Deserialize)]
786#[serde(untagged)]
787pub enum PostIamPermissionsError {
788    UnknownValue(serde_json::Value),
789}
790
791/// struct for typed errors of method [`post_iam_preferences`]
792#[derive(Debug, Clone, Serialize, Deserialize)]
793#[serde(untagged)]
794pub enum PostIamPreferencesError {
795    UnknownValue(serde_json::Value),
796}
797
798/// struct for typed errors of method [`post_iam_projects`]
799#[derive(Debug, Clone, Serialize, Deserialize)]
800#[serde(untagged)]
801pub enum PostIamProjectsError {
802    UnknownValue(serde_json::Value),
803}
804
805/// struct for typed errors of method [`post_iam_registry_token`]
806#[derive(Debug, Clone, Serialize, Deserialize)]
807#[serde(untagged)]
808pub enum PostIamRegistryTokenError {
809    UnknownValue(serde_json::Value),
810}
811
812/// struct for typed errors of method [`post_iam_release`]
813#[derive(Debug, Clone, Serialize, Deserialize)]
814#[serde(untagged)]
815pub enum PostIamReleaseError {
816    Status400(models::IamPeriodAnswer),
817    Status401(models::IamPeriodAnswer),
818    UnknownValue(serde_json::Value),
819}
820
821/// struct for typed errors of method [`post_iam_roles`]
822#[derive(Debug, Clone, Serialize, Deserialize)]
823#[serde(untagged)]
824pub enum PostIamRolesError {
825    UnknownValue(serde_json::Value),
826}
827
828/// struct for typed errors of method [`post_iam_scim_v2_users`]
829#[derive(Debug, Clone, Serialize, Deserialize)]
830#[serde(untagged)]
831pub enum PostIamScimV2UsersError {
832    UnknownValue(serde_json::Value),
833}
834
835/// struct for typed errors of method [`post_iam_service_accounts`]
836#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum PostIamServiceAccountsError {
839    UnknownValue(serde_json::Value),
840}
841
842/// struct for typed errors of method [`post_iam_service_accounts_by_name_keys`]
843#[derive(Debug, Clone, Serialize, Deserialize)]
844#[serde(untagged)]
845pub enum PostIamServiceAccountsByNameKeysError {
846    UnknownValue(serde_json::Value),
847}
848
849/// struct for typed errors of method [`post_iam_signin`]
850#[derive(Debug, Clone, Serialize, Deserialize)]
851#[serde(untagged)]
852pub enum PostIamSigninError {
853    UnknownValue(serde_json::Value),
854}
855
856/// struct for typed errors of method [`post_iam_signup`]
857#[derive(Debug, Clone, Serialize, Deserialize)]
858#[serde(untagged)]
859pub enum PostIamSignupError {
860    UnknownValue(serde_json::Value),
861}
862
863/// struct for typed errors of method [`post_iam_tokens_issue`]
864#[derive(Debug, Clone, Serialize, Deserialize)]
865#[serde(untagged)]
866pub enum PostIamTokensIssueError {
867    UnknownValue(serde_json::Value),
868}
869
870/// struct for typed errors of method [`post_iam_unlink`]
871#[derive(Debug, Clone, Serialize, Deserialize)]
872#[serde(untagged)]
873pub enum PostIamUnlinkError {
874    UnknownValue(serde_json::Value),
875}
876
877/// struct for typed errors of method [`post_iam_users`]
878#[derive(Debug, Clone, Serialize, Deserialize)]
879#[serde(untagged)]
880pub enum PostIamUsersError {
881    UnknownValue(serde_json::Value),
882}
883
884/// struct for typed errors of method [`post_iam_users_by_owner_by_name_keys`]
885#[derive(Debug, Clone, Serialize, Deserialize)]
886#[serde(untagged)]
887pub enum PostIamUsersByOwnerByNameKeysError {
888    UnknownValue(serde_json::Value),
889}
890
891/// struct for typed errors of method [`post_iam_verification_codes`]
892#[derive(Debug, Clone, Serialize, Deserialize)]
893#[serde(untagged)]
894pub enum PostIamVerificationCodesError {
895    UnknownValue(serde_json::Value),
896}
897
898/// struct for typed errors of method [`post_iam_web3_verify`]
899#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum PostIamWeb3VerifyError {
902    UnknownValue(serde_json::Value),
903}
904
905/// struct for typed errors of method [`post_iam_webauthn_signin_finish`]
906#[derive(Debug, Clone, Serialize, Deserialize)]
907#[serde(untagged)]
908pub enum PostIamWebauthnSigninFinishError {
909    UnknownValue(serde_json::Value),
910}
911
912/// struct for typed errors of method [`post_iam_webauthn_signup_finish`]
913#[derive(Debug, Clone, Serialize, Deserialize)]
914#[serde(untagged)]
915pub enum PostIamWebauthnSignupFinishError {
916    UnknownValue(serde_json::Value),
917}
918
919/// struct for typed errors of method [`post_iam_workspaces`]
920#[derive(Debug, Clone, Serialize, Deserialize)]
921#[serde(untagged)]
922pub enum PostIamWorkspacesError {
923    UnknownValue(serde_json::Value),
924}
925
926/// struct for typed errors of method [`put_iam_account`]
927#[derive(Debug, Clone, Serialize, Deserialize)]
928#[serde(untagged)]
929pub enum PutIamAccountError {
930    Status400(models::IamPeriodAnswer),
931    UnknownValue(serde_json::Value),
932}
933
934/// struct for typed errors of method [`put_iam_applications_by_owner_by_name`]
935#[derive(Debug, Clone, Serialize, Deserialize)]
936#[serde(untagged)]
937pub enum PutIamApplicationsByOwnerByNameError {
938    UnknownValue(serde_json::Value),
939}
940
941/// struct for typed errors of method [`put_iam_audit_logs_by_owner_by_name`]
942#[derive(Debug, Clone, Serialize, Deserialize)]
943#[serde(untagged)]
944pub enum PutIamAuditLogsByOwnerByNameError {
945    UnknownValue(serde_json::Value),
946}
947
948/// struct for typed errors of method [`put_iam_certs_by_owner_by_name`]
949#[derive(Debug, Clone, Serialize, Deserialize)]
950#[serde(untagged)]
951pub enum PutIamCertsByOwnerByNameError {
952    UnknownValue(serde_json::Value),
953}
954
955/// struct for typed errors of method [`put_iam_consent`]
956#[derive(Debug, Clone, Serialize, Deserialize)]
957#[serde(untagged)]
958pub enum PutIamConsentError {
959    UnknownValue(serde_json::Value),
960}
961
962/// struct for typed errors of method [`put_iam_invitations_by_owner_by_name`]
963#[derive(Debug, Clone, Serialize, Deserialize)]
964#[serde(untagged)]
965pub enum PutIamInvitationsByOwnerByNameError {
966    UnknownValue(serde_json::Value),
967}
968
969/// struct for typed errors of method [`put_iam_keys_by_owner_by_name`]
970#[derive(Debug, Clone, Serialize, Deserialize)]
971#[serde(untagged)]
972pub enum PutIamKeysByOwnerByNameError {
973    UnknownValue(serde_json::Value),
974}
975
976/// struct for typed errors of method [`put_iam_password`]
977#[derive(Debug, Clone, Serialize, Deserialize)]
978#[serde(untagged)]
979pub enum PutIamPasswordError {
980    Status400(models::IamPeriodAnswer),
981    UnknownValue(serde_json::Value),
982}
983
984/// struct for typed errors of method [`put_iam_permissions_by_owner_by_name`]
985#[derive(Debug, Clone, Serialize, Deserialize)]
986#[serde(untagged)]
987pub enum PutIamPermissionsByOwnerByNameError {
988    UnknownValue(serde_json::Value),
989}
990
991/// struct for typed errors of method [`put_iam_projects_by_owner_by_name`]
992#[derive(Debug, Clone, Serialize, Deserialize)]
993#[serde(untagged)]
994pub enum PutIamProjectsByOwnerByNameError {
995    UnknownValue(serde_json::Value),
996}
997
998/// struct for typed errors of method [`put_iam_roles_by_owner_by_name`]
999#[derive(Debug, Clone, Serialize, Deserialize)]
1000#[serde(untagged)]
1001pub enum PutIamRolesByOwnerByNameError {
1002    UnknownValue(serde_json::Value),
1003}
1004
1005/// struct for typed errors of method [`put_iam_scim_v2_users_by_owner_by_name`]
1006#[derive(Debug, Clone, Serialize, Deserialize)]
1007#[serde(untagged)]
1008pub enum PutIamScimV2UsersByOwnerByNameError {
1009    UnknownValue(serde_json::Value),
1010}
1011
1012/// struct for typed errors of method [`put_iam_users_by_owner_by_name`]
1013#[derive(Debug, Clone, Serialize, Deserialize)]
1014#[serde(untagged)]
1015pub enum PutIamUsersByOwnerByNameError {
1016    UnknownValue(serde_json::Value),
1017}
1018
1019/// struct for typed errors of method [`put_iam_workspaces_by_owner_by_name`]
1020#[derive(Debug, Clone, Serialize, Deserialize)]
1021#[serde(untagged)]
1022pub enum PutIamWorkspacesByOwnerByNameError {
1023    UnknownValue(serde_json::Value),
1024}
1025
1026/// struct for typed errors of method [`set_organization_avatar`]
1027#[derive(Debug, Clone, Serialize, Deserialize)]
1028#[serde(untagged)]
1029pub enum SetOrganizationAvatarError {
1030    UnknownValue(serde_json::Value),
1031}
1032
1033/// struct for typed errors of method [`update_organization`]
1034#[derive(Debug, Clone, Serialize, Deserialize)]
1035#[serde(untagged)]
1036pub enum UpdateOrganizationError {
1037    UnknownValue(serde_json::Value),
1038}
1039
1040/// struct for typed errors of method [`update_provider`]
1041#[derive(Debug, Clone, Serialize, Deserialize)]
1042#[serde(untagged)]
1043pub enum UpdateProviderError {
1044    UnknownValue(serde_json::Value),
1045}
1046
1047/// struct for typed errors of method [`update_session`]
1048#[derive(Debug, Clone, Serialize, Deserialize)]
1049#[serde(untagged)]
1050pub enum UpdateSessionError {
1051    UnknownValue(serde_json::Value),
1052}
1053
1054/// struct for typed errors of method [`update_token`]
1055#[derive(Debug, Clone, Serialize, Deserialize)]
1056#[serde(untagged)]
1057pub enum UpdateTokenError {
1058    UnknownValue(serde_json::Value),
1059}
1060
1061/// struct for typed errors of method [`update_webauthn_credential`]
1062#[derive(Debug, Clone, Serialize, Deserialize)]
1063#[serde(untagged)]
1064pub enum UpdateWebauthnCredentialError {
1065    UnknownValue(serde_json::Value),
1066}
1067
1068/// struct for typed errors of method [`upsert_application`]
1069#[derive(Debug, Clone, Serialize, Deserialize)]
1070#[serde(untagged)]
1071pub enum UpsertApplicationError {
1072    Status400(models::IamPeriodReply),
1073    Status401(models::IamPeriodReply),
1074    Status500(models::IamPeriodReply),
1075    UnknownValue(serde_json::Value),
1076}
1077
1078/// struct for typed errors of method [`upsert_user`]
1079#[derive(Debug, Clone, Serialize, Deserialize)]
1080#[serde(untagged)]
1081pub enum UpsertUserError {
1082    Status400(models::IamPeriodReply),
1083    Status401(models::IamPeriodReply),
1084    Status500(models::IamPeriodReply),
1085    UnknownValue(serde_json::Value),
1086}
1087
1088
1089/// Adds an identity provider your people can sign in with, or a service your applications send through — a social or enterprise login, an email or SMS sender, a storage or payment connector.  A provider is configured once and then switched on per application, so several applications can share one set of credentials.
1090pub async fn add_provider(configuration: &configuration::Configuration, iam_period_provider: models::IamPeriodProvider) -> Result<models::IamPeriodProviderResult, Error<AddProviderError>> {
1091    // add a prefix to parameters to efficiently prevent name collisions
1092    let p_iam_period_provider = iam_period_provider;
1093
1094    let uri_str = format!("{}/v1/iam/providers", configuration.base_path);
1095    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1096
1097    if let Some(ref user_agent) = configuration.user_agent {
1098        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1099    }
1100    if let Some(ref token) = configuration.bearer_access_token {
1101        req_builder = req_builder.bearer_auth(token.to_owned());
1102    };
1103    req_builder = req_builder.json(&p_iam_period_provider);
1104
1105    let req = req_builder.build()?;
1106    let resp = configuration.client.execute(req).await?;
1107
1108    let status = resp.status();
1109    let content_type = resp
1110        .headers()
1111        .get("content-type")
1112        .and_then(|v| v.to_str().ok())
1113        .unwrap_or("application/octet-stream");
1114    let content_type = super::ContentType::from(content_type);
1115
1116    if !status.is_client_error() && !status.is_server_error() {
1117        let content = resp.text().await?;
1118        match content_type {
1119            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1120            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProviderResult`"))),
1121            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProviderResult`")))),
1122        }
1123    } else {
1124        let content = resp.text().await?;
1125        let entity: Option<AddProviderError> = serde_json::from_str(&content).ok();
1126        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1127    }
1128}
1129
1130/// Records an access token — the credential an application or integration presents on a caller's behalf.
1131pub async fn add_token(configuration: &configuration::Configuration, iam_period_token: models::IamPeriodToken) -> Result<models::IamPeriodTokenResult, Error<AddTokenError>> {
1132    // add a prefix to parameters to efficiently prevent name collisions
1133    let p_iam_period_token = iam_period_token;
1134
1135    let uri_str = format!("{}/v1/iam/tokens", configuration.base_path);
1136    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1137
1138    if let Some(ref user_agent) = configuration.user_agent {
1139        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1140    }
1141    if let Some(ref token) = configuration.bearer_access_token {
1142        req_builder = req_builder.bearer_auth(token.to_owned());
1143    };
1144    req_builder = req_builder.json(&p_iam_period_token);
1145
1146    let req = req_builder.build()?;
1147    let resp = configuration.client.execute(req).await?;
1148
1149    let status = resp.status();
1150    let content_type = resp
1151        .headers()
1152        .get("content-type")
1153        .and_then(|v| v.to_str().ok())
1154        .unwrap_or("application/octet-stream");
1155    let content_type = super::ContentType::from(content_type);
1156
1157    if !status.is_client_error() && !status.is_server_error() {
1158        let content = resp.text().await?;
1159        match content_type {
1160            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1161            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenResult`"))),
1162            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenResult`")))),
1163        }
1164    } else {
1165        let content = resp.text().await?;
1166        let entity: Option<AddTokenError> = serde_json::from_str(&content).ok();
1167        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1168    }
1169}
1170
1171/// Registers a passkey or security key for a person, so they can sign in with their device instead of a password.
1172pub async fn add_webauthn_credential(configuration: &configuration::Configuration, iam_period_webauthn_credential: models::IamPeriodWebauthnCredential) -> Result<models::IamPeriodWebauthnCredentialResult, Error<AddWebauthnCredentialError>> {
1173    // add a prefix to parameters to efficiently prevent name collisions
1174    let p_iam_period_webauthn_credential = iam_period_webauthn_credential;
1175
1176    let uri_str = format!("{}/v1/iam/webauthn-credentials", configuration.base_path);
1177    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1178
1179    if let Some(ref user_agent) = configuration.user_agent {
1180        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1181    }
1182    if let Some(ref token) = configuration.bearer_access_token {
1183        req_builder = req_builder.bearer_auth(token.to_owned());
1184    };
1185    req_builder = req_builder.json(&p_iam_period_webauthn_credential);
1186
1187    let req = req_builder.build()?;
1188    let resp = configuration.client.execute(req).await?;
1189
1190    let status = resp.status();
1191    let content_type = resp
1192        .headers()
1193        .get("content-type")
1194        .and_then(|v| v.to_str().ok())
1195        .unwrap_or("application/octet-stream");
1196    let content_type = super::ContentType::from(content_type);
1197
1198    if !status.is_client_error() && !status.is_server_error() {
1199        let content = resp.text().await?;
1200        match content_type {
1201            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1202            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`"))),
1203            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`")))),
1204        }
1205    } else {
1206        let content = resp.text().await?;
1207        let entity: Option<AddWebauthnCredentialError> = serde_json::from_str(&content).ok();
1208        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1209    }
1210}
1211
1212/// Makes a new organization — the account your users, applications, roles, projects and workspaces are all named inside. It is the first write in a new tenant, and a name already in use is refused rather than taken over.
1213pub async fn create_organization(configuration: &configuration::Configuration, iam_period_create_organization_input: models::IamPeriodCreateOrganizationInput) -> Result<models::IamPeriodOrganization, Error<CreateOrganizationError>> {
1214    // add a prefix to parameters to efficiently prevent name collisions
1215    let p_iam_period_create_organization_input = iam_period_create_organization_input;
1216
1217    let uri_str = format!("{}/v1/iam/organizations", configuration.base_path);
1218    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1219
1220    if let Some(ref user_agent) = configuration.user_agent {
1221        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1222    }
1223    if let Some(ref token) = configuration.bearer_access_token {
1224        req_builder = req_builder.bearer_auth(token.to_owned());
1225    };
1226    req_builder = req_builder.json(&p_iam_period_create_organization_input);
1227
1228    let req = req_builder.build()?;
1229    let resp = configuration.client.execute(req).await?;
1230
1231    let status = resp.status();
1232    let content_type = resp
1233        .headers()
1234        .get("content-type")
1235        .and_then(|v| v.to_str().ok())
1236        .unwrap_or("application/octet-stream");
1237    let content_type = super::ContentType::from(content_type);
1238
1239    if !status.is_client_error() && !status.is_server_error() {
1240        let content = resp.text().await?;
1241        match content_type {
1242            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1243            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
1244            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
1245        }
1246    } else {
1247        let content = resp.text().await?;
1248        let entity: Option<CreateOrganizationError> = serde_json::from_str(&content).ok();
1249        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1250    }
1251}
1252
1253/// Records a sign-in. Signing in again from another browser adds to the session rather than replacing it, so one person can be signed in from a laptop and a phone at once.  Ask for an exclusive sign-in and the opposite holds: the new sign-in is the only one left and every other browser is signed out. That is the setting to use when one person may hold only one live session at a time.
1254pub async fn create_session(configuration: &configuration::Configuration, iam_period_create_session_in: models::IamPeriodCreateSessionIn) -> Result<models::IamPeriodSession, Error<CreateSessionError>> {
1255    // add a prefix to parameters to efficiently prevent name collisions
1256    let p_iam_period_create_session_in = iam_period_create_session_in;
1257
1258    let uri_str = format!("{}/v1/iam/sessions", configuration.base_path);
1259    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1260
1261    if let Some(ref user_agent) = configuration.user_agent {
1262        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1263    }
1264    if let Some(ref token) = configuration.bearer_access_token {
1265        req_builder = req_builder.bearer_auth(token.to_owned());
1266    };
1267    req_builder = req_builder.json(&p_iam_period_create_session_in);
1268
1269    let req = req_builder.build()?;
1270    let resp = configuration.client.execute(req).await?;
1271
1272    let status = resp.status();
1273    let content_type = resp
1274        .headers()
1275        .get("content-type")
1276        .and_then(|v| v.to_str().ok())
1277        .unwrap_or("application/octet-stream");
1278    let content_type = super::ContentType::from(content_type);
1279
1280    if !status.is_client_error() && !status.is_server_error() {
1281        let content = resp.text().await?;
1282        match content_type {
1283            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1284            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodSession`"))),
1285            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodSession`")))),
1286        }
1287    } else {
1288        let content = resp.text().await?;
1289        let entity: Option<CreateSessionError> = serde_json::from_str(&content).ok();
1290        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1291    }
1292}
1293
1294/// Removes an application. Anyone mid-sign-in through it is turned away and its client credentials stop working, so retire the integration before deleting it.
1295pub async fn delete_iam_applications_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteResult, Error<DeleteIamApplicationsByOwnerByNameError>> {
1296    // add a prefix to parameters to efficiently prevent name collisions
1297    let p_owner = owner;
1298    let p_name = name;
1299
1300    let uri_str = format!("{}/v1/iam/applications/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1301    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1302
1303    if let Some(ref user_agent) = configuration.user_agent {
1304        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1305    }
1306    if let Some(ref token) = configuration.bearer_access_token {
1307        req_builder = req_builder.bearer_auth(token.to_owned());
1308    };
1309
1310    let req = req_builder.build()?;
1311    let resp = configuration.client.execute(req).await?;
1312
1313    let status = resp.status();
1314    let content_type = resp
1315        .headers()
1316        .get("content-type")
1317        .and_then(|v| v.to_str().ok())
1318        .unwrap_or("application/octet-stream");
1319    let content_type = super::ContentType::from(content_type);
1320
1321    if !status.is_client_error() && !status.is_server_error() {
1322        let content = resp.text().await?;
1323        match content_type {
1324            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1325            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteResult`"))),
1326            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteResult`")))),
1327        }
1328    } else {
1329        let content = resp.text().await?;
1330        let entity: Option<DeleteIamApplicationsByOwnerByNameError> = serde_json::from_str(&content).ok();
1331        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1332    }
1333}
1334
1335/// Removes an audit entry. Retention policy is normally what should expire a trail; deleting by hand leaves a gap a reviewer will notice.
1336pub async fn delete_iam_audit_logs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteOutput, Error<DeleteIamAuditLogsByOwnerByNameError>> {
1337    // add a prefix to parameters to efficiently prevent name collisions
1338    let p_owner = owner;
1339    let p_name = name;
1340
1341    let uri_str = format!("{}/v1/iam/audit-logs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1342    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1343
1344    if let Some(ref user_agent) = configuration.user_agent {
1345        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1346    }
1347    if let Some(ref token) = configuration.bearer_access_token {
1348        req_builder = req_builder.bearer_auth(token.to_owned());
1349    };
1350
1351    let req = req_builder.build()?;
1352    let resp = configuration.client.execute(req).await?;
1353
1354    let status = resp.status();
1355    let content_type = resp
1356        .headers()
1357        .get("content-type")
1358        .and_then(|v| v.to_str().ok())
1359        .unwrap_or("application/octet-stream");
1360    let content_type = super::ContentType::from(content_type);
1361
1362    if !status.is_client_error() && !status.is_server_error() {
1363        let content = resp.text().await?;
1364        match content_type {
1365            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1366            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteOutput`"))),
1367            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteOutput`")))),
1368        }
1369    } else {
1370        let content = resp.text().await?;
1371        let entity: Option<DeleteIamAuditLogsByOwnerByNameError> = serde_json::from_str(&content).ok();
1372        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1373    }
1374}
1375
1376/// Removes a signing certificate. Tokens signed with it can no longer be verified, so retire it only once nothing is still presenting them.
1377pub async fn delete_iam_certs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodCertsPeriodDeleteOutput, Error<DeleteIamCertsByOwnerByNameError>> {
1378    // add a prefix to parameters to efficiently prevent name collisions
1379    let p_owner = owner;
1380    let p_name = name;
1381
1382    let uri_str = format!("{}/v1/iam/certs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1383    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1384
1385    if let Some(ref user_agent) = configuration.user_agent {
1386        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1387    }
1388    if let Some(ref token) = configuration.bearer_access_token {
1389        req_builder = req_builder.bearer_auth(token.to_owned());
1390    };
1391
1392    let req = req_builder.build()?;
1393    let resp = configuration.client.execute(req).await?;
1394
1395    let status = resp.status();
1396    let content_type = resp
1397        .headers()
1398        .get("content-type")
1399        .and_then(|v| v.to_str().ok())
1400        .unwrap_or("application/octet-stream");
1401    let content_type = super::ContentType::from(content_type);
1402
1403    if !status.is_client_error() && !status.is_server_error() {
1404        let content = resp.text().await?;
1405        match content_type {
1406            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1407            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCertsPeriodDeleteOutput`"))),
1408            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCertsPeriodDeleteOutput`")))),
1409        }
1410    } else {
1411        let content = resp.text().await?;
1412        let entity: Option<DeleteIamCertsByOwnerByNameError> = serde_json::from_str(&content).ok();
1413        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1414    }
1415}
1416
1417/// Withdraws an invitation. It stops being redeemable at once; anyone who already joined through it keeps their account.
1418pub async fn delete_iam_invitations_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodInvitationsPeriodDeleteOutput, Error<DeleteIamInvitationsByOwnerByNameError>> {
1419    // add a prefix to parameters to efficiently prevent name collisions
1420    let p_owner = owner;
1421    let p_name = name;
1422
1423    let uri_str = format!("{}/v1/iam/invitations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1424    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1425
1426    if let Some(ref user_agent) = configuration.user_agent {
1427        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1428    }
1429    if let Some(ref token) = configuration.bearer_access_token {
1430        req_builder = req_builder.bearer_auth(token.to_owned());
1431    };
1432
1433    let req = req_builder.build()?;
1434    let resp = configuration.client.execute(req).await?;
1435
1436    let status = resp.status();
1437    let content_type = resp
1438        .headers()
1439        .get("content-type")
1440        .and_then(|v| v.to_str().ok())
1441        .unwrap_or("application/octet-stream");
1442    let content_type = super::ContentType::from(content_type);
1443
1444    if !status.is_client_error() && !status.is_server_error() {
1445        let content = resp.text().await?;
1446        match content_type {
1447            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1448            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodDeleteOutput`"))),
1449            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodDeleteOutput`")))),
1450        }
1451    } else {
1452        let content = resp.text().await?;
1453        let entity: Option<DeleteIamInvitationsByOwnerByNameError> = serde_json::from_str(&content).ok();
1454        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1455    }
1456}
1457
1458/// Revokes an API key. Anything still presenting it stops being authorized at once, so roll the replacement out before you revoke.
1459pub async fn delete_iam_keys_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteResponse, Error<DeleteIamKeysByOwnerByNameError>> {
1460    // add a prefix to parameters to efficiently prevent name collisions
1461    let p_owner = owner;
1462    let p_name = name;
1463
1464    let uri_str = format!("{}/v1/iam/keys/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1465    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1466
1467    if let Some(ref user_agent) = configuration.user_agent {
1468        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1469    }
1470    if let Some(ref token) = configuration.bearer_access_token {
1471        req_builder = req_builder.bearer_auth(token.to_owned());
1472    };
1473
1474    let req = req_builder.build()?;
1475    let resp = configuration.client.execute(req).await?;
1476
1477    let status = resp.status();
1478    let content_type = resp
1479        .headers()
1480        .get("content-type")
1481        .and_then(|v| v.to_str().ok())
1482        .unwrap_or("application/octet-stream");
1483    let content_type = super::ContentType::from(content_type);
1484
1485    if !status.is_client_error() && !status.is_server_error() {
1486        let content = resp.text().await?;
1487        match content_type {
1488            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1489            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteResponse`"))),
1490            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteResponse`")))),
1491        }
1492    } else {
1493        let content = resp.text().await?;
1494        let entity: Option<DeleteIamKeysByOwnerByNameError> = serde_json::from_str(&content).ok();
1495        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1496    }
1497}
1498
1499/// Turns a factor off, so sign-in stops asking for it. Naming no factor turns off ALL of them — the reset path. People may do this for themselves; doing it for somebody else takes an administrator, which is what makes it the way back in when a phone is lost.  The recovery codes go with the last factor: they are the way past a challenge, so keeping them alive for an account with nothing to challenge would leave a standing credential behind.
1500pub async fn delete_iam_mfa(configuration: &configuration::Configuration, ) -> Result<(), Error<DeleteIamMfaError>> {
1501
1502    let uri_str = format!("{}/v1/iam/mfa", configuration.base_path);
1503    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1504
1505    if let Some(ref user_agent) = configuration.user_agent {
1506        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1507    }
1508    if let Some(ref token) = configuration.bearer_access_token {
1509        req_builder = req_builder.bearer_auth(token.to_owned());
1510    };
1511
1512    let req = req_builder.build()?;
1513    let resp = configuration.client.execute(req).await?;
1514
1515    let status = resp.status();
1516
1517    if !status.is_client_error() && !status.is_server_error() {
1518        Ok(())
1519    } else {
1520        let content = resp.text().await?;
1521        let entity: Option<DeleteIamMfaError> = serde_json::from_str(&content).ok();
1522        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1523    }
1524}
1525
1526/// Revokes a permission. Everyone who held access only through it loses that access immediately; grants they hold by another route are untouched.
1527pub async fn delete_iam_permissions_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodPermissionPeriodDeleteResponse, Error<DeleteIamPermissionsByOwnerByNameError>> {
1528    // add a prefix to parameters to efficiently prevent name collisions
1529    let p_owner = owner;
1530    let p_name = name;
1531
1532    let uri_str = format!("{}/v1/iam/permissions/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1533    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1534
1535    if let Some(ref user_agent) = configuration.user_agent {
1536        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1537    }
1538    if let Some(ref token) = configuration.bearer_access_token {
1539        req_builder = req_builder.bearer_auth(token.to_owned());
1540    };
1541
1542    let req = req_builder.build()?;
1543    let resp = configuration.client.execute(req).await?;
1544
1545    let status = resp.status();
1546    let content_type = resp
1547        .headers()
1548        .get("content-type")
1549        .and_then(|v| v.to_str().ok())
1550        .unwrap_or("application/octet-stream");
1551    let content_type = super::ContentType::from(content_type);
1552
1553    if !status.is_client_error() && !status.is_server_error() {
1554        let content = resp.text().await?;
1555        match content_type {
1556            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1557            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermissionPeriodDeleteResponse`"))),
1558            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermissionPeriodDeleteResponse`")))),
1559        }
1560    } else {
1561        let content = resp.text().await?;
1562        let entity: Option<DeleteIamPermissionsByOwnerByNameError> = serde_json::from_str(&content).ok();
1563        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1564    }
1565}
1566
1567/// Removes a project. The people and roles in your organization are unchanged; what goes is the scope itself, so move anything addressed by it first.
1568pub async fn delete_iam_projects_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodProjectsPeriodDeleteOutput, Error<DeleteIamProjectsByOwnerByNameError>> {
1569    // add a prefix to parameters to efficiently prevent name collisions
1570    let p_owner = owner;
1571    let p_name = name;
1572
1573    let uri_str = format!("{}/v1/iam/projects/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1574    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1575
1576    if let Some(ref user_agent) = configuration.user_agent {
1577        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1578    }
1579    if let Some(ref token) = configuration.bearer_access_token {
1580        req_builder = req_builder.bearer_auth(token.to_owned());
1581    };
1582
1583    let req = req_builder.build()?;
1584    let resp = configuration.client.execute(req).await?;
1585
1586    let status = resp.status();
1587    let content_type = resp
1588        .headers()
1589        .get("content-type")
1590        .and_then(|v| v.to_str().ok())
1591        .unwrap_or("application/octet-stream");
1592    let content_type = super::ContentType::from(content_type);
1593
1594    if !status.is_client_error() && !status.is_server_error() {
1595        let content = resp.text().await?;
1596        match content_type {
1597            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1598            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProjectsPeriodDeleteOutput`"))),
1599            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProjectsPeriodDeleteOutput`")))),
1600        }
1601    } else {
1602        let content = resp.text().await?;
1603        let entity: Option<DeleteIamProjectsByOwnerByNameError> = serde_json::from_str(&content).ok();
1604        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1605    }
1606}
1607
1608/// Removes a role. Everyone in it loses the access it carried; their accounts, and any other role they hold, are untouched.
1609pub async fn delete_iam_roles_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodRolesPeriodDeleteOutput, Error<DeleteIamRolesByOwnerByNameError>> {
1610    // add a prefix to parameters to efficiently prevent name collisions
1611    let p_owner = owner;
1612    let p_name = name;
1613
1614    let uri_str = format!("{}/v1/iam/roles/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1615    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1616
1617    if let Some(ref user_agent) = configuration.user_agent {
1618        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1619    }
1620    if let Some(ref token) = configuration.bearer_access_token {
1621        req_builder = req_builder.bearer_auth(token.to_owned());
1622    };
1623
1624    let req = req_builder.build()?;
1625    let resp = configuration.client.execute(req).await?;
1626
1627    let status = resp.status();
1628    let content_type = resp
1629        .headers()
1630        .get("content-type")
1631        .and_then(|v| v.to_str().ok())
1632        .unwrap_or("application/octet-stream");
1633    let content_type = super::ContentType::from(content_type);
1634
1635    if !status.is_client_error() && !status.is_server_error() {
1636        let content = resp.text().await?;
1637        match content_type {
1638            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1639            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRolesPeriodDeleteOutput`"))),
1640            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRolesPeriodDeleteOutput`")))),
1641        }
1642    } else {
1643        let content = resp.text().await?;
1644        let entity: Option<DeleteIamRolesByOwnerByNameError> = serde_json::from_str(&content).ok();
1645        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1646    }
1647}
1648
1649/// Deprovisions a person — how removing someone in your identity provider removes their access here. Their sessions stop working immediately. Takes an administrator.
1650pub async fn delete_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<DeleteIamScimV2UsersByOwnerByNameError>> {
1651    // add a prefix to parameters to efficiently prevent name collisions
1652    let p_owner = owner;
1653    let p_name = name;
1654
1655    let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1656    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1657
1658    if let Some(ref user_agent) = configuration.user_agent {
1659        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1660    }
1661    if let Some(ref token) = configuration.bearer_access_token {
1662        req_builder = req_builder.bearer_auth(token.to_owned());
1663    };
1664
1665    let req = req_builder.build()?;
1666    let resp = configuration.client.execute(req).await?;
1667
1668    let status = resp.status();
1669
1670    if !status.is_client_error() && !status.is_server_error() {
1671        Ok(())
1672    } else {
1673        let content = resp.text().await?;
1674        let entity: Option<DeleteIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
1675        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1676    }
1677}
1678
1679/// Serves DELETE /v1/iam/service-accounts/:name.
1680pub async fn delete_iam_service_accounts_by_name(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<DeleteIamServiceAccountsByNameError>> {
1681    // add a prefix to parameters to efficiently prevent name collisions
1682    let p_name = name;
1683
1684    let uri_str = format!("{}/v1/iam/service-accounts/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
1685    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1686
1687    if let Some(ref user_agent) = configuration.user_agent {
1688        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1689    }
1690    if let Some(ref token) = configuration.bearer_access_token {
1691        req_builder = req_builder.bearer_auth(token.to_owned());
1692    };
1693
1694    let req = req_builder.build()?;
1695    let resp = configuration.client.execute(req).await?;
1696
1697    let status = resp.status();
1698
1699    if !status.is_client_error() && !status.is_server_error() {
1700        Ok(())
1701    } else {
1702        let content = resp.text().await?;
1703        let entity: Option<DeleteIamServiceAccountsByNameError> = serde_json::from_str(&content).ok();
1704        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1705    }
1706}
1707
1708/// Removes a person from your organization. Their sessions stop working immediately and the account is gone rather than suspended — to keep the record and only stop sign-in, update the user instead.
1709pub async fn delete_iam_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodUsersPeriodDeleteOutput, Error<DeleteIamUsersByOwnerByNameError>> {
1710    // add a prefix to parameters to efficiently prevent name collisions
1711    let p_owner = owner;
1712    let p_name = name;
1713
1714    let uri_str = format!("{}/v1/iam/users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1715    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1716
1717    if let Some(ref user_agent) = configuration.user_agent {
1718        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1719    }
1720    if let Some(ref token) = configuration.bearer_access_token {
1721        req_builder = req_builder.bearer_auth(token.to_owned());
1722    };
1723
1724    let req = req_builder.build()?;
1725    let resp = configuration.client.execute(req).await?;
1726
1727    let status = resp.status();
1728    let content_type = resp
1729        .headers()
1730        .get("content-type")
1731        .and_then(|v| v.to_str().ok())
1732        .unwrap_or("application/octet-stream");
1733    let content_type = super::ContentType::from(content_type);
1734
1735    if !status.is_client_error() && !status.is_server_error() {
1736        let content = resp.text().await?;
1737        match content_type {
1738            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1739            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUsersPeriodDeleteOutput`"))),
1740            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUsersPeriodDeleteOutput`")))),
1741        }
1742    } else {
1743        let content = resp.text().await?;
1744        let entity: Option<DeleteIamUsersByOwnerByNameError> = serde_json::from_str(&content).ok();
1745        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1746    }
1747}
1748
1749/// Clears the target user's key of the requested TYPE (immediate revoke). Scoped by the same `?type` field mint takes, so revoking the browser key leaves the server key working. A secret key's stored value is the sk- in its schema.Key row.
1750pub async fn delete_iam_users_by_owner_by_name_keys(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<DeleteIamUsersByOwnerByNameKeysError>> {
1751    // add a prefix to parameters to efficiently prevent name collisions
1752    let p_owner = owner;
1753    let p_name = name;
1754
1755    let uri_str = format!("{}/v1/iam/users/{owner}/{name}/keys", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1756    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1757
1758    if let Some(ref user_agent) = configuration.user_agent {
1759        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1760    }
1761    if let Some(ref token) = configuration.bearer_access_token {
1762        req_builder = req_builder.bearer_auth(token.to_owned());
1763    };
1764
1765    let req = req_builder.build()?;
1766    let resp = configuration.client.execute(req).await?;
1767
1768    let status = resp.status();
1769
1770    if !status.is_client_error() && !status.is_server_error() {
1771        Ok(())
1772    } else {
1773        let content = resp.text().await?;
1774        let entity: Option<DeleteIamUsersByOwnerByNameKeysError> = serde_json::from_str(&content).ok();
1775        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1776    }
1777}
1778
1779/// Removes a workspace. The people and roles in your organization are unchanged; what goes is the scope itself.
1780pub async fn delete_iam_workspaces_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWorkspacesPeriodDeleteOutput, Error<DeleteIamWorkspacesByOwnerByNameError>> {
1781    // add a prefix to parameters to efficiently prevent name collisions
1782    let p_owner = owner;
1783    let p_name = name;
1784
1785    let uri_str = format!("{}/v1/iam/workspaces/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1786    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1787
1788    if let Some(ref user_agent) = configuration.user_agent {
1789        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1790    }
1791    if let Some(ref token) = configuration.bearer_access_token {
1792        req_builder = req_builder.bearer_auth(token.to_owned());
1793    };
1794
1795    let req = req_builder.build()?;
1796    let resp = configuration.client.execute(req).await?;
1797
1798    let status = resp.status();
1799    let content_type = resp
1800        .headers()
1801        .get("content-type")
1802        .and_then(|v| v.to_str().ok())
1803        .unwrap_or("application/octet-stream");
1804    let content_type = super::ContentType::from(content_type);
1805
1806    if !status.is_client_error() && !status.is_server_error() {
1807        let content = resp.text().await?;
1808        match content_type {
1809            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1810            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodDeleteOutput`"))),
1811            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodDeleteOutput`")))),
1812        }
1813    } else {
1814        let content = resp.text().await?;
1815        let entity: Option<DeleteIamWorkspacesByOwnerByNameError> = serde_json::from_str(&content).ok();
1816        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1817    }
1818}
1819
1820/// Removes an organization and everything named inside it. There is no undo, and every session issued under it stops working.  The built-in admin organization cannot be deleted — losing it would leave the account with no way back in.
1821pub async fn delete_organization(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodDeleteOrganizationOutput, Error<DeleteOrganizationError>> {
1822    // add a prefix to parameters to efficiently prevent name collisions
1823    let p_owner = owner;
1824    let p_name = name;
1825
1826    let uri_str = format!("{}/v1/iam/organizations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1827    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1828
1829    if let Some(ref user_agent) = configuration.user_agent {
1830        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1831    }
1832    if let Some(ref token) = configuration.bearer_access_token {
1833        req_builder = req_builder.bearer_auth(token.to_owned());
1834    };
1835
1836    let req = req_builder.build()?;
1837    let resp = configuration.client.execute(req).await?;
1838
1839    let status = resp.status();
1840    let content_type = resp
1841        .headers()
1842        .get("content-type")
1843        .and_then(|v| v.to_str().ok())
1844        .unwrap_or("application/octet-stream");
1845    let content_type = super::ContentType::from(content_type);
1846
1847    if !status.is_client_error() && !status.is_server_error() {
1848        let content = resp.text().await?;
1849        match content_type {
1850            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1851            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteOrganizationOutput`"))),
1852            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteOrganizationOutput`")))),
1853        }
1854    } else {
1855        let content = resp.text().await?;
1856        let entity: Option<DeleteOrganizationError> = serde_json::from_str(&content).ok();
1857        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1858    }
1859}
1860
1861/// Removes a provider. Sign-in through it stops for every application that used it, so give those applications another method first.  A provider that is already gone answers \"nothing changed\" rather than an error, so the call is safe to repeat.
1862pub async fn delete_provider(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodMutationResult, Error<DeleteProviderError>> {
1863    // add a prefix to parameters to efficiently prevent name collisions
1864    let p_owner = owner;
1865    let p_name = name;
1866
1867    let uri_str = format!("{}/v1/iam/providers/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1868    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1869
1870    if let Some(ref user_agent) = configuration.user_agent {
1871        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1872    }
1873    if let Some(ref token) = configuration.bearer_access_token {
1874        req_builder = req_builder.bearer_auth(token.to_owned());
1875    };
1876
1877    let req = req_builder.build()?;
1878    let resp = configuration.client.execute(req).await?;
1879
1880    let status = resp.status();
1881    let content_type = resp
1882        .headers()
1883        .get("content-type")
1884        .and_then(|v| v.to_str().ok())
1885        .unwrap_or("application/octet-stream");
1886    let content_type = super::ContentType::from(content_type);
1887
1888    if !status.is_client_error() && !status.is_server_error() {
1889        let content = resp.text().await?;
1890        match content_type {
1891            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1892            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodMutationResult`"))),
1893            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodMutationResult`")))),
1894        }
1895    } else {
1896        let content = resp.text().await?;
1897        let entity: Option<DeleteProviderError> = serde_json::from_str(&content).ok();
1898        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1899    }
1900}
1901
1902/// Signs a person out of one application — the session ends and every browser carrying it stops being authenticated.  A session that is already gone reports that nothing was deleted rather than an error, so the call is safe to repeat.
1903pub async fn delete_session(configuration: &configuration::Configuration, owner: &str, name: &str, application: &str) -> Result<models::IamPeriodDeleteSessionOut, Error<DeleteSessionError>> {
1904    // add a prefix to parameters to efficiently prevent name collisions
1905    let p_owner = owner;
1906    let p_name = name;
1907    let p_application = application;
1908
1909    let uri_str = format!("{}/v1/iam/sessions/{owner}/{name}/{application}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name), application=crate::apis::urlencode(p_application));
1910    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1911
1912    if let Some(ref user_agent) = configuration.user_agent {
1913        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1914    }
1915    if let Some(ref token) = configuration.bearer_access_token {
1916        req_builder = req_builder.bearer_auth(token.to_owned());
1917    };
1918
1919    let req = req_builder.build()?;
1920    let resp = configuration.client.execute(req).await?;
1921
1922    let status = resp.status();
1923    let content_type = resp
1924        .headers()
1925        .get("content-type")
1926        .and_then(|v| v.to_str().ok())
1927        .unwrap_or("application/octet-stream");
1928    let content_type = super::ContentType::from(content_type);
1929
1930    if !status.is_client_error() && !status.is_server_error() {
1931        let content = resp.text().await?;
1932        match content_type {
1933            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1934            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodDeleteSessionOut`"))),
1935            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodDeleteSessionOut`")))),
1936        }
1937    } else {
1938        let content = resp.text().await?;
1939        let entity: Option<DeleteSessionError> = serde_json::from_str(&content).ok();
1940        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1941    }
1942}
1943
1944/// Revokes an access token. Whatever was using it stops being authorized at once.  A token that is already gone answers \"nothing changed\" rather than an error, so the call is safe to repeat.
1945pub async fn delete_token(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodTokenMutation, Error<DeleteTokenError>> {
1946    // add a prefix to parameters to efficiently prevent name collisions
1947    let p_owner = owner;
1948    let p_name = name;
1949
1950    let uri_str = format!("{}/v1/iam/tokens/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1951    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1952
1953    if let Some(ref user_agent) = configuration.user_agent {
1954        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1955    }
1956    if let Some(ref token) = configuration.bearer_access_token {
1957        req_builder = req_builder.bearer_auth(token.to_owned());
1958    };
1959
1960    let req = req_builder.build()?;
1961    let resp = configuration.client.execute(req).await?;
1962
1963    let status = resp.status();
1964    let content_type = resp
1965        .headers()
1966        .get("content-type")
1967        .and_then(|v| v.to_str().ok())
1968        .unwrap_or("application/octet-stream");
1969    let content_type = super::ContentType::from(content_type);
1970
1971    if !status.is_client_error() && !status.is_server_error() {
1972        let content = resp.text().await?;
1973        match content_type {
1974            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1975            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenMutation`"))),
1976            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenMutation`")))),
1977        }
1978    } else {
1979        let content = resp.text().await?;
1980        let entity: Option<DeleteTokenError> = serde_json::from_str(&content).ok();
1981        Err(Error::ResponseError(ResponseContent { status, content, entity }))
1982    }
1983}
1984
1985/// Removes a passkey or security key — what you call when a device is lost. Make sure the person has another way to sign in first.  A credential that is already gone answers \"nothing changed\" rather than an error, so the call is safe to repeat.
1986pub async fn delete_webauthn_credential(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWebauthnCredentialMutationResult, Error<DeleteWebauthnCredentialError>> {
1987    // add a prefix to parameters to efficiently prevent name collisions
1988    let p_owner = owner;
1989    let p_name = name;
1990
1991    let uri_str = format!("{}/v1/iam/webauthn-credentials/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
1992    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1993
1994    if let Some(ref user_agent) = configuration.user_agent {
1995        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1996    }
1997    if let Some(ref token) = configuration.bearer_access_token {
1998        req_builder = req_builder.bearer_auth(token.to_owned());
1999    };
2000
2001    let req = req_builder.build()?;
2002    let resp = configuration.client.execute(req).await?;
2003
2004    let status = resp.status();
2005    let content_type = resp
2006        .headers()
2007        .get("content-type")
2008        .and_then(|v| v.to_str().ok())
2009        .unwrap_or("application/octet-stream");
2010    let content_type = super::ContentType::from(content_type);
2011
2012    if !status.is_client_error() && !status.is_server_error() {
2013        let content = resp.text().await?;
2014        match content_type {
2015            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2016            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`"))),
2017            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`")))),
2018        }
2019    } else {
2020        let content = resp.text().await?;
2021        let entity: Option<DeleteWebauthnCredentialError> = serde_json::from_str(&content).ok();
2022        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2023    }
2024}
2025
2026/// Returns the signed-in person's own account and the organization they belong to — what a console reads to draw the account menu.  Passwords, API secrets and MFA material are stripped. It answers for a session cookie or a bearer token alike.
2027pub async fn get_iam_account(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamAccountError>> {
2028
2029    let uri_str = format!("{}/v1/iam/account", configuration.base_path);
2030    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2031
2032    if let Some(ref user_agent) = configuration.user_agent {
2033        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2034    }
2035    if let Some(ref token) = configuration.bearer_access_token {
2036        req_builder = req_builder.bearer_auth(token.to_owned());
2037    };
2038
2039    let req = req_builder.build()?;
2040    let resp = configuration.client.execute(req).await?;
2041
2042    let status = resp.status();
2043
2044    if !status.is_client_error() && !status.is_server_error() {
2045        Ok(())
2046    } else {
2047        let content = resp.text().await?;
2048        let entity: Option<GetIamAccountError> = serde_json::from_str(&content).ok();
2049        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2050    }
2051}
2052
2053/// Returns the applications in one organization, newest first — each product or site your people sign in to, with the sign-in methods and redirect URIs it allows.
2054pub async fn get_iam_applications(configuration: &configuration::Configuration, owner: &str) -> Result<models::IamPeriodApplicationListResult, Error<GetIamApplicationsError>> {
2055    // add a prefix to parameters to efficiently prevent name collisions
2056    let p_owner = owner;
2057
2058    let uri_str = format!("{}/v1/iam/applications", configuration.base_path);
2059    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2060
2061    req_builder = req_builder.query(&[("owner", &p_owner.to_string())]);
2062    if let Some(ref user_agent) = configuration.user_agent {
2063        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2064    }
2065    if let Some(ref token) = configuration.bearer_access_token {
2066        req_builder = req_builder.bearer_auth(token.to_owned());
2067    };
2068
2069    let req = req_builder.build()?;
2070    let resp = configuration.client.execute(req).await?;
2071
2072    let status = resp.status();
2073    let content_type = resp
2074        .headers()
2075        .get("content-type")
2076        .and_then(|v| v.to_str().ok())
2077        .unwrap_or("application/octet-stream");
2078    let content_type = super::ContentType::from(content_type);
2079
2080    if !status.is_client_error() && !status.is_server_error() {
2081        let content = resp.text().await?;
2082        match content_type {
2083            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2084            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplicationListResult`"))),
2085            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplicationListResult`")))),
2086        }
2087    } else {
2088        let content = resp.text().await?;
2089        let entity: Option<GetIamApplicationsError> = serde_json::from_str(&content).ok();
2090        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2091    }
2092}
2093
2094/// Returns one application: its sign-in methods, its allowed redirect URIs and the client credentials your integration authenticates with.
2095pub async fn get_iam_applications_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodApplication, Error<GetIamApplicationsByOwnerByNameError>> {
2096    // add a prefix to parameters to efficiently prevent name collisions
2097    let p_owner = owner;
2098    let p_name = name;
2099
2100    let uri_str = format!("{}/v1/iam/applications/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
2101    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2102
2103    if let Some(ref user_agent) = configuration.user_agent {
2104        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2105    }
2106    if let Some(ref token) = configuration.bearer_access_token {
2107        req_builder = req_builder.bearer_auth(token.to_owned());
2108    };
2109
2110    let req = req_builder.build()?;
2111    let resp = configuration.client.execute(req).await?;
2112
2113    let status = resp.status();
2114    let content_type = resp
2115        .headers()
2116        .get("content-type")
2117        .and_then(|v| v.to_str().ok())
2118        .unwrap_or("application/octet-stream");
2119    let content_type = super::ContentType::from(content_type);
2120
2121    if !status.is_client_error() && !status.is_server_error() {
2122        let content = resp.text().await?;
2123        match content_type {
2124            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2125            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplication`"))),
2126            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplication`")))),
2127        }
2128    } else {
2129        let content = resp.text().await?;
2130        let entity: Option<GetIamApplicationsByOwnerByNameError> = serde_json::from_str(&content).ok();
2131        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2132    }
2133}
2134
2135/// Returns your organization's audit trail, newest first — who did what, when, and from where. It is the record you reach for during a security review or an incident.  You see your own organization's audit trail and no one else's; which organization that is comes from your credentials, not from the request.
2136pub async fn get_iam_audit_logs(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodListOutput, Error<GetIamAuditLogsError>> {
2137    // add a prefix to parameters to efficiently prevent name collisions
2138    let p_owner = owner;
2139
2140    let uri_str = format!("{}/v1/iam/audit-logs", configuration.base_path);
2141    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2142
2143    if let Some(ref param_value) = p_owner {
2144        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
2145    }
2146    if let Some(ref user_agent) = configuration.user_agent {
2147        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2148    }
2149    if let Some(ref token) = configuration.bearer_access_token {
2150        req_builder = req_builder.bearer_auth(token.to_owned());
2151    };
2152
2153    let req = req_builder.build()?;
2154    let resp = configuration.client.execute(req).await?;
2155
2156    let status = resp.status();
2157    let content_type = resp
2158        .headers()
2159        .get("content-type")
2160        .and_then(|v| v.to_str().ok())
2161        .unwrap_or("application/octet-stream");
2162    let content_type = super::ContentType::from(content_type);
2163
2164    if !status.is_client_error() && !status.is_server_error() {
2165        let content = resp.text().await?;
2166        match content_type {
2167            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2168            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListOutput`"))),
2169            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListOutput`")))),
2170        }
2171    } else {
2172        let content = resp.text().await?;
2173        let entity: Option<GetIamAuditLogsError> = serde_json::from_str(&content).ok();
2174        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2175    }
2176}
2177
2178/// Returns one audit entry in full: the action, the person or key behind it, and the request it came in on.
2179pub async fn get_iam_audit_logs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodAuditLog, Error<GetIamAuditLogsByOwnerByNameError>> {
2180    // add a prefix to parameters to efficiently prevent name collisions
2181    let p_owner = owner;
2182    let p_name = name;
2183
2184    let uri_str = format!("{}/v1/iam/audit-logs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
2185    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2186
2187    if let Some(ref user_agent) = configuration.user_agent {
2188        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2189    }
2190    if let Some(ref token) = configuration.bearer_access_token {
2191        req_builder = req_builder.bearer_auth(token.to_owned());
2192    };
2193
2194    let req = req_builder.build()?;
2195    let resp = configuration.client.execute(req).await?;
2196
2197    let status = resp.status();
2198    let content_type = resp
2199        .headers()
2200        .get("content-type")
2201        .and_then(|v| v.to_str().ok())
2202        .unwrap_or("application/octet-stream");
2203    let content_type = super::ContentType::from(content_type);
2204
2205    if !status.is_client_error() && !status.is_server_error() {
2206        let content = resp.text().await?;
2207        match content_type {
2208            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2209            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAuditLog`"))),
2210            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAuditLog`")))),
2211        }
2212    } else {
2213        let content = resp.text().await?;
2214        let entity: Option<GetIamAuditLogsByOwnerByNameError> = serde_json::from_str(&content).ok();
2215        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2216    }
2217}
2218
2219/// Returns everything a login screen needs to draw itself for one application: its branding, and each sign-in method it offers with the provider details that method needs.  The client secret is masked. Read before anyone has signed in, so it carries only what is safe for a browser to see.
2220pub async fn get_iam_auth_application(configuration: &configuration::Configuration, client_id: Option<&str>, response_type: Option<&str>) -> Result<models::IamPeriodAnswer, Error<GetIamAuthApplicationError>> {
2221    // add a prefix to parameters to efficiently prevent name collisions
2222    let p_client_id = client_id;
2223    let p_response_type = response_type;
2224
2225    let uri_str = format!("{}/v1/iam/auth/application", configuration.base_path);
2226    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2227
2228    if let Some(ref param_value) = p_client_id {
2229        req_builder = req_builder.query(&[("clientId", &param_value.to_string())]);
2230    }
2231    if let Some(ref param_value) = p_response_type {
2232        req_builder = req_builder.query(&[("responseType", &param_value.to_string())]);
2233    }
2234    if let Some(ref user_agent) = configuration.user_agent {
2235        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2236    }
2237    if let Some(ref token) = configuration.bearer_access_token {
2238        req_builder = req_builder.bearer_auth(token.to_owned());
2239    };
2240
2241    let req = req_builder.build()?;
2242    let resp = configuration.client.execute(req).await?;
2243
2244    let status = resp.status();
2245    let content_type = resp
2246        .headers()
2247        .get("content-type")
2248        .and_then(|v| v.to_str().ok())
2249        .unwrap_or("application/octet-stream");
2250    let content_type = super::ContentType::from(content_type);
2251
2252    if !status.is_client_error() && !status.is_server_error() {
2253        let content = resp.text().await?;
2254        match content_type {
2255            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2256            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
2257            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
2258        }
2259    } else {
2260        let content = resp.text().await?;
2261        let entity: Option<GetIamAuthApplicationError> = serde_json::from_str(&content).ok();
2262        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2263    }
2264}
2265
2266/// Returns the sign-in methods one application actually has switched on, so a login screen can render the right buttons for it without you hard-coding a list that drifts the moment you add a provider.  Public by design: it is read before anyone has signed in, and it exposes only which methods exist, never their credentials.
2267pub async fn get_iam_auth_methods(configuration: &configuration::Configuration, client_id: Option<&str>) -> Result<models::IamPeriodAnswer, Error<GetIamAuthMethodsError>> {
2268    // add a prefix to parameters to efficiently prevent name collisions
2269    let p_client_id = client_id;
2270
2271    let uri_str = format!("{}/v1/iam/auth/methods", configuration.base_path);
2272    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2273
2274    if let Some(ref param_value) = p_client_id {
2275        req_builder = req_builder.query(&[("clientId", &param_value.to_string())]);
2276    }
2277    if let Some(ref user_agent) = configuration.user_agent {
2278        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2279    }
2280    if let Some(ref token) = configuration.bearer_access_token {
2281        req_builder = req_builder.bearer_auth(token.to_owned());
2282    };
2283
2284    let req = req_builder.build()?;
2285    let resp = configuration.client.execute(req).await?;
2286
2287    let status = resp.status();
2288    let content_type = resp
2289        .headers()
2290        .get("content-type")
2291        .and_then(|v| v.to_str().ok())
2292        .unwrap_or("application/octet-stream");
2293    let content_type = super::ContentType::from(content_type);
2294
2295    if !status.is_client_error() && !status.is_server_error() {
2296        let content = resp.text().await?;
2297        match content_type {
2298            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2299            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
2300            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
2301        }
2302    } else {
2303        let content = resp.text().await?;
2304        let entity: Option<GetIamAuthMethodsError> = serde_json::from_str(&content).ok();
2305        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2306    }
2307}
2308
2309/// Returns your organization's signing certificates, newest first — the keys the tokens your applications verify are signed with. Private key material is masked.  You see your own organization's certificates and no one else's; which organization that is comes from your credentials, not from the request, so a query parameter can never widen the listing.
2310pub async fn get_iam_certs(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodCertsPeriodListOutput, Error<GetIamCertsError>> {
2311    // add a prefix to parameters to efficiently prevent name collisions
2312    let p_owner = owner;
2313
2314    let uri_str = format!("{}/v1/iam/certs", configuration.base_path);
2315    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2316
2317    if let Some(ref param_value) = p_owner {
2318        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
2319    }
2320    if let Some(ref user_agent) = configuration.user_agent {
2321        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2322    }
2323    if let Some(ref token) = configuration.bearer_access_token {
2324        req_builder = req_builder.bearer_auth(token.to_owned());
2325    };
2326
2327    let req = req_builder.build()?;
2328    let resp = configuration.client.execute(req).await?;
2329
2330    let status = resp.status();
2331    let content_type = resp
2332        .headers()
2333        .get("content-type")
2334        .and_then(|v| v.to_str().ok())
2335        .unwrap_or("application/octet-stream");
2336    let content_type = super::ContentType::from(content_type);
2337
2338    if !status.is_client_error() && !status.is_server_error() {
2339        let content = resp.text().await?;
2340        match content_type {
2341            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2342            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCertsPeriodListOutput`"))),
2343            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCertsPeriodListOutput`")))),
2344        }
2345    } else {
2346        let content = resp.text().await?;
2347        let entity: Option<GetIamCertsError> = serde_json::from_str(&content).ok();
2348        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2349    }
2350}
2351
2352/// Returns one signing certificate — its algorithm, its validity window and its public half. The private key is masked.
2353pub async fn get_iam_certs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodCert, Error<GetIamCertsByOwnerByNameError>> {
2354    // add a prefix to parameters to efficiently prevent name collisions
2355    let p_owner = owner;
2356    let p_name = name;
2357
2358    let uri_str = format!("{}/v1/iam/certs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
2359    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2360
2361    if let Some(ref user_agent) = configuration.user_agent {
2362        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2363    }
2364    if let Some(ref token) = configuration.bearer_access_token {
2365        req_builder = req_builder.bearer_auth(token.to_owned());
2366    };
2367
2368    let req = req_builder.build()?;
2369    let resp = configuration.client.execute(req).await?;
2370
2371    let status = resp.status();
2372    let content_type = resp
2373        .headers()
2374        .get("content-type")
2375        .and_then(|v| v.to_str().ok())
2376        .unwrap_or("application/octet-stream");
2377    let content_type = super::ContentType::from(content_type);
2378
2379    if !status.is_client_error() && !status.is_server_error() {
2380        let content = resp.text().await?;
2381        match content_type {
2382            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2383            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCert`"))),
2384            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCert`")))),
2385        }
2386    } else {
2387        let content = resp.text().await?;
2388        let entity: Option<GetIamCertsByOwnerByNameError> = serde_json::from_str(&content).ok();
2389        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2390    }
2391}
2392
2393/// Returns the calling person's own privacy and communication choices. Somebody who has never set them gets the defaults rather than nothing, so a consent screen always has something to show — insights on, and training UNANSWERED, which is the state that means the screen still has to ask.
2394pub async fn get_iam_consent(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamConsentError>> {
2395
2396    let uri_str = format!("{}/v1/iam/consent", configuration.base_path);
2397    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2398
2399    if let Some(ref user_agent) = configuration.user_agent {
2400        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2401    }
2402    if let Some(ref token) = configuration.bearer_access_token {
2403        req_builder = req_builder.bearer_auth(token.to_owned());
2404    };
2405
2406    let req = req_builder.build()?;
2407    let resp = configuration.client.execute(req).await?;
2408
2409    let status = resp.status();
2410
2411    if !status.is_client_error() && !status.is_server_error() {
2412        Ok(())
2413    } else {
2414        let content = resp.text().await?;
2415        let entity: Option<GetIamConsentError> = serde_json::from_str(&content).ok();
2416        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2417    }
2418}
2419
2420/// Returns your organization's invitations, newest first — who has been asked to join, on what terms, and how many seats each invitation still has left.  You see your own organization's invitations and no one else's; which organization that is comes from your credentials, not from the request.
2421pub async fn get_iam_invitations(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodInvitationsPeriodListOutput, Error<GetIamInvitationsError>> {
2422    // add a prefix to parameters to efficiently prevent name collisions
2423    let p_owner = owner;
2424
2425    let uri_str = format!("{}/v1/iam/invitations", configuration.base_path);
2426    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2427
2428    if let Some(ref param_value) = p_owner {
2429        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
2430    }
2431    if let Some(ref user_agent) = configuration.user_agent {
2432        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2433    }
2434    if let Some(ref token) = configuration.bearer_access_token {
2435        req_builder = req_builder.bearer_auth(token.to_owned());
2436    };
2437
2438    let req = req_builder.build()?;
2439    let resp = configuration.client.execute(req).await?;
2440
2441    let status = resp.status();
2442    let content_type = resp
2443        .headers()
2444        .get("content-type")
2445        .and_then(|v| v.to_str().ok())
2446        .unwrap_or("application/octet-stream");
2447    let content_type = super::ContentType::from(content_type);
2448
2449    if !status.is_client_error() && !status.is_server_error() {
2450        let content = resp.text().await?;
2451        match content_type {
2452            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2453            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodListOutput`"))),
2454            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitationsPeriodListOutput`")))),
2455        }
2456    } else {
2457        let content = resp.text().await?;
2458        let entity: Option<GetIamInvitationsError> = serde_json::from_str(&content).ok();
2459        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2460    }
2461}
2462
2463/// Returns one invitation: who it is for, what it grants on acceptance, and when it expires.
2464pub async fn get_iam_invitations_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodInvitation, Error<GetIamInvitationsByOwnerByNameError>> {
2465    // add a prefix to parameters to efficiently prevent name collisions
2466    let p_owner = owner;
2467    let p_name = name;
2468
2469    let uri_str = format!("{}/v1/iam/invitations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
2470    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2471
2472    if let Some(ref user_agent) = configuration.user_agent {
2473        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2474    }
2475    if let Some(ref token) = configuration.bearer_access_token {
2476        req_builder = req_builder.bearer_auth(token.to_owned());
2477    };
2478
2479    let req = req_builder.build()?;
2480    let resp = configuration.client.execute(req).await?;
2481
2482    let status = resp.status();
2483    let content_type = resp
2484        .headers()
2485        .get("content-type")
2486        .and_then(|v| v.to_str().ok())
2487        .unwrap_or("application/octet-stream");
2488    let content_type = super::ContentType::from(content_type);
2489
2490    if !status.is_client_error() && !status.is_server_error() {
2491        let content = resp.text().await?;
2492        match content_type {
2493            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2494            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitation`"))),
2495            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitation`")))),
2496        }
2497    } else {
2498        let content = resp.text().await?;
2499        let entity: Option<GetIamInvitationsByOwnerByNameError> = serde_json::from_str(&content).ok();
2500        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2501    }
2502}
2503
2504/// Returns your organization's API keys, newest first — what each is called, what it may reach, and its publishable half. Secret halves are never listed.
2505pub async fn get_iam_keys(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodListResponse, Error<GetIamKeysError>> {
2506    // add a prefix to parameters to efficiently prevent name collisions
2507    let p_owner = owner;
2508
2509    let uri_str = format!("{}/v1/iam/keys", configuration.base_path);
2510    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2511
2512    if let Some(ref param_value) = p_owner {
2513        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
2514    }
2515    if let Some(ref user_agent) = configuration.user_agent {
2516        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2517    }
2518    if let Some(ref token) = configuration.bearer_access_token {
2519        req_builder = req_builder.bearer_auth(token.to_owned());
2520    };
2521
2522    let req = req_builder.build()?;
2523    let resp = configuration.client.execute(req).await?;
2524
2525    let status = resp.status();
2526    let content_type = resp
2527        .headers()
2528        .get("content-type")
2529        .and_then(|v| v.to_str().ok())
2530        .unwrap_or("application/octet-stream");
2531    let content_type = super::ContentType::from(content_type);
2532
2533    if !status.is_client_error() && !status.is_server_error() {
2534        let content = resp.text().await?;
2535        match content_type {
2536            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2537            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListResponse`"))),
2538            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListResponse`")))),
2539        }
2540    } else {
2541        let content = resp.text().await?;
2542        let entity: Option<GetIamKeysError> = serde_json::from_str(&content).ok();
2543        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2544    }
2545}
2546
2547/// Returns one API key: what it is called, what it may reach, and when it was issued.
2548pub async fn get_iam_keys_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodKey, Error<GetIamKeysByOwnerByNameError>> {
2549    // add a prefix to parameters to efficiently prevent name collisions
2550    let p_owner = owner;
2551    let p_name = name;
2552
2553    let uri_str = format!("{}/v1/iam/keys/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
2554    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2555
2556    if let Some(ref user_agent) = configuration.user_agent {
2557        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2558    }
2559    if let Some(ref token) = configuration.bearer_access_token {
2560        req_builder = req_builder.bearer_auth(token.to_owned());
2561    };
2562
2563    let req = req_builder.build()?;
2564    let resp = configuration.client.execute(req).await?;
2565
2566    let status = resp.status();
2567    let content_type = resp
2568        .headers()
2569        .get("content-type")
2570        .and_then(|v| v.to_str().ok())
2571        .unwrap_or("application/octet-stream");
2572    let content_type = super::ContentType::from(content_type);
2573
2574    if !status.is_client_error() && !status.is_server_error() {
2575        let content = resp.text().await?;
2576        match content_type {
2577            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2578            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodKey`"))),
2579            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodKey`")))),
2580        }
2581    } else {
2582        let content = resp.text().await?;
2583        let entity: Option<GetIamKeysByOwnerByNameError> = serde_json::from_str(&content).ok();
2584        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2585    }
2586}
2587
2588/// Answers which organization a publishable key belongs to — what a service calls to attribute a request that arrived carrying a key shipped in a browser. This is the noun spelling of `/v1/iam/resolve-key`, the same handler at the address that replaces it; both answer while callers migrate.  It names an ORGANIZATION and never a person. No path through it loads or returns a user, so a key placed in client code cannot become a way to learn who anyone is — which is the whole reason this is a separate endpoint from the one below.  A key that is expired, secret rather than publishable, or simply unknown all answer with the same sentence and a `code` saying which it was. Only a confidential service that has already proved it may resolve keys reads that code — there is no anonymous caller here to probe which keys exist — and telling those apart is what lets a holder be told to re-mint an expired key instead of hunting a configuration error.
2589pub async fn get_iam_keys_org(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamKeysOrgError>> {
2590
2591    let uri_str = format!("{}/v1/iam/keys/org", configuration.base_path);
2592    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2593
2594    if let Some(ref user_agent) = configuration.user_agent {
2595        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2596    }
2597    if let Some(ref token) = configuration.bearer_access_token {
2598        req_builder = req_builder.bearer_auth(token.to_owned());
2599    };
2600
2601    let req = req_builder.build()?;
2602    let resp = configuration.client.execute(req).await?;
2603
2604    let status = resp.status();
2605
2606    if !status.is_client_error() && !status.is_server_error() {
2607        Ok(())
2608    } else {
2609        let content = resp.text().await?;
2610        let entity: Option<GetIamKeysOrgError> = serde_json::from_str(&content).ok();
2611        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2612    }
2613}
2614
2615/// Answers who a secret key belongs to — the owner and name a gateway needs to attribute and bill a request that arrived carrying an `sk-`. This is the noun spelling of `/v1/iam/get-user?accessKey=`, the same handler at the address that replaces it; both answer while callers migrate.  It resolves a KEY and nothing else. The verb it replaces also reads a user by `?id=`, and carrying that here would make this a second address for the user read — the exact thing being retired. Ask for a person by name at the user read; ask here only what a credential resolves to.  Requires a confidential caller: the resolver authenticates as an app, so a request without that credential resolves nothing rather than falling back to an anonymous lookup. An unresolvable key answers with a `code` distinguishing expired from wrong-endpoint from unknown, so the holder can be told which one cure applies.
2616pub async fn get_iam_keys_principal(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamKeysPrincipalError>> {
2617
2618    let uri_str = format!("{}/v1/iam/keys/principal", configuration.base_path);
2619    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2620
2621    if let Some(ref user_agent) = configuration.user_agent {
2622        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2623    }
2624    if let Some(ref token) = configuration.bearer_access_token {
2625        req_builder = req_builder.bearer_auth(token.to_owned());
2626    };
2627
2628    let req = req_builder.build()?;
2629    let resp = configuration.client.execute(req).await?;
2630
2631    let status = resp.status();
2632
2633    if !status.is_client_error() && !status.is_server_error() {
2634        Ok(())
2635    } else {
2636        let content = resp.text().await?;
2637        let entity: Option<GetIamKeysPrincipalError> = serde_json::from_str(&content).ok();
2638        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2639    }
2640}
2641
2642/// Returns the sign-in identities linked to the calling person's account — every provider they can currently sign in with. It is what a security page lists next to the option to disconnect one.
2643pub async fn get_iam_linked_accounts(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamLinkedAccountsError>> {
2644
2645    let uri_str = format!("{}/v1/iam/linked-accounts", configuration.base_path);
2646    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2647
2648    if let Some(ref user_agent) = configuration.user_agent {
2649        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2650    }
2651    if let Some(ref token) = configuration.bearer_access_token {
2652        req_builder = req_builder.bearer_auth(token.to_owned());
2653    };
2654
2655    let req = req_builder.build()?;
2656    let resp = configuration.client.execute(req).await?;
2657
2658    let status = resp.status();
2659
2660    if !status.is_client_error() && !status.is_server_error() {
2661        Ok(())
2662    } else {
2663        let content = resp.text().await?;
2664        let entity: Option<GetIamLinkedAccountsError> = serde_json::from_str(&content).ok();
2665        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2666    }
2667}
2668
2669/// Answers either question about who belongs where: which organizations one person can act in, or who can act in one organization.  Both are org-scoped: a non-SuperAdmin may ask about ITS OWN org's roster, or about a user whose home org is its own, and nothing else. The bound comes from the verified credential via authz.Scope, so a request parameter can never widen it — a membership row names who may act and spend in an org, so a cross-tenant read is a customer roster leak.
2670pub async fn get_iam_memberships(configuration: &configuration::Configuration, user: Option<&str>, org: Option<&str>) -> Result<models::IamPeriodAnswer, Error<GetIamMembershipsError>> {
2671    // add a prefix to parameters to efficiently prevent name collisions
2672    let p_user = user;
2673    let p_org = org;
2674
2675    let uri_str = format!("{}/v1/iam/memberships", configuration.base_path);
2676    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2677
2678    if let Some(ref param_value) = p_user {
2679        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
2680    }
2681    if let Some(ref param_value) = p_org {
2682        req_builder = req_builder.query(&[("org", &param_value.to_string())]);
2683    }
2684    if let Some(ref user_agent) = configuration.user_agent {
2685        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2686    }
2687    if let Some(ref token) = configuration.bearer_access_token {
2688        req_builder = req_builder.bearer_auth(token.to_owned());
2689    };
2690
2691    let req = req_builder.build()?;
2692    let resp = configuration.client.execute(req).await?;
2693
2694    let status = resp.status();
2695    let content_type = resp
2696        .headers()
2697        .get("content-type")
2698        .and_then(|v| v.to_str().ok())
2699        .unwrap_or("application/octet-stream");
2700    let content_type = super::ContentType::from(content_type);
2701
2702    if !status.is_client_error() && !status.is_server_error() {
2703        let content = resp.text().await?;
2704        match content_type {
2705            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2706            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
2707            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
2708        }
2709    } else {
2710        let content = resp.text().await?;
2711        let entity: Option<GetIamMembershipsError> = serde_json::from_str(&content).ok();
2712        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2713    }
2714}
2715
2716/// Starts a sign-in — the address you send a browser to, and the beginning of every OAuth and OpenID Connect flow.  If the person is ALREADY signed in here, it does not ask them again: it returns them to the application with a one-time code and they never see this page. Otherwise it shows the right way to sign in for the application they are signing in to, or hands off to another identity provider if that is what they pick.  A client can say what it wants with `prompt`: `none` means answer without any screen at all — with the code if a session exists, with an error if not, but never with a page; `login` means ask for the password again even if a session exists; `select_account` means let the person choose which identity to use.  It returns only to an address the application has registered. That check happens before anything else, so a request naming an unregistered address is refused where the person can see it rather than being bounced onwards.
2717pub async fn get_iam_oauth_authorize(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthAuthorizeError>> {
2718
2719    let uri_str = format!("{}/v1/iam/oauth/authorize", configuration.base_path);
2720    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2721
2722    if let Some(ref user_agent) = configuration.user_agent {
2723        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2724    }
2725    if let Some(ref token) = configuration.bearer_access_token {
2726        req_builder = req_builder.bearer_auth(token.to_owned());
2727    };
2728
2729    let req = req_builder.build()?;
2730    let resp = configuration.client.execute(req).await?;
2731
2732    let status = resp.status();
2733
2734    if !status.is_client_error() && !status.is_server_error() {
2735        Ok(())
2736    } else {
2737        let content = resp.text().await?;
2738        let entity: Option<GetIamOauthAuthorizeError> = serde_json::from_str(&content).ok();
2739        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2740    }
2741}
2742
2743/// Completes the round-trip: it resolves and burns the single-use transaction (checking expiry + browser binding), exchanges and verifies the IdP response, links or provisions the local user, and mints the iam authorization code the relying party expects — then redirects to the original redirect_uri with code + state.
2744pub async fn get_iam_oauth_callback(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthCallbackError>> {
2745
2746    let uri_str = format!("{}/v1/iam/oauth/callback", configuration.base_path);
2747    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2748
2749    if let Some(ref user_agent) = configuration.user_agent {
2750        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2751    }
2752    if let Some(ref token) = configuration.bearer_access_token {
2753        req_builder = req_builder.bearer_auth(token.to_owned());
2754    };
2755
2756    let req = req_builder.build()?;
2757    let resp = configuration.client.execute(req).await?;
2758
2759    let status = resp.status();
2760
2761    if !status.is_client_error() && !status.is_server_error() {
2762        Ok(())
2763    } else {
2764        let content = resp.text().await?;
2765        let entity: Option<GetIamOauthCallbackError> = serde_json::from_str(&content).ok();
2766        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2767    }
2768}
2769
2770/// Ends a sign-in and sends the browser somewhere sensible. Accepts GET or POST, so it works as a plain link.  It ACTUALLY signs you out — worth stating, because a logout that computes a redirect and answers {\"status\":\"ok\"} while ending no session and revoking no token is worse than none: the person on the shared machine believes it worked. Three things happen here, in this order:   1. The browser session dies — sid revoked server-side AND the cookie expired     (sessions.Clear). Server-side revocation is the load-bearing half: a copy     of the cookie taken before logout must not still resolve.  2. The relying party's tokens are revoked when an id_token_hint names it, so     the refresh token cannot mint a fresh access token after the human left.     Revocation state is authoritative — a JWT's `exp` still reads valid for     days, so expiry is necessary but never sufficient.  3. Only then is a redirect considered, and only to a REGISTERED uri.  The open-redirect guard is unchanged: a redirect happens only when a VERIFIED id_token_hint identifies the application and that application has registered the target. Anything else refuses to redirect — nobody can turn your logout link into a redirect to a site of their choosing.
2771pub async fn get_iam_oauth_logout(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthLogoutError>> {
2772
2773    let uri_str = format!("{}/v1/iam/oauth/logout", configuration.base_path);
2774    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2775
2776    if let Some(ref user_agent) = configuration.user_agent {
2777        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2778    }
2779    if let Some(ref token) = configuration.bearer_access_token {
2780        req_builder = req_builder.bearer_auth(token.to_owned());
2781    };
2782
2783    let req = req_builder.build()?;
2784    let resp = configuration.client.execute(req).await?;
2785
2786    let status = resp.status();
2787
2788    if !status.is_client_error() && !status.is_server_error() {
2789        Ok(())
2790    } else {
2791        let content = resp.text().await?;
2792        let entity: Option<GetIamOauthLogoutError> = serde_json::from_str(&content).ok();
2793        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2794    }
2795}
2796
2797/// Returns the profile claims for whoever the access token belongs to — the standard OpenID Connect way to find out who is calling you without your application storing anything itself.  The token must still be live: revoke it and this stops answering.
2798pub async fn get_iam_oauth_userinfo(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamOauthUserinfoError>> {
2799
2800    let uri_str = format!("{}/v1/iam/oauth/userinfo", configuration.base_path);
2801    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2802
2803    if let Some(ref user_agent) = configuration.user_agent {
2804        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2805    }
2806    if let Some(ref token) = configuration.bearer_access_token {
2807        req_builder = req_builder.bearer_auth(token.to_owned());
2808    };
2809
2810    let req = req_builder.build()?;
2811    let resp = configuration.client.execute(req).await?;
2812
2813    let status = resp.status();
2814
2815    if !status.is_client_error() && !status.is_server_error() {
2816        Ok(())
2817    } else {
2818        let content = resp.text().await?;
2819        let entity: Option<GetIamOauthUserinfoError> = serde_json::from_str(&content).ok();
2820        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2821    }
2822}
2823
2824/// Publishes the public keys that verify the tokens issued here — the one URL you point a service at so it can check a token itself, offline, without calling back and without holding any secret of ours.  Keys appear here before they start signing and stay after they stop, so a rotation never leaves a live token unverifiable. Nothing private is ever published.
2825pub async fn get_iam_period_well_known_jwks(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamPeriodWellKnownJwksError>> {
2826
2827    let uri_str = format!("{}/v1/iam/.well-known/jwks", configuration.base_path);
2828    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2829
2830    if let Some(ref user_agent) = configuration.user_agent {
2831        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2832    }
2833    if let Some(ref token) = configuration.bearer_access_token {
2834        req_builder = req_builder.bearer_auth(token.to_owned());
2835    };
2836
2837    let req = req_builder.build()?;
2838    let resp = configuration.client.execute(req).await?;
2839
2840    let status = resp.status();
2841
2842    if !status.is_client_error() && !status.is_server_error() {
2843        Ok(())
2844    } else {
2845        let content = resp.text().await?;
2846        let entity: Option<GetIamPeriodWellKnownJwksError> = serde_json::from_str(&content).ok();
2847        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2848    }
2849}
2850
2851/// Returns the OpenID Connect discovery document — the one URL you point a standards-compliant client at so it can find every other endpoint on its own, instead of you configuring them by hand.  It advertises only what is actually implemented, so a client that reads it cannot ask for a flow that will fail: the authorization-code flow, PKCE with S256, the supported grants, and the signing algorithms whose public keys the JWKS really publishes.  The issuer is derived from the host you asked on and is the same value the tokens carry, so a client that pins the issuer never sees it change.
2852pub async fn get_iam_period_well_known_oauth_authorization_server(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamPeriodWellKnownOauthAuthorizationServerError>> {
2853
2854    let uri_str = format!("{}/v1/iam/.well-known/oauth-authorization-server", configuration.base_path);
2855    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2856
2857    if let Some(ref user_agent) = configuration.user_agent {
2858        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2859    }
2860    if let Some(ref token) = configuration.bearer_access_token {
2861        req_builder = req_builder.bearer_auth(token.to_owned());
2862    };
2863
2864    let req = req_builder.build()?;
2865    let resp = configuration.client.execute(req).await?;
2866
2867    let status = resp.status();
2868
2869    if !status.is_client_error() && !status.is_server_error() {
2870        Ok(())
2871    } else {
2872        let content = resp.text().await?;
2873        let entity: Option<GetIamPeriodWellKnownOauthAuthorizationServerError> = serde_json::from_str(&content).ok();
2874        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2875    }
2876}
2877
2878/// Returns the OpenID Connect discovery document — the one URL you point a standards-compliant client at so it can find every other endpoint on its own, instead of you configuring them by hand.  It advertises only what is actually implemented, so a client that reads it cannot ask for a flow that will fail: the authorization-code flow, PKCE with S256, the supported grants, and the signing algorithms whose public keys the JWKS really publishes.  The issuer is derived from the host you asked on and is the same value the tokens carry, so a client that pins the issuer never sees it change.
2879pub async fn get_iam_period_well_known_openid_configuration(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamPeriodWellKnownOpenidConfigurationError>> {
2880
2881    let uri_str = format!("{}/v1/iam/.well-known/openid-configuration", configuration.base_path);
2882    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2883
2884    if let Some(ref user_agent) = configuration.user_agent {
2885        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2886    }
2887    if let Some(ref token) = configuration.bearer_access_token {
2888        req_builder = req_builder.bearer_auth(token.to_owned());
2889    };
2890
2891    let req = req_builder.build()?;
2892    let resp = configuration.client.execute(req).await?;
2893
2894    let status = resp.status();
2895
2896    if !status.is_client_error() && !status.is_server_error() {
2897        Ok(())
2898    } else {
2899        let content = resp.text().await?;
2900        let entity: Option<GetIamPeriodWellKnownOpenidConfigurationError> = serde_json::from_str(&content).ok();
2901        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2902    }
2903}
2904
2905/// Returns the permissions in one organization, newest first — each one a grant saying which people or roles may do what, and to which resources.
2906pub async fn get_iam_permissions(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodPermissionPeriodListResponse, Error<GetIamPermissionsError>> {
2907    // add a prefix to parameters to efficiently prevent name collisions
2908    let p_owner = owner;
2909
2910    let uri_str = format!("{}/v1/iam/permissions", configuration.base_path);
2911    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2912
2913    if let Some(ref param_value) = p_owner {
2914        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
2915    }
2916    if let Some(ref user_agent) = configuration.user_agent {
2917        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2918    }
2919    if let Some(ref token) = configuration.bearer_access_token {
2920        req_builder = req_builder.bearer_auth(token.to_owned());
2921    };
2922
2923    let req = req_builder.build()?;
2924    let resp = configuration.client.execute(req).await?;
2925
2926    let status = resp.status();
2927    let content_type = resp
2928        .headers()
2929        .get("content-type")
2930        .and_then(|v| v.to_str().ok())
2931        .unwrap_or("application/octet-stream");
2932    let content_type = super::ContentType::from(content_type);
2933
2934    if !status.is_client_error() && !status.is_server_error() {
2935        let content = resp.text().await?;
2936        match content_type {
2937            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2938            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermissionPeriodListResponse`"))),
2939            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermissionPeriodListResponse`")))),
2940        }
2941    } else {
2942        let content = resp.text().await?;
2943        let entity: Option<GetIamPermissionsError> = serde_json::from_str(&content).ok();
2944        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2945    }
2946}
2947
2948/// Returns one permission: who it grants to, what it allows, and the resources it covers.
2949pub async fn get_iam_permissions_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodPermission, Error<GetIamPermissionsByOwnerByNameError>> {
2950    // add a prefix to parameters to efficiently prevent name collisions
2951    let p_owner = owner;
2952    let p_name = name;
2953
2954    let uri_str = format!("{}/v1/iam/permissions/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
2955    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2956
2957    if let Some(ref user_agent) = configuration.user_agent {
2958        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2959    }
2960    if let Some(ref token) = configuration.bearer_access_token {
2961        req_builder = req_builder.bearer_auth(token.to_owned());
2962    };
2963
2964    let req = req_builder.build()?;
2965    let resp = configuration.client.execute(req).await?;
2966
2967    let status = resp.status();
2968    let content_type = resp
2969        .headers()
2970        .get("content-type")
2971        .and_then(|v| v.to_str().ok())
2972        .unwrap_or("application/octet-stream");
2973    let content_type = super::ContentType::from(content_type);
2974
2975    if !status.is_client_error() && !status.is_server_error() {
2976        let content = resp.text().await?;
2977        match content_type {
2978            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2979            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermission`"))),
2980            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermission`")))),
2981        }
2982    } else {
2983        let content = resp.text().await?;
2984        let entity: Option<GetIamPermissionsByOwnerByNameError> = serde_json::from_str(&content).ok();
2985        Err(Error::ResponseError(ResponseContent { status, content, entity }))
2986    }
2987}
2988
2989/// Returns your organization's projects, newest first — the scope people pick between when their work is separated by product or client rather than by team.  You see your own organization's projects and no one else's; which organization that is comes from your credentials, not from the request.
2990pub async fn get_iam_projects(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodProjectsPeriodListOutput, Error<GetIamProjectsError>> {
2991    // add a prefix to parameters to efficiently prevent name collisions
2992    let p_owner = owner;
2993
2994    let uri_str = format!("{}/v1/iam/projects", configuration.base_path);
2995    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2996
2997    if let Some(ref param_value) = p_owner {
2998        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
2999    }
3000    if let Some(ref user_agent) = configuration.user_agent {
3001        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3002    }
3003    if let Some(ref token) = configuration.bearer_access_token {
3004        req_builder = req_builder.bearer_auth(token.to_owned());
3005    };
3006
3007    let req = req_builder.build()?;
3008    let resp = configuration.client.execute(req).await?;
3009
3010    let status = resp.status();
3011    let content_type = resp
3012        .headers()
3013        .get("content-type")
3014        .and_then(|v| v.to_str().ok())
3015        .unwrap_or("application/octet-stream");
3016    let content_type = super::ContentType::from(content_type);
3017
3018    if !status.is_client_error() && !status.is_server_error() {
3019        let content = resp.text().await?;
3020        match content_type {
3021            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3022            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProjectsPeriodListOutput`"))),
3023            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProjectsPeriodListOutput`")))),
3024        }
3025    } else {
3026        let content = resp.text().await?;
3027        let entity: Option<GetIamProjectsError> = serde_json::from_str(&content).ok();
3028        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3029    }
3030}
3031
3032/// Returns one project: what it is called and how it is set up.
3033pub async fn get_iam_projects_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodProject, Error<GetIamProjectsByOwnerByNameError>> {
3034    // add a prefix to parameters to efficiently prevent name collisions
3035    let p_owner = owner;
3036    let p_name = name;
3037
3038    let uri_str = format!("{}/v1/iam/projects/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3039    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3040
3041    if let Some(ref user_agent) = configuration.user_agent {
3042        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3043    }
3044    if let Some(ref token) = configuration.bearer_access_token {
3045        req_builder = req_builder.bearer_auth(token.to_owned());
3046    };
3047
3048    let req = req_builder.build()?;
3049    let resp = configuration.client.execute(req).await?;
3050
3051    let status = resp.status();
3052    let content_type = resp
3053        .headers()
3054        .get("content-type")
3055        .and_then(|v| v.to_str().ok())
3056        .unwrap_or("application/octet-stream");
3057    let content_type = super::ContentType::from(content_type);
3058
3059    if !status.is_client_error() && !status.is_server_error() {
3060        let content = resp.text().await?;
3061        match content_type {
3062            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3063            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProject`"))),
3064            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProject`")))),
3065        }
3066    } else {
3067        let content = resp.text().await?;
3068        let entity: Option<GetIamProjectsByOwnerByNameError> = serde_json::from_str(&content).ok();
3069        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3070    }
3071}
3072
3073/// Publishes the public key your registry uses to verify the tokens issued above — the one URL to configure so the registry trusts logins without holding any secret of its own.  If no signing key is available it refuses rather than publishing an empty set, because a registry that trusts nothing looks identical to one that trusts everything until somebody tries to push.
3074pub async fn get_iam_registry_jwks(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamRegistryJwksError>> {
3075
3076    let uri_str = format!("{}/v1/iam/registry/jwks", configuration.base_path);
3077    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3078
3079    if let Some(ref user_agent) = configuration.user_agent {
3080        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3081    }
3082    if let Some(ref token) = configuration.bearer_access_token {
3083        req_builder = req_builder.bearer_auth(token.to_owned());
3084    };
3085
3086    let req = req_builder.build()?;
3087    let resp = configuration.client.execute(req).await?;
3088
3089    let status = resp.status();
3090
3091    if !status.is_client_error() && !status.is_server_error() {
3092        Ok(())
3093    } else {
3094        let content = resp.text().await?;
3095        let entity: Option<GetIamRegistryJwksError> = serde_json::from_str(&content).ok();
3096        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3097    }
3098}
3099
3100/// Signs a container client in to your registry. `docker login`, and every build tool that pushes or pulls images, lands here: it exchanges the credential for a short-lived token scoped to exactly the repositories that credential may touch.  Both of the shapes container tooling uses are accepted, so the same login works whichever client your pipeline runs.
3101pub async fn get_iam_registry_token(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamRegistryTokenError>> {
3102
3103    let uri_str = format!("{}/v1/iam/registry/token", configuration.base_path);
3104    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3105
3106    if let Some(ref user_agent) = configuration.user_agent {
3107        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3108    }
3109    if let Some(ref token) = configuration.bearer_access_token {
3110        req_builder = req_builder.bearer_auth(token.to_owned());
3111    };
3112
3113    let req = req_builder.build()?;
3114    let resp = configuration.client.execute(req).await?;
3115
3116    let status = resp.status();
3117
3118    if !status.is_client_error() && !status.is_server_error() {
3119        Ok(())
3120    } else {
3121        let content = resp.text().await?;
3122        let entity: Option<GetIamRegistryTokenError> = serde_json::from_str(&content).ok();
3123        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3124    }
3125}
3126
3127/// Returns your organization's roles, newest first — each a named group of people that permissions are granted to.  You see your own organization's roles and no one else's; which organization that is comes from your credentials, not from the request.
3128pub async fn get_iam_roles(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodRolesPeriodListOutput, Error<GetIamRolesError>> {
3129    // add a prefix to parameters to efficiently prevent name collisions
3130    let p_owner = owner;
3131
3132    let uri_str = format!("{}/v1/iam/roles", configuration.base_path);
3133    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3134
3135    if let Some(ref param_value) = p_owner {
3136        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
3137    }
3138    if let Some(ref user_agent) = configuration.user_agent {
3139        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3140    }
3141    if let Some(ref token) = configuration.bearer_access_token {
3142        req_builder = req_builder.bearer_auth(token.to_owned());
3143    };
3144
3145    let req = req_builder.build()?;
3146    let resp = configuration.client.execute(req).await?;
3147
3148    let status = resp.status();
3149    let content_type = resp
3150        .headers()
3151        .get("content-type")
3152        .and_then(|v| v.to_str().ok())
3153        .unwrap_or("application/octet-stream");
3154    let content_type = super::ContentType::from(content_type);
3155
3156    if !status.is_client_error() && !status.is_server_error() {
3157        let content = resp.text().await?;
3158        match content_type {
3159            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3160            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRolesPeriodListOutput`"))),
3161            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRolesPeriodListOutput`")))),
3162        }
3163    } else {
3164        let content = resp.text().await?;
3165        let entity: Option<GetIamRolesError> = serde_json::from_str(&content).ok();
3166        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3167    }
3168}
3169
3170/// Returns one role: who is in it, and the roles it includes.
3171pub async fn get_iam_roles_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodRole, Error<GetIamRolesByOwnerByNameError>> {
3172    // add a prefix to parameters to efficiently prevent name collisions
3173    let p_owner = owner;
3174    let p_name = name;
3175
3176    let uri_str = format!("{}/v1/iam/roles/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3177    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3178
3179    if let Some(ref user_agent) = configuration.user_agent {
3180        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3181    }
3182    if let Some(ref token) = configuration.bearer_access_token {
3183        req_builder = req_builder.bearer_auth(token.to_owned());
3184    };
3185
3186    let req = req_builder.build()?;
3187    let resp = configuration.client.execute(req).await?;
3188
3189    let status = resp.status();
3190    let content_type = resp
3191        .headers()
3192        .get("content-type")
3193        .and_then(|v| v.to_str().ok())
3194        .unwrap_or("application/octet-stream");
3195    let content_type = super::ContentType::from(content_type);
3196
3197    if !status.is_client_error() && !status.is_server_error() {
3198        let content = resp.text().await?;
3199        match content_type {
3200            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3201            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRole`"))),
3202            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRole`")))),
3203        }
3204    } else {
3205        let content = resp.text().await?;
3206        let entity: Option<GetIamRolesByOwnerByNameError> = serde_json::from_str(&content).ok();
3207        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3208    }
3209}
3210
3211/// Returns the kinds of record this directory provisions and the address of each, so your identity provider discovers them rather than having them configured by hand.
3212pub async fn get_iam_scim_v2_resourcetypes(configuration: &configuration::Configuration, ) -> Result<models::IamPeriodListResponse, Error<GetIamScimV2ResourcetypesError>> {
3213
3214    let uri_str = format!("{}/v1/iam/scim/v2/ResourceTypes", configuration.base_path);
3215    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3216
3217    if let Some(ref user_agent) = configuration.user_agent {
3218        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3219    }
3220    if let Some(ref token) = configuration.bearer_access_token {
3221        req_builder = req_builder.bearer_auth(token.to_owned());
3222    };
3223
3224    let req = req_builder.build()?;
3225    let resp = configuration.client.execute(req).await?;
3226
3227    let status = resp.status();
3228    let content_type = resp
3229        .headers()
3230        .get("content-type")
3231        .and_then(|v| v.to_str().ok())
3232        .unwrap_or("application/octet-stream");
3233    let content_type = super::ContentType::from(content_type);
3234
3235    if !status.is_client_error() && !status.is_server_error() {
3236        let content = resp.text().await?;
3237        match content_type {
3238            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3239            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListResponse`"))),
3240            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListResponse`")))),
3241        }
3242    } else {
3243        let content = resp.text().await?;
3244        let entity: Option<GetIamScimV2ResourcetypesError> = serde_json::from_str(&content).ok();
3245        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3246    }
3247}
3248
3249/// Returns one provisionable record kind in full.
3250pub async fn get_iam_scim_v2_resourcetypes_by_name(configuration: &configuration::Configuration, name: &str) -> Result<serde_json::Value, Error<GetIamScimV2ResourcetypesByNameError>> {
3251    // add a prefix to parameters to efficiently prevent name collisions
3252    let p_name = name;
3253
3254    let uri_str = format!("{}/v1/iam/scim/v2/ResourceTypes/{name}", configuration.base_path, name=crate::apis::urlencode(p_name));
3255    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3256
3257    if let Some(ref user_agent) = configuration.user_agent {
3258        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3259    }
3260    if let Some(ref token) = configuration.bearer_access_token {
3261        req_builder = req_builder.bearer_auth(token.to_owned());
3262    };
3263
3264    let req = req_builder.build()?;
3265    let resp = configuration.client.execute(req).await?;
3266
3267    let status = resp.status();
3268    let content_type = resp
3269        .headers()
3270        .get("content-type")
3271        .and_then(|v| v.to_str().ok())
3272        .unwrap_or("application/octet-stream");
3273    let content_type = super::ContentType::from(content_type);
3274
3275    if !status.is_client_error() && !status.is_server_error() {
3276        let content = resp.text().await?;
3277        match content_type {
3278            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3279            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
3280            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
3281        }
3282    } else {
3283        let content = resp.text().await?;
3284        let entity: Option<GetIamScimV2ResourcetypesByNameError> = serde_json::from_str(&content).ok();
3285        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3286    }
3287}
3288
3289/// Returns the attribute definitions this directory understands, so your identity provider knows which fields it may send and what they mean before it sends any.
3290pub async fn get_iam_scim_v2_schemas(configuration: &configuration::Configuration, ) -> Result<models::IamPeriodListResponse, Error<GetIamScimV2SchemasError>> {
3291
3292    let uri_str = format!("{}/v1/iam/scim/v2/Schemas", configuration.base_path);
3293    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3294
3295    if let Some(ref user_agent) = configuration.user_agent {
3296        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3297    }
3298    if let Some(ref token) = configuration.bearer_access_token {
3299        req_builder = req_builder.bearer_auth(token.to_owned());
3300    };
3301
3302    let req = req_builder.build()?;
3303    let resp = configuration.client.execute(req).await?;
3304
3305    let status = resp.status();
3306    let content_type = resp
3307        .headers()
3308        .get("content-type")
3309        .and_then(|v| v.to_str().ok())
3310        .unwrap_or("application/octet-stream");
3311    let content_type = super::ContentType::from(content_type);
3312
3313    if !status.is_client_error() && !status.is_server_error() {
3314        let content = resp.text().await?;
3315        match content_type {
3316            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3317            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListResponse`"))),
3318            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListResponse`")))),
3319        }
3320    } else {
3321        let content = resp.text().await?;
3322        let entity: Option<GetIamScimV2SchemasError> = serde_json::from_str(&content).ok();
3323        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3324    }
3325}
3326
3327/// Returns one attribute definition in full.
3328pub async fn get_iam_scim_v2_schemas_by_id(configuration: &configuration::Configuration, id: &str) -> Result<serde_json::Value, Error<GetIamScimV2SchemasByIdError>> {
3329    // add a prefix to parameters to efficiently prevent name collisions
3330    let p_id = id;
3331
3332    let uri_str = format!("{}/v1/iam/scim/v2/Schemas/{id}", configuration.base_path, id=crate::apis::urlencode(p_id));
3333    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3334
3335    if let Some(ref user_agent) = configuration.user_agent {
3336        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3337    }
3338    if let Some(ref token) = configuration.bearer_access_token {
3339        req_builder = req_builder.bearer_auth(token.to_owned());
3340    };
3341
3342    let req = req_builder.build()?;
3343    let resp = configuration.client.execute(req).await?;
3344
3345    let status = resp.status();
3346    let content_type = resp
3347        .headers()
3348        .get("content-type")
3349        .and_then(|v| v.to_str().ok())
3350        .unwrap_or("application/octet-stream");
3351    let content_type = super::ContentType::from(content_type);
3352
3353    if !status.is_client_error() && !status.is_server_error() {
3354        let content = resp.text().await?;
3355        match content_type {
3356            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3357            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `serde_json::Value`"))),
3358            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `serde_json::Value`")))),
3359        }
3360    } else {
3361        let content = resp.text().await?;
3362        let entity: Option<GetIamScimV2SchemasByIdError> = serde_json::from_str(&content).ok();
3363        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3364    }
3365}
3366
3367/// Tells your identity provider which parts of SCIM this directory supports, so it configures itself instead of you filling in a form.  Filtering and partial updates are supported. Bulk operations, sorting and entity tags are not — an IdP that reads this will not attempt them.
3368pub async fn get_iam_scim_v2_serviceproviderconfig(configuration: &configuration::Configuration, ) -> Result<models::IamPeriodConfig, Error<GetIamScimV2ServiceproviderconfigError>> {
3369
3370    let uri_str = format!("{}/v1/iam/scim/v2/ServiceProviderConfig", configuration.base_path);
3371    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3372
3373    if let Some(ref user_agent) = configuration.user_agent {
3374        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3375    }
3376    if let Some(ref token) = configuration.bearer_access_token {
3377        req_builder = req_builder.bearer_auth(token.to_owned());
3378    };
3379
3380    let req = req_builder.build()?;
3381    let resp = configuration.client.execute(req).await?;
3382
3383    let status = resp.status();
3384    let content_type = resp
3385        .headers()
3386        .get("content-type")
3387        .and_then(|v| v.to_str().ok())
3388        .unwrap_or("application/octet-stream");
3389    let content_type = super::ContentType::from(content_type);
3390
3391    if !status.is_client_error() && !status.is_server_error() {
3392        let content = resp.text().await?;
3393        match content_type {
3394            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3395            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodConfig`"))),
3396            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodConfig`")))),
3397        }
3398    } else {
3399        let content = resp.text().await?;
3400        let entity: Option<GetIamScimV2ServiceproviderconfigError> = serde_json::from_str(&content).ok();
3401        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3402    }
3403}
3404
3405/// Returns the people in your organization to your identity provider, in the standard SCIM shape, so an IdP can reconcile its directory against ours. Searchable by username or email address, and paged.  Reading the whole list takes an administrator; an ordinary person is refused.
3406pub async fn get_iam_scim_v2_users(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamScimV2UsersError>> {
3407
3408    let uri_str = format!("{}/v1/iam/scim/v2/Users", configuration.base_path);
3409    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3410
3411    if let Some(ref user_agent) = configuration.user_agent {
3412        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3413    }
3414    if let Some(ref token) = configuration.bearer_access_token {
3415        req_builder = req_builder.bearer_auth(token.to_owned());
3416    };
3417
3418    let req = req_builder.build()?;
3419    let resp = configuration.client.execute(req).await?;
3420
3421    let status = resp.status();
3422
3423    if !status.is_client_error() && !status.is_server_error() {
3424        Ok(())
3425    } else {
3426        let content = resp.text().await?;
3427        let entity: Option<GetIamScimV2UsersError> = serde_json::from_str(&content).ok();
3428        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3429    }
3430}
3431
3432/// Returns one person in the standard SCIM shape. An administrator may read anyone in the organization; everyone else may read only themselves.
3433pub async fn get_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<GetIamScimV2UsersByOwnerByNameError>> {
3434    // add a prefix to parameters to efficiently prevent name collisions
3435    let p_owner = owner;
3436    let p_name = name;
3437
3438    let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3439    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3440
3441    if let Some(ref user_agent) = configuration.user_agent {
3442        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3443    }
3444    if let Some(ref token) = configuration.bearer_access_token {
3445        req_builder = req_builder.bearer_auth(token.to_owned());
3446    };
3447
3448    let req = req_builder.build()?;
3449    let resp = configuration.client.execute(req).await?;
3450
3451    let status = resp.status();
3452
3453    if !status.is_client_error() && !status.is_server_error() {
3454        Ok(())
3455    } else {
3456        let content = resp.text().await?;
3457        let entity: Option<GetIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
3458        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3459    }
3460}
3461
3462/// Returns your organization's service accounts — what each is called and when it was created. Never their secrets: a key's secret half exists in a response exactly once, when it is minted. Paginated in memory over the already org-scoped slice — the set per org is small, so a dedicated count query is overkill (v1 service_account.go:296-307).
3463pub async fn get_iam_service_accounts(configuration: &configuration::Configuration, organization: Option<&str>, p: Option<i32>, page_size: Option<i32>) -> Result<models::IamPeriodAnswer, Error<GetIamServiceAccountsError>> {
3464    // add a prefix to parameters to efficiently prevent name collisions
3465    let p_organization = organization;
3466    let p_p = p;
3467    let p_page_size = page_size;
3468
3469    let uri_str = format!("{}/v1/iam/service-accounts", configuration.base_path);
3470    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3471
3472    if let Some(ref param_value) = p_organization {
3473        req_builder = req_builder.query(&[("organization", &param_value.to_string())]);
3474    }
3475    if let Some(ref param_value) = p_p {
3476        req_builder = req_builder.query(&[("p", &param_value.to_string())]);
3477    }
3478    if let Some(ref param_value) = p_page_size {
3479        req_builder = req_builder.query(&[("pageSize", &param_value.to_string())]);
3480    }
3481    if let Some(ref user_agent) = configuration.user_agent {
3482        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3483    }
3484    if let Some(ref token) = configuration.bearer_access_token {
3485        req_builder = req_builder.bearer_auth(token.to_owned());
3486    };
3487
3488    let req = req_builder.build()?;
3489    let resp = configuration.client.execute(req).await?;
3490
3491    let status = resp.status();
3492    let content_type = resp
3493        .headers()
3494        .get("content-type")
3495        .and_then(|v| v.to_str().ok())
3496        .unwrap_or("application/octet-stream");
3497    let content_type = super::ContentType::from(content_type);
3498
3499    if !status.is_client_error() && !status.is_server_error() {
3500        let content = resp.text().await?;
3501        match content_type {
3502            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3503            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
3504            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
3505        }
3506    } else {
3507        let content = resp.text().await?;
3508        let entity: Option<GetIamServiceAccountsError> = serde_json::from_str(&content).ok();
3509        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3510    }
3511}
3512
3513/// Returns a page of the people in your organization, with the total so you can page through the rest. Passwords, API secrets and MFA material are stripped from every entry.
3514pub async fn get_iam_users(configuration: &configuration::Configuration, owner: &str, email: Option<&str>, limit: Option<i32>, offset: Option<i32>) -> Result<models::IamPeriodUsersPeriodListOutput, Error<GetIamUsersError>> {
3515    // add a prefix to parameters to efficiently prevent name collisions
3516    let p_owner = owner;
3517    let p_email = email;
3518    let p_limit = limit;
3519    let p_offset = offset;
3520
3521    let uri_str = format!("{}/v1/iam/users", configuration.base_path);
3522    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3523
3524    req_builder = req_builder.query(&[("owner", &p_owner.to_string())]);
3525    if let Some(ref param_value) = p_email {
3526        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
3527    }
3528    if let Some(ref param_value) = p_limit {
3529        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
3530    }
3531    if let Some(ref param_value) = p_offset {
3532        req_builder = req_builder.query(&[("offset", &param_value.to_string())]);
3533    }
3534    if let Some(ref user_agent) = configuration.user_agent {
3535        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3536    }
3537    if let Some(ref token) = configuration.bearer_access_token {
3538        req_builder = req_builder.bearer_auth(token.to_owned());
3539    };
3540
3541    let req = req_builder.build()?;
3542    let resp = configuration.client.execute(req).await?;
3543
3544    let status = resp.status();
3545    let content_type = resp
3546        .headers()
3547        .get("content-type")
3548        .and_then(|v| v.to_str().ok())
3549        .unwrap_or("application/octet-stream");
3550    let content_type = super::ContentType::from(content_type);
3551
3552    if !status.is_client_error() && !status.is_server_error() {
3553        let content = resp.text().await?;
3554        match content_type {
3555            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3556            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUsersPeriodListOutput`"))),
3557            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUsersPeriodListOutput`")))),
3558        }
3559    } else {
3560        let content = resp.text().await?;
3561        let entity: Option<GetIamUsersError> = serde_json::from_str(&content).ok();
3562        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3563    }
3564}
3565
3566/// Returns one person in your organization, addressed by their username or by their email address. Passwords, API secrets and MFA material are stripped from the response.  An address that names two accounts names none: the read refuses rather than picking one, and says so instead of reporting \"no such user\". Handing back an arbitrary one of two rows is how somebody gets added to a team under a colleague's identity.
3567pub async fn get_iam_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, email: Option<&str>) -> Result<models::IamPeriodUser, Error<GetIamUsersByOwnerByNameError>> {
3568    // add a prefix to parameters to efficiently prevent name collisions
3569    let p_owner = owner;
3570    let p_name = name;
3571    let p_email = email;
3572
3573    let uri_str = format!("{}/v1/iam/users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3574    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3575
3576    if let Some(ref param_value) = p_email {
3577        req_builder = req_builder.query(&[("email", &param_value.to_string())]);
3578    }
3579    if let Some(ref user_agent) = configuration.user_agent {
3580        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3581    }
3582    if let Some(ref token) = configuration.bearer_access_token {
3583        req_builder = req_builder.bearer_auth(token.to_owned());
3584    };
3585
3586    let req = req_builder.build()?;
3587    let resp = configuration.client.execute(req).await?;
3588
3589    let status = resp.status();
3590    let content_type = resp
3591        .headers()
3592        .get("content-type")
3593        .and_then(|v| v.to_str().ok())
3594        .unwrap_or("application/octet-stream");
3595    let content_type = super::ContentType::from(content_type);
3596
3597    if !status.is_client_error() && !status.is_server_error() {
3598        let content = resp.text().await?;
3599        match content_type {
3600            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3601            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUser`"))),
3602            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUser`")))),
3603        }
3604    } else {
3605        let content = resp.text().await?;
3606        let entity: Option<GetIamUsersByOwnerByNameError> = serde_json::from_str(&content).ok();
3607        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3608    }
3609}
3610
3611/// Starts a wallet sign-in: it returns a one-time challenge for the wallet to sign. The challenge is good once and is tied to the site that asked for it, so a signature collected elsewhere cannot be replayed here.
3612pub async fn get_iam_web3_nonce(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWeb3NonceError>> {
3613
3614    let uri_str = format!("{}/v1/iam/web3/nonce", configuration.base_path);
3615    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3616
3617    if let Some(ref user_agent) = configuration.user_agent {
3618        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3619    }
3620    if let Some(ref token) = configuration.bearer_access_token {
3621        req_builder = req_builder.bearer_auth(token.to_owned());
3622    };
3623
3624    let req = req_builder.build()?;
3625    let resp = configuration.client.execute(req).await?;
3626
3627    let status = resp.status();
3628
3629    if !status.is_client_error() && !status.is_server_error() {
3630        Ok(())
3631    } else {
3632        let content = resp.text().await?;
3633        let entity: Option<GetIamWeb3NonceError> = serde_json::from_str(&content).ok();
3634        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3635    }
3636}
3637
3638/// Starts a passkey sign-in: it returns the challenge the person's authenticator signs.  The account is named in the query, and the challenge is bound to it, so what may answer is decided here — by the server, from the row — and the finish checks the answer against that decision rather than recomputing it.
3639pub async fn get_iam_webauthn_signin_begin(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWebauthnSigninBeginError>> {
3640
3641    let uri_str = format!("{}/v1/iam/webauthn/signin/begin", configuration.base_path);
3642    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3643
3644    if let Some(ref user_agent) = configuration.user_agent {
3645        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3646    }
3647    if let Some(ref token) = configuration.bearer_access_token {
3648        req_builder = req_builder.bearer_auth(token.to_owned());
3649    };
3650
3651    let req = req_builder.build()?;
3652    let resp = configuration.client.execute(req).await?;
3653
3654    let status = resp.status();
3655
3656    if !status.is_client_error() && !status.is_server_error() {
3657        Ok(())
3658    } else {
3659        let content = resp.text().await?;
3660        let entity: Option<GetIamWebauthnSigninBeginError> = serde_json::from_str(&content).ok();
3661        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3662    }
3663}
3664
3665/// Starts enrolling a passkey for the signed-in person: it returns the options their browser hands to the authenticator.  Passkeys already on the account are EXCLUDED, so a second enrollment on a device that already holds one is refused by the authenticator itself rather than silently producing a duplicate the person cannot tell apart.
3666pub async fn get_iam_webauthn_signup_begin(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWebauthnSignupBeginError>> {
3667
3668    let uri_str = format!("{}/v1/iam/webauthn/signup/begin", configuration.base_path);
3669    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3670
3671    if let Some(ref user_agent) = configuration.user_agent {
3672        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3673    }
3674    if let Some(ref token) = configuration.bearer_access_token {
3675        req_builder = req_builder.bearer_auth(token.to_owned());
3676    };
3677
3678    let req = req_builder.build()?;
3679    let resp = configuration.client.execute(req).await?;
3680
3681    let status = resp.status();
3682
3683    if !status.is_client_error() && !status.is_server_error() {
3684        Ok(())
3685    } else {
3686        let content = resp.text().await?;
3687        let entity: Option<GetIamWebauthnSignupBeginError> = serde_json::from_str(&content).ok();
3688        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3689    }
3690}
3691
3692/// Tells you who the current caller is — the lightweight check a page makes on load to decide whether to render signed-in or signed-out.  It answers for a session cookie or a bearer token alike, and says plainly when nobody is signed in rather than failing.
3693pub async fn get_iam_whoami(configuration: &configuration::Configuration, ) -> Result<(), Error<GetIamWhoamiError>> {
3694
3695    let uri_str = format!("{}/v1/iam/whoami", configuration.base_path);
3696    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3697
3698    if let Some(ref user_agent) = configuration.user_agent {
3699        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3700    }
3701    if let Some(ref token) = configuration.bearer_access_token {
3702        req_builder = req_builder.bearer_auth(token.to_owned());
3703    };
3704
3705    let req = req_builder.build()?;
3706    let resp = configuration.client.execute(req).await?;
3707
3708    let status = resp.status();
3709
3710    if !status.is_client_error() && !status.is_server_error() {
3711        Ok(())
3712    } else {
3713        let content = resp.text().await?;
3714        let entity: Option<GetIamWhoamiError> = serde_json::from_str(&content).ok();
3715        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3716    }
3717}
3718
3719/// Returns your organization's workspaces, newest first — the scope a team works in, alongside projects rather than instead of them.  You see your own organization's workspaces and no one else's; which organization that is comes from your credentials, not from the request.
3720pub async fn get_iam_workspaces(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodWorkspacesPeriodListOutput, Error<GetIamWorkspacesError>> {
3721    // add a prefix to parameters to efficiently prevent name collisions
3722    let p_owner = owner;
3723
3724    let uri_str = format!("{}/v1/iam/workspaces", configuration.base_path);
3725    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3726
3727    if let Some(ref param_value) = p_owner {
3728        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
3729    }
3730    if let Some(ref user_agent) = configuration.user_agent {
3731        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3732    }
3733    if let Some(ref token) = configuration.bearer_access_token {
3734        req_builder = req_builder.bearer_auth(token.to_owned());
3735    };
3736
3737    let req = req_builder.build()?;
3738    let resp = configuration.client.execute(req).await?;
3739
3740    let status = resp.status();
3741    let content_type = resp
3742        .headers()
3743        .get("content-type")
3744        .and_then(|v| v.to_str().ok())
3745        .unwrap_or("application/octet-stream");
3746    let content_type = super::ContentType::from(content_type);
3747
3748    if !status.is_client_error() && !status.is_server_error() {
3749        let content = resp.text().await?;
3750        match content_type {
3751            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3752            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodListOutput`"))),
3753            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspacesPeriodListOutput`")))),
3754        }
3755    } else {
3756        let content = resp.text().await?;
3757        let entity: Option<GetIamWorkspacesError> = serde_json::from_str(&content).ok();
3758        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3759    }
3760}
3761
3762/// Returns one workspace: what it is called and how it is set up.
3763pub async fn get_iam_workspaces_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWorkspace, Error<GetIamWorkspacesByOwnerByNameError>> {
3764    // add a prefix to parameters to efficiently prevent name collisions
3765    let p_owner = owner;
3766    let p_name = name;
3767
3768    let uri_str = format!("{}/v1/iam/workspaces/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3769    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3770
3771    if let Some(ref user_agent) = configuration.user_agent {
3772        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3773    }
3774    if let Some(ref token) = configuration.bearer_access_token {
3775        req_builder = req_builder.bearer_auth(token.to_owned());
3776    };
3777
3778    let req = req_builder.build()?;
3779    let resp = configuration.client.execute(req).await?;
3780
3781    let status = resp.status();
3782    let content_type = resp
3783        .headers()
3784        .get("content-type")
3785        .and_then(|v| v.to_str().ok())
3786        .unwrap_or("application/octet-stream");
3787    let content_type = super::ContentType::from(content_type);
3788
3789    if !status.is_client_error() && !status.is_server_error() {
3790        let content = resp.text().await?;
3791        match content_type {
3792            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3793            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspace`"))),
3794            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspace`")))),
3795        }
3796    } else {
3797        let content = resp.text().await?;
3798        let entity: Option<GetIamWorkspacesByOwnerByNameError> = serde_json::from_str(&content).ok();
3799        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3800    }
3801}
3802
3803/// Returns one organization: its display, its defaults and the sign-in rules everyone in it inherits.
3804pub async fn get_organization(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodOrganization, Error<GetOrganizationError>> {
3805    // add a prefix to parameters to efficiently prevent name collisions
3806    let p_owner = owner;
3807    let p_name = name;
3808
3809    let uri_str = format!("{}/v1/iam/organizations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3810    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3811
3812    if let Some(ref user_agent) = configuration.user_agent {
3813        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3814    }
3815    if let Some(ref token) = configuration.bearer_access_token {
3816        req_builder = req_builder.bearer_auth(token.to_owned());
3817    };
3818
3819    let req = req_builder.build()?;
3820    let resp = configuration.client.execute(req).await?;
3821
3822    let status = resp.status();
3823    let content_type = resp
3824        .headers()
3825        .get("content-type")
3826        .and_then(|v| v.to_str().ok())
3827        .unwrap_or("application/octet-stream");
3828    let content_type = super::ContentType::from(content_type);
3829
3830    if !status.is_client_error() && !status.is_server_error() {
3831        let content = resp.text().await?;
3832        match content_type {
3833            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3834            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
3835            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
3836        }
3837    } else {
3838        let content = resp.text().await?;
3839        let entity: Option<GetOrganizationError> = serde_json::from_str(&content).ok();
3840        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3841    }
3842}
3843
3844/// Returns one provider: what it connects to and how it is configured. Its credentials come back masked.
3845pub async fn get_provider(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodProviderResult, Error<GetProviderError>> {
3846    // add a prefix to parameters to efficiently prevent name collisions
3847    let p_owner = owner;
3848    let p_name = name;
3849
3850    let uri_str = format!("{}/v1/iam/providers/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3851    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3852
3853    if let Some(ref user_agent) = configuration.user_agent {
3854        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3855    }
3856    if let Some(ref token) = configuration.bearer_access_token {
3857        req_builder = req_builder.bearer_auth(token.to_owned());
3858    };
3859
3860    let req = req_builder.build()?;
3861    let resp = configuration.client.execute(req).await?;
3862
3863    let status = resp.status();
3864    let content_type = resp
3865        .headers()
3866        .get("content-type")
3867        .and_then(|v| v.to_str().ok())
3868        .unwrap_or("application/octet-stream");
3869    let content_type = super::ContentType::from(content_type);
3870
3871    if !status.is_client_error() && !status.is_server_error() {
3872        let content = resp.text().await?;
3873        match content_type {
3874            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3875            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProviderResult`"))),
3876            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProviderResult`")))),
3877        }
3878    } else {
3879        let content = resp.text().await?;
3880        let entity: Option<GetProviderError> = serde_json::from_str(&content).ok();
3881        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3882    }
3883}
3884
3885/// Returns one person's session in one application — when it began and which browsers or devices are still carrying it.
3886pub async fn get_session(configuration: &configuration::Configuration, owner: &str, name: &str, application: &str) -> Result<models::IamPeriodSession, Error<GetSessionError>> {
3887    // add a prefix to parameters to efficiently prevent name collisions
3888    let p_owner = owner;
3889    let p_name = name;
3890    let p_application = application;
3891
3892    let uri_str = format!("{}/v1/iam/sessions/{owner}/{name}/{application}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name), application=crate::apis::urlencode(p_application));
3893    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3894
3895    if let Some(ref user_agent) = configuration.user_agent {
3896        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3897    }
3898    if let Some(ref token) = configuration.bearer_access_token {
3899        req_builder = req_builder.bearer_auth(token.to_owned());
3900    };
3901
3902    let req = req_builder.build()?;
3903    let resp = configuration.client.execute(req).await?;
3904
3905    let status = resp.status();
3906    let content_type = resp
3907        .headers()
3908        .get("content-type")
3909        .and_then(|v| v.to_str().ok())
3910        .unwrap_or("application/octet-stream");
3911    let content_type = super::ContentType::from(content_type);
3912
3913    if !status.is_client_error() && !status.is_server_error() {
3914        let content = resp.text().await?;
3915        match content_type {
3916            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3917            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodSession`"))),
3918            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodSession`")))),
3919        }
3920    } else {
3921        let content = resp.text().await?;
3922        let entity: Option<GetSessionError> = serde_json::from_str(&content).ok();
3923        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3924    }
3925}
3926
3927/// Returns one access token: who and what it was issued to, and when it expires.
3928pub async fn get_token(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodTokenResult, Error<GetTokenError>> {
3929    // add a prefix to parameters to efficiently prevent name collisions
3930    let p_owner = owner;
3931    let p_name = name;
3932
3933    let uri_str = format!("{}/v1/iam/tokens/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3934    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3935
3936    if let Some(ref user_agent) = configuration.user_agent {
3937        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3938    }
3939    if let Some(ref token) = configuration.bearer_access_token {
3940        req_builder = req_builder.bearer_auth(token.to_owned());
3941    };
3942
3943    let req = req_builder.build()?;
3944    let resp = configuration.client.execute(req).await?;
3945
3946    let status = resp.status();
3947    let content_type = resp
3948        .headers()
3949        .get("content-type")
3950        .and_then(|v| v.to_str().ok())
3951        .unwrap_or("application/octet-stream");
3952    let content_type = super::ContentType::from(content_type);
3953
3954    if !status.is_client_error() && !status.is_server_error() {
3955        let content = resp.text().await?;
3956        match content_type {
3957            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3958            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenResult`"))),
3959            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenResult`")))),
3960        }
3961    } else {
3962        let content = resp.text().await?;
3963        let entity: Option<GetTokenError> = serde_json::from_str(&content).ok();
3964        Err(Error::ResponseError(ResponseContent { status, content, entity }))
3965    }
3966}
3967
3968/// Returns one passkey or security key: whose it is, what device it lives on, and when it was registered.
3969pub async fn get_webauthn_credential(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<models::IamPeriodWebauthnCredentialResult, Error<GetWebauthnCredentialError>> {
3970    // add a prefix to parameters to efficiently prevent name collisions
3971    let p_owner = owner;
3972    let p_name = name;
3973
3974    let uri_str = format!("{}/v1/iam/webauthn-credentials/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
3975    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3976
3977    if let Some(ref user_agent) = configuration.user_agent {
3978        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3979    }
3980    if let Some(ref token) = configuration.bearer_access_token {
3981        req_builder = req_builder.bearer_auth(token.to_owned());
3982    };
3983
3984    let req = req_builder.build()?;
3985    let resp = configuration.client.execute(req).await?;
3986
3987    let status = resp.status();
3988    let content_type = resp
3989        .headers()
3990        .get("content-type")
3991        .and_then(|v| v.to_str().ok())
3992        .unwrap_or("application/octet-stream");
3993    let content_type = super::ContentType::from(content_type);
3994
3995    if !status.is_client_error() && !status.is_server_error() {
3996        let content = resp.text().await?;
3997        match content_type {
3998            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3999            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`"))),
4000            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialResult`")))),
4001        }
4002    } else {
4003        let content = resp.text().await?;
4004        let entity: Option<GetWebauthnCredentialError> = serde_json::from_str(&content).ok();
4005        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4006    }
4007}
4008
4009/// Returns the organizations you can act in, the ones you belong to first and the rest after, newest first, narrowed by an optional query against the name or the display name.  Platform operators see every organization; everyone else sees their own. Pass the cursor from the previous page to continue; an empty cursor in the answer means there is nothing more.  THE SCOPE IS THE HANDLER'S OWN, so it holds at every endpoint. The Guard refuses a bearerless request before this runs, but the MCP server carries a typed op to its handler with no middleware in front of it — a handler that read no principal would answer such a caller with the whole registry. Reading the principal here is what makes the answer the same one over both.
4010pub async fn list_organizations(configuration: &configuration::Configuration, x_forwarded_for: Option<&str>, q: Option<&str>, limit: Option<i32>, cursor: Option<&str>) -> Result<models::IamPeriodListOrganizationsOutput, Error<ListOrganizationsError>> {
4011    // add a prefix to parameters to efficiently prevent name collisions
4012    let p_x_forwarded_for = x_forwarded_for;
4013    let p_q = q;
4014    let p_limit = limit;
4015    let p_cursor = cursor;
4016
4017    let uri_str = format!("{}/v1/iam/organizations", configuration.base_path);
4018    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4019
4020    if let Some(ref param_value) = p_q {
4021        req_builder = req_builder.query(&[("q", &param_value.to_string())]);
4022    }
4023    if let Some(ref param_value) = p_limit {
4024        req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
4025    }
4026    if let Some(ref param_value) = p_cursor {
4027        req_builder = req_builder.query(&[("cursor", &param_value.to_string())]);
4028    }
4029    if let Some(ref user_agent) = configuration.user_agent {
4030        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4031    }
4032    if let Some(param_value) = p_x_forwarded_for {
4033        req_builder = req_builder.header("X-Forwarded-For", param_value.to_string());
4034    }
4035    if let Some(ref token) = configuration.bearer_access_token {
4036        req_builder = req_builder.bearer_auth(token.to_owned());
4037    };
4038
4039    let req = req_builder.build()?;
4040    let resp = configuration.client.execute(req).await?;
4041
4042    let status = resp.status();
4043    let content_type = resp
4044        .headers()
4045        .get("content-type")
4046        .and_then(|v| v.to_str().ok())
4047        .unwrap_or("application/octet-stream");
4048    let content_type = super::ContentType::from(content_type);
4049
4050    if !status.is_client_error() && !status.is_server_error() {
4051        let content = resp.text().await?;
4052        match content_type {
4053            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4054            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListOrganizationsOutput`"))),
4055            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListOrganizationsOutput`")))),
4056        }
4057    } else {
4058        let content = resp.text().await?;
4059        let entity: Option<ListOrganizationsError> = serde_json::from_str(&content).ok();
4060        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4061    }
4062}
4063
4064/// Returns your organization's providers, newest first — the identity providers your people sign in with, and the senders and connectors your applications go through.  You see your own organization's providers and no one else's; which organization that is comes from your credentials, not from the request.
4065pub async fn list_providers(configuration: &configuration::Configuration, owner: Option<&str>) -> Result<models::IamPeriodListProvidersOut, Error<ListProvidersError>> {
4066    // add a prefix to parameters to efficiently prevent name collisions
4067    let p_owner = owner;
4068
4069    let uri_str = format!("{}/v1/iam/providers", configuration.base_path);
4070    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4071
4072    if let Some(ref param_value) = p_owner {
4073        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
4074    }
4075    if let Some(ref user_agent) = configuration.user_agent {
4076        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4077    }
4078    if let Some(ref token) = configuration.bearer_access_token {
4079        req_builder = req_builder.bearer_auth(token.to_owned());
4080    };
4081
4082    let req = req_builder.build()?;
4083    let resp = configuration.client.execute(req).await?;
4084
4085    let status = resp.status();
4086    let content_type = resp
4087        .headers()
4088        .get("content-type")
4089        .and_then(|v| v.to_str().ok())
4090        .unwrap_or("application/octet-stream");
4091    let content_type = super::ContentType::from(content_type);
4092
4093    if !status.is_client_error() && !status.is_server_error() {
4094        let content = resp.text().await?;
4095        match content_type {
4096            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4097            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListProvidersOut`"))),
4098            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListProvidersOut`")))),
4099        }
4100    } else {
4101        let content = resp.text().await?;
4102        let entity: Option<ListProvidersError> = serde_json::from_str(&content).ok();
4103        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4104    }
4105}
4106
4107/// Returns who is currently signed in to your organization, newest first, and can be narrowed to one person or one application. It is what you read before signing someone out.
4108pub async fn list_sessions(configuration: &configuration::Configuration, owner: &str, name: Option<&str>, application: Option<&str>) -> Result<models::IamPeriodListSessionsOut, Error<ListSessionsError>> {
4109    // add a prefix to parameters to efficiently prevent name collisions
4110    let p_owner = owner;
4111    let p_name = name;
4112    let p_application = application;
4113
4114    let uri_str = format!("{}/v1/iam/sessions", configuration.base_path);
4115    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4116
4117    req_builder = req_builder.query(&[("owner", &p_owner.to_string())]);
4118    if let Some(ref param_value) = p_name {
4119        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
4120    }
4121    if let Some(ref param_value) = p_application {
4122        req_builder = req_builder.query(&[("application", &param_value.to_string())]);
4123    }
4124    if let Some(ref user_agent) = configuration.user_agent {
4125        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4126    }
4127    if let Some(ref token) = configuration.bearer_access_token {
4128        req_builder = req_builder.bearer_auth(token.to_owned());
4129    };
4130
4131    let req = req_builder.build()?;
4132    let resp = configuration.client.execute(req).await?;
4133
4134    let status = resp.status();
4135    let content_type = resp
4136        .headers()
4137        .get("content-type")
4138        .and_then(|v| v.to_str().ok())
4139        .unwrap_or("application/octet-stream");
4140    let content_type = super::ContentType::from(content_type);
4141
4142    if !status.is_client_error() && !status.is_server_error() {
4143        let content = resp.text().await?;
4144        match content_type {
4145            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4146            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListSessionsOut`"))),
4147            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListSessionsOut`")))),
4148        }
4149    } else {
4150        let content = resp.text().await?;
4151        let entity: Option<ListSessionsError> = serde_json::from_str(&content).ok();
4152        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4153    }
4154}
4155
4156/// Returns the access tokens issued in your organization, newest first, and can be narrowed to one organization. Use it to see what is currently authorized before revoking anything.
4157pub async fn list_tokens(configuration: &configuration::Configuration, owner: Option<&str>, organization: Option<&str>) -> Result<models::IamPeriodListTokensOut, Error<ListTokensError>> {
4158    // add a prefix to parameters to efficiently prevent name collisions
4159    let p_owner = owner;
4160    let p_organization = organization;
4161
4162    let uri_str = format!("{}/v1/iam/tokens", configuration.base_path);
4163    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4164
4165    if let Some(ref param_value) = p_owner {
4166        req_builder = req_builder.query(&[("owner", &param_value.to_string())]);
4167    }
4168    if let Some(ref param_value) = p_organization {
4169        req_builder = req_builder.query(&[("organization", &param_value.to_string())]);
4170    }
4171    if let Some(ref user_agent) = configuration.user_agent {
4172        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4173    }
4174    if let Some(ref token) = configuration.bearer_access_token {
4175        req_builder = req_builder.bearer_auth(token.to_owned());
4176    };
4177
4178    let req = req_builder.build()?;
4179    let resp = configuration.client.execute(req).await?;
4180
4181    let status = resp.status();
4182    let content_type = resp
4183        .headers()
4184        .get("content-type")
4185        .and_then(|v| v.to_str().ok())
4186        .unwrap_or("application/octet-stream");
4187    let content_type = super::ContentType::from(content_type);
4188
4189    if !status.is_client_error() && !status.is_server_error() {
4190        let content = resp.text().await?;
4191        match content_type {
4192            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4193            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListTokensOut`"))),
4194            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListTokensOut`")))),
4195        }
4196    } else {
4197        let content = resp.text().await?;
4198        let entity: Option<ListTokensError> = serde_json::from_str(&content).ok();
4199        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4200    }
4201}
4202
4203/// Returns the passkeys and security keys registered to one person, newest first — which device each lives on and when it was registered.  Yours by default. Name somebody else and you get them only if you already administer their account, which is the same authority that governs reading their user record — so this list can never show more people than the surface beside it already does.  There is no organization-wide list, by design. Scoping to the ORG would hand an org admin every member's credential rows in one answer and a SuperAdmin every tenant's, while a plain member could not read even their own (an unnamed target fails the Guard's tenant rule). One scope answers both halves cleanly: the answer is a person's, and the caller is that person unless they say otherwise and may.
4204pub async fn list_webauthn_credentials(configuration: &configuration::Configuration, user: Option<&str>) -> Result<models::IamPeriodListWebauthnCredentialsOut, Error<ListWebauthnCredentialsError>> {
4205    // add a prefix to parameters to efficiently prevent name collisions
4206    let p_user = user;
4207
4208    let uri_str = format!("{}/v1/iam/webauthn-credentials", configuration.base_path);
4209    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4210
4211    if let Some(ref param_value) = p_user {
4212        req_builder = req_builder.query(&[("user", &param_value.to_string())]);
4213    }
4214    if let Some(ref user_agent) = configuration.user_agent {
4215        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4216    }
4217    if let Some(ref token) = configuration.bearer_access_token {
4218        req_builder = req_builder.bearer_auth(token.to_owned());
4219    };
4220
4221    let req = req_builder.build()?;
4222    let resp = configuration.client.execute(req).await?;
4223
4224    let status = resp.status();
4225    let content_type = resp
4226        .headers()
4227        .get("content-type")
4228        .and_then(|v| v.to_str().ok())
4229        .unwrap_or("application/octet-stream");
4230    let content_type = super::ContentType::from(content_type);
4231
4232    if !status.is_client_error() && !status.is_server_error() {
4233        let content = resp.text().await?;
4234        match content_type {
4235            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4236            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodListWebauthnCredentialsOut`"))),
4237            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodListWebauthnCredentialsOut`")))),
4238        }
4239    } else {
4240        let content = resp.text().await?;
4241        let entity: Option<ListWebauthnCredentialsError> = serde_json::from_str(&content).ok();
4242        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4243    }
4244}
4245
4246/// Applies a partial change from your identity provider — one attribute moved, not the whole record resent.  The change is applied onto the person as they currently are, so everything you did not mention keeps its value, including the parts SCIM does not describe.
4247pub async fn patch_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<PatchIamScimV2UsersByOwnerByNameError>> {
4248    // add a prefix to parameters to efficiently prevent name collisions
4249    let p_owner = owner;
4250    let p_name = name;
4251
4252    let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
4253    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4254
4255    if let Some(ref user_agent) = configuration.user_agent {
4256        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4257    }
4258    if let Some(ref token) = configuration.bearer_access_token {
4259        req_builder = req_builder.bearer_auth(token.to_owned());
4260    };
4261
4262    let req = req_builder.build()?;
4263    let resp = configuration.client.execute(req).await?;
4264
4265    let status = resp.status();
4266
4267    if !status.is_client_error() && !status.is_server_error() {
4268        Ok(())
4269    } else {
4270        let content = resp.text().await?;
4271        let entity: Option<PatchIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
4272        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4273    }
4274}
4275
4276/// Sets up an account on someone's behalf — the same onboarding a person gets themselves, driven by one of your own services instead of by them.  It authenticates as your service rather than as a person, which is why the person to provision is named in the request. The setup it performs is identical to self-service onboarding; there is one provisioning path, not two that can drift.
4277pub async fn post_iam_admin_provision(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamAdminProvisionError>> {
4278
4279    let uri_str = format!("{}/v1/iam/admin/provision", configuration.base_path);
4280    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4281
4282    if let Some(ref user_agent) = configuration.user_agent {
4283        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4284    }
4285    if let Some(ref token) = configuration.bearer_access_token {
4286        req_builder = req_builder.bearer_auth(token.to_owned());
4287    };
4288
4289    let req = req_builder.build()?;
4290    let resp = configuration.client.execute(req).await?;
4291
4292    let status = resp.status();
4293
4294    if !status.is_client_error() && !status.is_server_error() {
4295        Ok(())
4296    } else {
4297        let content = resp.text().await?;
4298        let entity: Option<PostIamAdminProvisionError> = serde_json::from_str(&content).ok();
4299        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4300    }
4301}
4302
4303/// Registers an application in your organization — one product or site your people sign in to, with its own client credentials, sign-in methods and allowed redirect URIs. A name already used in the organization is refused rather than overwritten.  Exported so the legacy add-application alias reuses this exact path — one create, two spellings.
4304pub async fn post_iam_applications(configuration: &configuration::Configuration, iam_period_application: models::IamPeriodApplication) -> Result<models::IamPeriodApplication, Error<PostIamApplicationsError>> {
4305    // add a prefix to parameters to efficiently prevent name collisions
4306    let p_iam_period_application = iam_period_application;
4307
4308    let uri_str = format!("{}/v1/iam/applications", configuration.base_path);
4309    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4310
4311    if let Some(ref user_agent) = configuration.user_agent {
4312        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4313    }
4314    if let Some(ref token) = configuration.bearer_access_token {
4315        req_builder = req_builder.bearer_auth(token.to_owned());
4316    };
4317    req_builder = req_builder.json(&p_iam_period_application);
4318
4319    let req = req_builder.build()?;
4320    let resp = configuration.client.execute(req).await?;
4321
4322    let status = resp.status();
4323    let content_type = resp
4324        .headers()
4325        .get("content-type")
4326        .and_then(|v| v.to_str().ok())
4327        .unwrap_or("application/octet-stream");
4328    let content_type = super::ContentType::from(content_type);
4329
4330    if !status.is_client_error() && !status.is_server_error() {
4331        let content = resp.text().await?;
4332        match content_type {
4333            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4334            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplication`"))),
4335            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplication`")))),
4336        }
4337    } else {
4338        let content = resp.text().await?;
4339        let entity: Option<PostIamApplicationsError> = serde_json::from_str(&content).ok();
4340        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4341    }
4342}
4343
4344/// Steps a platform operator into an organization: it returns their own access token re-scoped to that tenant, so they see what the tenant sees.  The token still names the operator — stepping in is not becoming somebody else — and records the organization it was scoped to, so everything done with it is attributed to the person who did it. Only a platform operator may, and the attempt is recorded whether or not it succeeds.
4345pub async fn post_iam_assume(configuration: &configuration::Configuration, iam_period_assume_body: models::IamPeriodAssumeBody, authorization: Option<&str>, x_forwarded_for: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PostIamAssumeError>> {
4346    // add a prefix to parameters to efficiently prevent name collisions
4347    let p_iam_period_assume_body = iam_period_assume_body;
4348    let p_authorization = authorization;
4349    let p_x_forwarded_for = x_forwarded_for;
4350
4351    let uri_str = format!("{}/v1/iam/assume", configuration.base_path);
4352    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4353
4354    if let Some(ref user_agent) = configuration.user_agent {
4355        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4356    }
4357    if let Some(param_value) = p_authorization {
4358        req_builder = req_builder.header("Authorization", param_value.to_string());
4359    }
4360    if let Some(param_value) = p_x_forwarded_for {
4361        req_builder = req_builder.header("X-Forwarded-For", param_value.to_string());
4362    }
4363    if let Some(ref token) = configuration.bearer_access_token {
4364        req_builder = req_builder.bearer_auth(token.to_owned());
4365    };
4366    req_builder = req_builder.json(&p_iam_period_assume_body);
4367
4368    let req = req_builder.build()?;
4369    let resp = configuration.client.execute(req).await?;
4370
4371    let status = resp.status();
4372    let content_type = resp
4373        .headers()
4374        .get("content-type")
4375        .and_then(|v| v.to_str().ok())
4376        .unwrap_or("application/octet-stream");
4377    let content_type = super::ContentType::from(content_type);
4378
4379    if !status.is_client_error() && !status.is_server_error() {
4380        let content = resp.text().await?;
4381        match content_type {
4382            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4383            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
4384            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
4385        }
4386    } else {
4387        let content = resp.text().await?;
4388        let entity: Option<PostIamAssumeError> = serde_json::from_str(&content).ok();
4389        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4390    }
4391}
4392
4393/// Records an audit entry, so activity from your own systems lands in the same trail as everything the Hanzo Cloud records for you.
4394pub async fn post_iam_audit_logs(configuration: &configuration::Configuration, iam_period_input: models::IamPeriodInput) -> Result<models::IamPeriodAuditLog, Error<PostIamAuditLogsError>> {
4395    // add a prefix to parameters to efficiently prevent name collisions
4396    let p_iam_period_input = iam_period_input;
4397
4398    let uri_str = format!("{}/v1/iam/audit-logs", configuration.base_path);
4399    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4400
4401    if let Some(ref user_agent) = configuration.user_agent {
4402        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4403    }
4404    if let Some(ref token) = configuration.bearer_access_token {
4405        req_builder = req_builder.bearer_auth(token.to_owned());
4406    };
4407    req_builder = req_builder.json(&p_iam_period_input);
4408
4409    let req = req_builder.build()?;
4410    let resp = configuration.client.execute(req).await?;
4411
4412    let status = resp.status();
4413    let content_type = resp
4414        .headers()
4415        .get("content-type")
4416        .and_then(|v| v.to_str().ok())
4417        .unwrap_or("application/octet-stream");
4418    let content_type = super::ContentType::from(content_type);
4419
4420    if !status.is_client_error() && !status.is_server_error() {
4421        let content = resp.text().await?;
4422        match content_type {
4423            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4424            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAuditLog`"))),
4425            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAuditLog`")))),
4426        }
4427    } else {
4428        let content = resp.text().await?;
4429        let entity: Option<PostIamAuditLogsError> = serde_json::from_str(&content).ok();
4430        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4431    }
4432}
4433
4434/// Adds a signing certificate your applications can verify tokens against — the call you make to stage the next one before a rotation. A name already used in your organization is refused.  It registers the certificate's IDENTITY: its name (which is the JWKS `kid`), its algorithm, its expiry. Key material does not travel this way and cannot: the private key is not part of the Cert's JSON, so it is neither served here nor accepted here. It is supplied to the process by the deployment, under the name registered here (internal/keyring). Staging a rotation is therefore two halves — this call names the key, and the deployment provides it.
4435pub async fn post_iam_certs(configuration: &configuration::Configuration, iam_period_cert: models::IamPeriodCert) -> Result<models::IamPeriodCert, Error<PostIamCertsError>> {
4436    // add a prefix to parameters to efficiently prevent name collisions
4437    let p_iam_period_cert = iam_period_cert;
4438
4439    let uri_str = format!("{}/v1/iam/certs", configuration.base_path);
4440    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4441
4442    if let Some(ref user_agent) = configuration.user_agent {
4443        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4444    }
4445    if let Some(ref token) = configuration.bearer_access_token {
4446        req_builder = req_builder.bearer_auth(token.to_owned());
4447    };
4448    req_builder = req_builder.json(&p_iam_period_cert);
4449
4450    let req = req_builder.build()?;
4451    let resp = configuration.client.execute(req).await?;
4452
4453    let status = resp.status();
4454    let content_type = resp
4455        .headers()
4456        .get("content-type")
4457        .and_then(|v| v.to_str().ok())
4458        .unwrap_or("application/octet-stream");
4459    let content_type = super::ContentType::from(content_type);
4460
4461    if !status.is_client_error() && !status.is_server_error() {
4462        let content = resp.text().await?;
4463        match content_type {
4464            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4465            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCert`"))),
4466            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCert`")))),
4467        }
4468    } else {
4469        let content = resp.text().await?;
4470        let entity: Option<PostIamCertsError> = serde_json::from_str(&content).ok();
4471        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4472    }
4473}
4474
4475/// Takes away a person's or an application's right to act in an organization. Their account survives; what ends is their access to that organization. Revoking a membership that is already gone reports that nothing was removed rather than failing, so a retry is safe. It is the mirror of ensure and takes the SAME gate: revoking membership is the org's authority to give or take, so a SuperAdmin, an admin of the org itself, or an org-admin-capable confidential client. Idempotent through the store — deleting an absent membership reports removed=false, never an error — so a retried revoke is safe.
4476pub async fn post_iam_delete_membership(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamDeleteMembershipError>> {
4477
4478    let uri_str = format!("{}/v1/iam/delete-membership", configuration.base_path);
4479    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4480
4481    if let Some(ref user_agent) = configuration.user_agent {
4482        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4483    }
4484    if let Some(ref token) = configuration.bearer_access_token {
4485        req_builder = req_builder.bearer_auth(token.to_owned());
4486    };
4487
4488    let req = req_builder.build()?;
4489    let resp = configuration.client.execute(req).await?;
4490
4491    let status = resp.status();
4492
4493    if !status.is_client_error() && !status.is_server_error() {
4494        Ok(())
4495    } else {
4496        let content = resp.text().await?;
4497        let entity: Option<PostIamDeleteMembershipError> = serde_json::from_str(&content).ok();
4498        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4499    }
4500}
4501
4502/// Issues an invitation to join your organization — the code or link a new member redeems, with the role they arrive holding and the date it stops working. A name already used in the organization is refused.
4503pub async fn post_iam_invitations(configuration: &configuration::Configuration, iam_period_invitations_period_input: models::IamPeriodInvitationsPeriodInput) -> Result<models::IamPeriodInvitation, Error<PostIamInvitationsError>> {
4504    // add a prefix to parameters to efficiently prevent name collisions
4505    let p_iam_period_invitations_period_input = iam_period_invitations_period_input;
4506
4507    let uri_str = format!("{}/v1/iam/invitations", configuration.base_path);
4508    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4509
4510    if let Some(ref user_agent) = configuration.user_agent {
4511        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4512    }
4513    if let Some(ref token) = configuration.bearer_access_token {
4514        req_builder = req_builder.bearer_auth(token.to_owned());
4515    };
4516    req_builder = req_builder.json(&p_iam_period_invitations_period_input);
4517
4518    let req = req_builder.build()?;
4519    let resp = configuration.client.execute(req).await?;
4520
4521    let status = resp.status();
4522    let content_type = resp
4523        .headers()
4524        .get("content-type")
4525        .and_then(|v| v.to_str().ok())
4526        .unwrap_or("application/octet-stream");
4527    let content_type = super::ContentType::from(content_type);
4528
4529    if !status.is_client_error() && !status.is_server_error() {
4530        let content = resp.text().await?;
4531        match content_type {
4532            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4533            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitation`"))),
4534            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitation`")))),
4535        }
4536    } else {
4537        let content = resp.text().await?;
4538        let entity: Option<PostIamInvitationsError> = serde_json::from_str(&content).ok();
4539        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4540    }
4541}
4542
4543/// Issues an API key. A standard key comes back as a publishable half you may ship in client code and a secret half you must not — the secret is shown once, at creation, and cannot be retrieved afterwards. A publish-scoped key is issued with the publishable half only, so there is no secret to leak.  A name already used in your organization is refused rather than reissued, so creating twice never silently invalidates a key that is in production.
4544pub async fn post_iam_keys(configuration: &configuration::Configuration, iam_period_key: models::IamPeriodKey) -> Result<models::IamPeriodKey, Error<PostIamKeysError>> {
4545    // add a prefix to parameters to efficiently prevent name collisions
4546    let p_iam_period_key = iam_period_key;
4547
4548    let uri_str = format!("{}/v1/iam/keys", configuration.base_path);
4549    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4550
4551    if let Some(ref user_agent) = configuration.user_agent {
4552        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4553    }
4554    if let Some(ref token) = configuration.bearer_access_token {
4555        req_builder = req_builder.bearer_auth(token.to_owned());
4556    };
4557    req_builder = req_builder.json(&p_iam_period_key);
4558
4559    let req = req_builder.build()?;
4560    let resp = configuration.client.execute(req).await?;
4561
4562    let status = resp.status();
4563    let content_type = resp
4564        .headers()
4565        .get("content-type")
4566        .and_then(|v| v.to_str().ok())
4567        .unwrap_or("application/octet-stream");
4568    let content_type = super::ContentType::from(content_type);
4569
4570    if !status.is_client_error() && !status.is_server_error() {
4571        let content = resp.text().await?;
4572        match content_type {
4573            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4574            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodKey`"))),
4575            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodKey`")))),
4576        }
4577    } else {
4578        let content = resp.text().await?;
4579        let entity: Option<PostIamKeysError> = serde_json::from_str(&content).ok();
4580        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4581    }
4582}
4583
4584/// Starts connecting another sign-in identity to the account you are already signed in as. It answers with the provider's URL for the browser to follow; when the provider returns, that identity is attached and you come back to returnUri.  Your account is fixed here, from the credential you are already holding, and is carried server-side for the rest of the round-trip — so nothing that happens at the provider can point the link at somebody else.
4585pub async fn post_iam_link(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamLinkError>> {
4586
4587    let uri_str = format!("{}/v1/iam/link", configuration.base_path);
4588    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4589
4590    if let Some(ref user_agent) = configuration.user_agent {
4591        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4592    }
4593    if let Some(ref token) = configuration.bearer_access_token {
4594        req_builder = req_builder.bearer_auth(token.to_owned());
4595    };
4596
4597    let req = req_builder.build()?;
4598    let resp = configuration.client.execute(req).await?;
4599
4600    let status = resp.status();
4601
4602    if !status.is_client_error() && !status.is_server_error() {
4603        Ok(())
4604    } else {
4605        let content = resp.text().await?;
4606        let entity: Option<PostIamLinkError> = serde_json::from_str(&content).ok();
4607        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4608    }
4609}
4610
4611/// Signs a person in with the credential they typed, and — when the request is part of an OAuth flow — hands back the one-time code that finishes it. A second factor, if the account has one, is asked for and required here.  The password is compared against a stored one-way hash and is never logged, echoed or stored as typed.
4612pub async fn post_iam_login(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamLoginError>> {
4613
4614    let uri_str = format!("{}/v1/iam/login", configuration.base_path);
4615    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4616
4617    if let Some(ref user_agent) = configuration.user_agent {
4618        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4619    }
4620    if let Some(ref token) = configuration.bearer_access_token {
4621        req_builder = req_builder.bearer_auth(token.to_owned());
4622    };
4623
4624    let req = req_builder.build()?;
4625    let resp = configuration.client.execute(req).await?;
4626
4627    let status = resp.status();
4628
4629    if !status.is_client_error() && !status.is_server_error() {
4630        Ok(())
4631    } else {
4632        let content = resp.text().await?;
4633        let entity: Option<PostIamLoginError> = serde_json::from_str(&content).ok();
4634        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4635    }
4636}
4637
4638/// Lets a person or an application act in an organization. It is the grant behind \"add someone to the team\", and it is safe to repeat — granting a membership that already exists changes nothing. Granting membership IS the org's authority to give, so it takes the same gate a write to that org's own registry row takes: a SuperAdmin, an admin of the org itself, or an org-admin-capable confidential client. One rule, one place (internal/authz).
4639pub async fn post_iam_memberships(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMembershipsError>> {
4640
4641    let uri_str = format!("{}/v1/iam/memberships", configuration.base_path);
4642    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4643
4644    if let Some(ref user_agent) = configuration.user_agent {
4645        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4646    }
4647    if let Some(ref token) = configuration.bearer_access_token {
4648        req_builder = req_builder.bearer_auth(token.to_owned());
4649    };
4650
4651    let req = req_builder.build()?;
4652    let resp = configuration.client.execute(req).await?;
4653
4654    let status = resp.status();
4655
4656    if !status.is_client_error() && !status.is_server_error() {
4657        Ok(())
4658    } else {
4659        let content = resp.text().await?;
4660        let entity: Option<PostIamMembershipsError> = serde_json::from_str(&content).ok();
4661        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4662    }
4663}
4664
4665/// Picks which second factor an account is asked for first when it has more than one. Only a factor the account actually holds: storing an unheld one told the login gate \"MFA is on\" — factor.Enabled reads that column — while leaving it nothing to ask for, so the sign-in required the password alone.
4666pub async fn post_iam_mfa_preferred(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMfaPreferredError>> {
4667
4668    let uri_str = format!("{}/v1/iam/mfa/preferred", configuration.base_path);
4669    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4670
4671    if let Some(ref user_agent) = configuration.user_agent {
4672        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4673    }
4674    if let Some(ref token) = configuration.bearer_access_token {
4675        req_builder = req_builder.bearer_auth(token.to_owned());
4676    };
4677
4678    let req = req_builder.build()?;
4679    let resp = configuration.client.execute(req).await?;
4680
4681    let status = resp.status();
4682
4683    if !status.is_client_error() && !status.is_server_error() {
4684        Ok(())
4685    } else {
4686        let content = resp.text().await?;
4687        let entity: Option<PostIamMfaPreferredError> = serde_json::from_str(&content).ok();
4688        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4689    }
4690}
4691
4692/// Finishes the enrolment: from here the account's sign-ins ask for this factor. It requires the proof initiate handed out — a passcode from the authenticator, or the code that was sent — and verifies it BEFORE writing anything.  Verifying BEFORE writing is what keeps a client that never completed the proof — a skipped verify step, a QR scanned into the wrong app, a bug — from switching on a factor no code can satisfy. That would lock the account out with no self-service way back: the gate holds the sign-in before minting, so the person could not obtain the bearer that disable requires.  The recovery codes are minted here and returned ONCE, on the first factor the account adds. Answering with them is the way back in when no factor can be produced, so they are the same value the row's digests were made from — by construction, not by a client echoing them back.
4693pub async fn post_iam_mfa_setup_enable(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMfaSetupEnableError>> {
4694
4695    let uri_str = format!("{}/v1/iam/mfa/setup/enable", configuration.base_path);
4696    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4697
4698    if let Some(ref user_agent) = configuration.user_agent {
4699        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4700    }
4701    if let Some(ref token) = configuration.bearer_access_token {
4702        req_builder = req_builder.bearer_auth(token.to_owned());
4703    };
4704
4705    let req = req_builder.build()?;
4706    let resp = configuration.client.execute(req).await?;
4707
4708    let status = resp.status();
4709
4710    if !status.is_client_error() && !status.is_server_error() {
4711        Ok(())
4712    } else {
4713        let content = resp.text().await?;
4714        let entity: Option<PostIamMfaSetupEnableError> = serde_json::from_str(&content).ok();
4715        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4716    }
4717}
4718
4719/// Starts enrolling a factor and hands over whatever the person needs to prove they hold it:   app   a fresh secret and the otpauth:// URL to render as a QR code  sms   a code texted to the number on the account  email a code mailed to the address on the account  Nothing is switched on yet, so abandoning this step leaves the account exactly as it was. Response: {status:\"ok\", data:{mfaType, secret, url}} — secret and url only for the authenticator.
4720pub async fn post_iam_mfa_setup_initiate(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamMfaSetupInitiateError>> {
4721
4722    let uri_str = format!("{}/v1/iam/mfa/setup/initiate", configuration.base_path);
4723    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4724
4725    if let Some(ref user_agent) = configuration.user_agent {
4726        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4727    }
4728    if let Some(ref token) = configuration.bearer_access_token {
4729        req_builder = req_builder.bearer_auth(token.to_owned());
4730    };
4731
4732    let req = req_builder.build()?;
4733    let resp = configuration.client.execute(req).await?;
4734
4735    let status = resp.status();
4736
4737    if !status.is_client_error() && !status.is_server_error() {
4738        Ok(())
4739    } else {
4740        let content = resp.text().await?;
4741        let entity: Option<PostIamMfaSetupInitiateError> = serde_json::from_str(&content).ok();
4742        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4743    }
4744}
4745
4746/// Starts a sign-in — the address you send a browser to, and the beginning of every OAuth and OpenID Connect flow.  If the person is ALREADY signed in here, it does not ask them again: it returns them to the application with a one-time code and they never see this page. Otherwise it shows the right way to sign in for the application they are signing in to, or hands off to another identity provider if that is what they pick.  A client can say what it wants with `prompt`: `none` means answer without any screen at all — with the code if a session exists, with an error if not, but never with a page; `login` means ask for the password again even if a session exists; `select_account` means let the person choose which identity to use.  It returns only to an address the application has registered. That check happens before anything else, so a request naming an unregistered address is refused where the person can see it rather than being bounced onwards.
4747pub async fn post_iam_oauth_authorize(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthAuthorizeError>> {
4748
4749    let uri_str = format!("{}/v1/iam/oauth/authorize", configuration.base_path);
4750    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4751
4752    if let Some(ref user_agent) = configuration.user_agent {
4753        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4754    }
4755    if let Some(ref token) = configuration.bearer_access_token {
4756        req_builder = req_builder.bearer_auth(token.to_owned());
4757    };
4758
4759    let req = req_builder.build()?;
4760    let resp = configuration.client.execute(req).await?;
4761
4762    let status = resp.status();
4763
4764    if !status.is_client_error() && !status.is_server_error() {
4765        Ok(())
4766    } else {
4767        let content = resp.text().await?;
4768        let entity: Option<PostIamOauthAuthorizeError> = serde_json::from_str(&content).ok();
4769        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4770    }
4771}
4772
4773/// Starts a sign-in on a device with no browser and no keyboard — a TV, a CLI, a headless box. It returns a short code to show the person and the address to send them to on a phone or laptop.  Nothing is granted until a human approves it there; until then the code is just a pending request.
4774pub async fn post_iam_oauth_device(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthDeviceError>> {
4775
4776    let uri_str = format!("{}/v1/iam/oauth/device", configuration.base_path);
4777    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4778
4779    if let Some(ref user_agent) = configuration.user_agent {
4780        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4781    }
4782    if let Some(ref token) = configuration.bearer_access_token {
4783        req_builder = req_builder.bearer_auth(token.to_owned());
4784    };
4785
4786    let req = req_builder.build()?;
4787    let resp = configuration.client.execute(req).await?;
4788
4789    let status = resp.status();
4790
4791    if !status.is_client_error() && !status.is_server_error() {
4792        Ok(())
4793    } else {
4794        let content = resp.text().await?;
4795        let entity: Option<PostIamOauthDeviceError> = serde_json::from_str(&content).ok();
4796        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4797    }
4798}
4799
4800/// Answers \"what am I approving?\" for a pending device code.  The approval page exists to tell a human WHICH application they are authorizing; a page that names any other one defeats the control it implements. The client is a property of the CODE, not of the page or of whatever app the browser happens to be signed in to, so it is read from the code's row here and nowhere else.  Requires a signed-in session, and answers with the same ONE opaque refusal approveDevice uses. That is deliberate: the user_code is only 40 bits and is the one secret in this flow, so an unauthenticated lookup — or one that distinguished unknown from expired from already-approved — would be an oracle for hunting live codes. Gated and opaque, it reveals strictly less than the approval the same caller could already attempt.
4801pub async fn post_iam_oauth_device_info(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthDeviceInfoError>> {
4802
4803    let uri_str = format!("{}/v1/iam/oauth/device/info", configuration.base_path);
4804    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4805
4806    if let Some(ref user_agent) = configuration.user_agent {
4807        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4808    }
4809    if let Some(ref token) = configuration.bearer_access_token {
4810        req_builder = req_builder.bearer_auth(token.to_owned());
4811    };
4812
4813    let req = req_builder.build()?;
4814    let resp = configuration.client.execute(req).await?;
4815
4816    let status = resp.status();
4817
4818    if !status.is_client_error() && !status.is_server_error() {
4819        Ok(())
4820    } else {
4821        let content = resp.text().await?;
4822        let entity: Option<PostIamOauthDeviceInfoError> = serde_json::from_str(&content).ok();
4823        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4824    }
4825}
4826
4827/// Completes a sign-in that came in through another identity provider and still owes a second factor. The person supplies the factor here and the login finishes.  The account is fixed when the challenge is issued, not by the request, so no one can redirect a half-finished login onto somebody else's account. A wrong factor uses the challenge up: retrying means starting the sign-in again, the same as a mistyped password.
4828pub async fn post_iam_oauth_federation_mfa(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthFederationMfaError>> {
4829
4830    let uri_str = format!("{}/v1/iam/oauth/federation/mfa", configuration.base_path);
4831    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4832
4833    if let Some(ref user_agent) = configuration.user_agent {
4834        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4835    }
4836    if let Some(ref token) = configuration.bearer_access_token {
4837        req_builder = req_builder.bearer_auth(token.to_owned());
4838    };
4839
4840    let req = req_builder.build()?;
4841    let resp = configuration.client.execute(req).await?;
4842
4843    let status = resp.status();
4844
4845    if !status.is_client_error() && !status.is_server_error() {
4846        Ok(())
4847    } else {
4848        let content = resp.text().await?;
4849        let entity: Option<PostIamOauthFederationMfaError> = serde_json::from_str(&content).ok();
4850        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4851    }
4852}
4853
4854/// Answers whether an access token is still good, and what it is good for — the check a resource server of yours makes before honouring a token it did not mint.  A token counts as active only if it verifies AND has not been revoked, so a revoked token reads as dead here immediately rather than until it expires. A token that is unknown, expired or revoked answers simply that it is not active, and nothing more — the endpoint is not a way to learn about tokens you were not given.
4855pub async fn post_iam_oauth_introspect(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthIntrospectError>> {
4856
4857    let uri_str = format!("{}/v1/iam/oauth/introspect", configuration.base_path);
4858    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4859
4860    if let Some(ref user_agent) = configuration.user_agent {
4861        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4862    }
4863    if let Some(ref token) = configuration.bearer_access_token {
4864        req_builder = req_builder.bearer_auth(token.to_owned());
4865    };
4866
4867    let req = req_builder.build()?;
4868    let resp = configuration.client.execute(req).await?;
4869
4870    let status = resp.status();
4871
4872    if !status.is_client_error() && !status.is_server_error() {
4873        Ok(())
4874    } else {
4875        let content = resp.text().await?;
4876        let entity: Option<PostIamOauthIntrospectError> = serde_json::from_str(&content).ok();
4877        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4878    }
4879}
4880
4881/// Ends a sign-in and sends the browser somewhere sensible. Accepts GET or POST, so it works as a plain link.  It ACTUALLY signs you out — worth stating, because a logout that computes a redirect and answers {\"status\":\"ok\"} while ending no session and revoking no token is worse than none: the person on the shared machine believes it worked. Three things happen here, in this order:   1. The browser session dies — sid revoked server-side AND the cookie expired     (sessions.Clear). Server-side revocation is the load-bearing half: a copy     of the cookie taken before logout must not still resolve.  2. The relying party's tokens are revoked when an id_token_hint names it, so     the refresh token cannot mint a fresh access token after the human left.     Revocation state is authoritative — a JWT's `exp` still reads valid for     days, so expiry is necessary but never sufficient.  3. Only then is a redirect considered, and only to a REGISTERED uri.  The open-redirect guard is unchanged: a redirect happens only when a VERIFIED id_token_hint identifies the application and that application has registered the target. Anything else refuses to redirect — nobody can turn your logout link into a redirect to a site of their choosing.
4882pub async fn post_iam_oauth_logout(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthLogoutError>> {
4883
4884    let uri_str = format!("{}/v1/iam/oauth/logout", configuration.base_path);
4885    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4886
4887    if let Some(ref user_agent) = configuration.user_agent {
4888        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4889    }
4890    if let Some(ref token) = configuration.bearer_access_token {
4891        req_builder = req_builder.bearer_auth(token.to_owned());
4892    };
4893
4894    let req = req_builder.build()?;
4895    let resp = configuration.client.execute(req).await?;
4896
4897    let status = resp.status();
4898
4899    if !status.is_client_error() && !status.is_server_error() {
4900        Ok(())
4901    } else {
4902        let content = resp.text().await?;
4903        let entity: Option<PostIamOauthLogoutError> = serde_json::from_str(&content).ok();
4904        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4905    }
4906}
4907
4908/// Retires a token before it expires — what you call when someone signs out or a credential may have leaked.  Revoking an access token kills that token. Revoking a REFRESH token kills the whole chain it belongs to, so no further access tokens can be minted from it and every token already minted from it dies with it.  A token that is not yours, or that never existed, answers success and does nothing — so the endpoint cannot be used to discover which tokens are real.  PUBLIC clients revoke too, and must: sign-out is the only control a long-lived refresh token has. A native app or CLI is a public PKCE client and holds no secret, so requiring one here would leave signing out as a local delete — forgetting a credential that stays spendable for the rest of its lifetime.  Widening authentication does not widen authority. The caller must still POSSESS the token — and possession already permits USE, of which revocation is the strict opposite — and the row must belong to the client that presents it, so a public client_id buys the ability to destroy exactly what its holder could otherwise spend. RFC 6749 §3.2.1 is the same reading: a client with no credentials identifies itself with client_id.
4909pub async fn post_iam_oauth_revoke(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthRevokeError>> {
4910
4911    let uri_str = format!("{}/v1/iam/oauth/revoke", configuration.base_path);
4912    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4913
4914    if let Some(ref user_agent) = configuration.user_agent {
4915        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4916    }
4917    if let Some(ref token) = configuration.bearer_access_token {
4918        req_builder = req_builder.bearer_auth(token.to_owned());
4919    };
4920
4921    let req = req_builder.build()?;
4922    let resp = configuration.client.execute(req).await?;
4923
4924    let status = resp.status();
4925
4926    if !status.is_client_error() && !status.is_server_error() {
4927        Ok(())
4928    } else {
4929        let content = resp.text().await?;
4930        let entity: Option<PostIamOauthRevokeError> = serde_json::from_str(&content).ok();
4931        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4932    }
4933}
4934
4935/// Exchanges what your application is holding for the tokens it needs — the one-time code from a finished sign-in, a refresh token, or your own client credentials when the caller is a program rather than a person.  A refresh returns a NEW refresh token and retires the one you sent. If a retired one is ever presented again the whole chain is revoked, on the assumption that a token which came back from the dead was copied — so a stolen refresh token buys an attacker one use and costs them the session.  Responses are never cached, by any hop.
4936pub async fn post_iam_oauth_token(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthTokenError>> {
4937
4938    let uri_str = format!("{}/v1/iam/oauth/token", configuration.base_path);
4939    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4940
4941    if let Some(ref user_agent) = configuration.user_agent {
4942        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4943    }
4944    if let Some(ref token) = configuration.bearer_access_token {
4945        req_builder = req_builder.bearer_auth(token.to_owned());
4946    };
4947
4948    let req = req_builder.build()?;
4949    let resp = configuration.client.execute(req).await?;
4950
4951    let status = resp.status();
4952
4953    if !status.is_client_error() && !status.is_server_error() {
4954        Ok(())
4955    } else {
4956        let content = resp.text().await?;
4957        let entity: Option<PostIamOauthTokenError> = serde_json::from_str(&content).ok();
4958        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4959    }
4960}
4961
4962/// Returns the profile claims for whoever the access token belongs to — the standard OpenID Connect way to find out who is calling you without your application storing anything itself.  The token must still be live: revoke it and this stops answering.
4963pub async fn post_iam_oauth_userinfo(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOauthUserinfoError>> {
4964
4965    let uri_str = format!("{}/v1/iam/oauth/userinfo", configuration.base_path);
4966    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4967
4968    if let Some(ref user_agent) = configuration.user_agent {
4969        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4970    }
4971    if let Some(ref token) = configuration.bearer_access_token {
4972        req_builder = req_builder.bearer_auth(token.to_owned());
4973    };
4974
4975    let req = req_builder.build()?;
4976    let resp = configuration.client.execute(req).await?;
4977
4978    let status = resp.status();
4979
4980    if !status.is_client_error() && !status.is_server_error() {
4981        Ok(())
4982    } else {
4983        let content = resp.text().await?;
4984        let entity: Option<PostIamOauthUserinfoError> = serde_json::from_str(&content).ok();
4985        Err(Error::ResponseError(ResponseContent { status, content, entity }))
4986    }
4987}
4988
4989/// Finishes setting up the account of whoever is calling — it creates their organization if they have none and puts them in it, so a person who has just signed up lands somewhere they can work.  It always acts on the caller and never on somebody named in the request, so there is no way to onboard another person's account through it.
4990pub async fn post_iam_onboard(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamOnboardError>> {
4991
4992    let uri_str = format!("{}/v1/iam/onboard", configuration.base_path);
4993    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4994
4995    if let Some(ref user_agent) = configuration.user_agent {
4996        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4997    }
4998    if let Some(ref token) = configuration.bearer_access_token {
4999        req_builder = req_builder.bearer_auth(token.to_owned());
5000    };
5001
5002    let req = req_builder.build()?;
5003    let resp = configuration.client.execute(req).await?;
5004
5005    let status = resp.status();
5006
5007    if !status.is_client_error() && !status.is_server_error() {
5008        Ok(())
5009    } else {
5010        let content = resp.text().await?;
5011        let entity: Option<PostIamOnboardError> = serde_json::from_str(&content).ok();
5012        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5013    }
5014}
5015
5016/// Grants a permission — the call that gives a person or a role the ability to do something. Adding refuses to overwrite a grant that already exists, so widening an existing one is an update, never an accident.
5017pub async fn post_iam_permissions(configuration: &configuration::Configuration, iam_period_permission: models::IamPeriodPermission) -> Result<models::IamPeriodPermission, Error<PostIamPermissionsError>> {
5018    // add a prefix to parameters to efficiently prevent name collisions
5019    let p_iam_period_permission = iam_period_permission;
5020
5021    let uri_str = format!("{}/v1/iam/permissions", configuration.base_path);
5022    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5023
5024    if let Some(ref user_agent) = configuration.user_agent {
5025        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5026    }
5027    if let Some(ref token) = configuration.bearer_access_token {
5028        req_builder = req_builder.bearer_auth(token.to_owned());
5029    };
5030    req_builder = req_builder.json(&p_iam_period_permission);
5031
5032    let req = req_builder.build()?;
5033    let resp = configuration.client.execute(req).await?;
5034
5035    let status = resp.status();
5036    let content_type = resp
5037        .headers()
5038        .get("content-type")
5039        .and_then(|v| v.to_str().ok())
5040        .unwrap_or("application/octet-stream");
5041    let content_type = super::ContentType::from(content_type);
5042
5043    if !status.is_client_error() && !status.is_server_error() {
5044        let content = resp.text().await?;
5045        match content_type {
5046            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5047            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermission`"))),
5048            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermission`")))),
5049        }
5050    } else {
5051        let content = resp.text().await?;
5052        let entity: Option<PostIamPermissionsError> = serde_json::from_str(&content).ok();
5053        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5054    }
5055}
5056
5057/// Saves the calling person's own settings and returns the full set afterwards. Send only the settings you are changing — the rest are kept, so two screens can save at once without one undoing the other.
5058pub async fn post_iam_preferences(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamPreferencesError>> {
5059
5060    let uri_str = format!("{}/v1/iam/preferences", configuration.base_path);
5061    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5062
5063    if let Some(ref user_agent) = configuration.user_agent {
5064        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5065    }
5066    if let Some(ref token) = configuration.bearer_access_token {
5067        req_builder = req_builder.bearer_auth(token.to_owned());
5068    };
5069
5070    let req = req_builder.build()?;
5071    let resp = configuration.client.execute(req).await?;
5072
5073    let status = resp.status();
5074
5075    if !status.is_client_error() && !status.is_server_error() {
5076        Ok(())
5077    } else {
5078        let content = resp.text().await?;
5079        let entity: Option<PostIamPreferencesError> = serde_json::from_str(&content).ok();
5080        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5081    }
5082}
5083
5084/// Makes a project inside your organization — the scope people pick between when their work is separated by product or client rather than by team. A name already used in the organization is refused.
5085pub async fn post_iam_projects(configuration: &configuration::Configuration, iam_period_projects_period_input: models::IamPeriodProjectsPeriodInput) -> Result<models::IamPeriodProject, Error<PostIamProjectsError>> {
5086    // add a prefix to parameters to efficiently prevent name collisions
5087    let p_iam_period_projects_period_input = iam_period_projects_period_input;
5088
5089    let uri_str = format!("{}/v1/iam/projects", configuration.base_path);
5090    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5091
5092    if let Some(ref user_agent) = configuration.user_agent {
5093        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5094    }
5095    if let Some(ref token) = configuration.bearer_access_token {
5096        req_builder = req_builder.bearer_auth(token.to_owned());
5097    };
5098    req_builder = req_builder.json(&p_iam_period_projects_period_input);
5099
5100    let req = req_builder.build()?;
5101    let resp = configuration.client.execute(req).await?;
5102
5103    let status = resp.status();
5104    let content_type = resp
5105        .headers()
5106        .get("content-type")
5107        .and_then(|v| v.to_str().ok())
5108        .unwrap_or("application/octet-stream");
5109    let content_type = super::ContentType::from(content_type);
5110
5111    if !status.is_client_error() && !status.is_server_error() {
5112        let content = resp.text().await?;
5113        match content_type {
5114            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5115            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProject`"))),
5116            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProject`")))),
5117        }
5118    } else {
5119        let content = resp.text().await?;
5120        let entity: Option<PostIamProjectsError> = serde_json::from_str(&content).ok();
5121        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5122    }
5123}
5124
5125/// Signs a container client in to your registry. `docker login`, and every build tool that pushes or pulls images, lands here: it exchanges the credential for a short-lived token scoped to exactly the repositories that credential may touch.  Both of the shapes container tooling uses are accepted, so the same login works whichever client your pipeline runs.
5126pub async fn post_iam_registry_token(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamRegistryTokenError>> {
5127
5128    let uri_str = format!("{}/v1/iam/registry/token", configuration.base_path);
5129    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5130
5131    if let Some(ref user_agent) = configuration.user_agent {
5132        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5133    }
5134    if let Some(ref token) = configuration.bearer_access_token {
5135        req_builder = req_builder.bearer_auth(token.to_owned());
5136    };
5137
5138    let req = req_builder.build()?;
5139    let resp = configuration.client.execute(req).await?;
5140
5141    let status = resp.status();
5142
5143    if !status.is_client_error() && !status.is_server_error() {
5144        Ok(())
5145    } else {
5146        let content = resp.text().await?;
5147        let entity: Option<PostIamRegistryTokenError> = serde_json::from_str(&content).ok();
5148        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5149    }
5150}
5151
5152/// Steps a platform operator back out: it returns their own access token with no organization assumed, which is the credential they had before they stepped in. Recorded like the step in.
5153pub async fn post_iam_release(configuration: &configuration::Configuration, iam_period_assume_body: models::IamPeriodAssumeBody, authorization: Option<&str>, x_forwarded_for: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PostIamReleaseError>> {
5154    // add a prefix to parameters to efficiently prevent name collisions
5155    let p_iam_period_assume_body = iam_period_assume_body;
5156    let p_authorization = authorization;
5157    let p_x_forwarded_for = x_forwarded_for;
5158
5159    let uri_str = format!("{}/v1/iam/release", configuration.base_path);
5160    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5161
5162    if let Some(ref user_agent) = configuration.user_agent {
5163        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5164    }
5165    if let Some(param_value) = p_authorization {
5166        req_builder = req_builder.header("Authorization", param_value.to_string());
5167    }
5168    if let Some(param_value) = p_x_forwarded_for {
5169        req_builder = req_builder.header("X-Forwarded-For", param_value.to_string());
5170    }
5171    if let Some(ref token) = configuration.bearer_access_token {
5172        req_builder = req_builder.bearer_auth(token.to_owned());
5173    };
5174    req_builder = req_builder.json(&p_iam_period_assume_body);
5175
5176    let req = req_builder.build()?;
5177    let resp = configuration.client.execute(req).await?;
5178
5179    let status = resp.status();
5180    let content_type = resp
5181        .headers()
5182        .get("content-type")
5183        .and_then(|v| v.to_str().ok())
5184        .unwrap_or("application/octet-stream");
5185    let content_type = super::ContentType::from(content_type);
5186
5187    if !status.is_client_error() && !status.is_server_error() {
5188        let content = resp.text().await?;
5189        match content_type {
5190            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5191            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
5192            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
5193        }
5194    } else {
5195        let content = resp.text().await?;
5196        let entity: Option<PostIamReleaseError> = serde_json::from_str(&content).ok();
5197        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5198    }
5199}
5200
5201/// Makes a role — a named group of people that permissions are granted to. Granting to a role rather than to each person is what keeps access correct as your team changes: add someone to the role and they inherit everything it can do. A name already used in your organization is refused.
5202pub async fn post_iam_roles(configuration: &configuration::Configuration, iam_period_roles_period_input: models::IamPeriodRolesPeriodInput) -> Result<models::IamPeriodRole, Error<PostIamRolesError>> {
5203    // add a prefix to parameters to efficiently prevent name collisions
5204    let p_iam_period_roles_period_input = iam_period_roles_period_input;
5205
5206    let uri_str = format!("{}/v1/iam/roles", configuration.base_path);
5207    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5208
5209    if let Some(ref user_agent) = configuration.user_agent {
5210        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5211    }
5212    if let Some(ref token) = configuration.bearer_access_token {
5213        req_builder = req_builder.bearer_auth(token.to_owned());
5214    };
5215    req_builder = req_builder.json(&p_iam_period_roles_period_input);
5216
5217    let req = req_builder.build()?;
5218    let resp = configuration.client.execute(req).await?;
5219
5220    let status = resp.status();
5221    let content_type = resp
5222        .headers()
5223        .get("content-type")
5224        .and_then(|v| v.to_str().ok())
5225        .unwrap_or("application/octet-stream");
5226    let content_type = super::ContentType::from(content_type);
5227
5228    if !status.is_client_error() && !status.is_server_error() {
5229        let content = resp.text().await?;
5230        match content_type {
5231            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5232            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRole`"))),
5233            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRole`")))),
5234        }
5235    } else {
5236        let content = resp.text().await?;
5237        let entity: Option<PostIamRolesError> = serde_json::from_str(&content).ok();
5238        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5239    }
5240}
5241
5242/// Provisions a person from your identity provider — how a new hire gets an account here automatically when they are added over there.  Takes an administrator. Making someone an administrator takes more than that, so an IdP integration cannot escalate anyone by setting a flag.
5243pub async fn post_iam_scim_v2_users(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamScimV2UsersError>> {
5244
5245    let uri_str = format!("{}/v1/iam/scim/v2/Users", configuration.base_path);
5246    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5247
5248    if let Some(ref user_agent) = configuration.user_agent {
5249        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5250    }
5251    if let Some(ref token) = configuration.bearer_access_token {
5252        req_builder = req_builder.bearer_auth(token.to_owned());
5253    };
5254
5255    let req = req_builder.build()?;
5256    let resp = configuration.client.execute(req).await?;
5257
5258    let status = resp.status();
5259
5260    if !status.is_client_error() && !status.is_server_error() {
5261        Ok(())
5262    } else {
5263        let content = resp.text().await?;
5264        let entity: Option<PostIamScimV2UsersError> = serde_json::from_str(&content).ok();
5265        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5266    }
5267}
5268
5269/// Makes a service account — an identity for a program rather than a person, for a script, a bot or a deployment that has to authenticate on its own.  It comes back with its first key, and the secret half is shown ONCE, here. There is no way to read it again; if you lose it, rotate.
5270pub async fn post_iam_service_accounts(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamServiceAccountsError>> {
5271
5272    let uri_str = format!("{}/v1/iam/service-accounts", configuration.base_path);
5273    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5274
5275    if let Some(ref user_agent) = configuration.user_agent {
5276        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5277    }
5278    if let Some(ref token) = configuration.bearer_access_token {
5279        req_builder = req_builder.bearer_auth(token.to_owned());
5280    };
5281
5282    let req = req_builder.build()?;
5283    let resp = configuration.client.execute(req).await?;
5284
5285    let status = resp.status();
5286
5287    if !status.is_client_error() && !status.is_server_error() {
5288        Ok(())
5289    } else {
5290        let content = resp.text().await?;
5291        let entity: Option<PostIamServiceAccountsError> = serde_json::from_str(&content).ok();
5292        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5293    }
5294}
5295
5296/// Serves POST /v1/iam/service-accounts/:name/keys: mint a fresh key, invalidating the prior one, and return the new raw secret exactly once.
5297pub async fn post_iam_service_accounts_by_name_keys(configuration: &configuration::Configuration, name: &str) -> Result<(), Error<PostIamServiceAccountsByNameKeysError>> {
5298    // add a prefix to parameters to efficiently prevent name collisions
5299    let p_name = name;
5300
5301    let uri_str = format!("{}/v1/iam/service-accounts/{name}/keys", configuration.base_path, name=crate::apis::urlencode(p_name));
5302    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5303
5304    if let Some(ref user_agent) = configuration.user_agent {
5305        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5306    }
5307    if let Some(ref token) = configuration.bearer_access_token {
5308        req_builder = req_builder.bearer_auth(token.to_owned());
5309    };
5310
5311    let req = req_builder.build()?;
5312    let resp = configuration.client.execute(req).await?;
5313
5314    let status = resp.status();
5315
5316    if !status.is_client_error() && !status.is_server_error() {
5317        Ok(())
5318    } else {
5319        let content = resp.text().await?;
5320        let entity: Option<PostIamServiceAccountsByNameKeysError> = serde_json::from_str(&content).ok();
5321        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5322    }
5323}
5324
5325/// Completes a sign-in: it exchanges the one-time code your application was handed at the end of the login flow for a live session, and returns the signed-in account.  The code works once. This is the call that turns a finished login into something your application can act on.
5326pub async fn post_iam_signin(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamSigninError>> {
5327
5328    let uri_str = format!("{}/v1/iam/signin", configuration.base_path);
5329    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5330
5331    if let Some(ref user_agent) = configuration.user_agent {
5332        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5333    }
5334    if let Some(ref token) = configuration.bearer_access_token {
5335        req_builder = req_builder.bearer_auth(token.to_owned());
5336    };
5337
5338    let req = req_builder.build()?;
5339    let resp = configuration.client.execute(req).await?;
5340
5341    let status = resp.status();
5342
5343    if !status.is_client_error() && !status.is_server_error() {
5344        Ok(())
5345    } else {
5346        let content = resp.text().await?;
5347        let entity: Option<PostIamSigninError> = serde_json::from_str(&content).ok();
5348        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5349    }
5350}
5351
5352/// Creates an account from the sign-up form and applies the application's own sign-up rules — whether self-service registration is open at all, and which fields it requires.  The password is hashed before it is stored and is never returned.
5353pub async fn post_iam_signup(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamSignupError>> {
5354
5355    let uri_str = format!("{}/v1/iam/signup", configuration.base_path);
5356    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5357
5358    if let Some(ref user_agent) = configuration.user_agent {
5359        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5360    }
5361    if let Some(ref token) = configuration.bearer_access_token {
5362        req_builder = req_builder.bearer_auth(token.to_owned());
5363    };
5364
5365    let req = req_builder.build()?;
5366    let resp = configuration.client.execute(req).await?;
5367
5368    let status = resp.status();
5369
5370    if !status.is_client_error() && !status.is_server_error() {
5371        Ok(())
5372    } else {
5373        let content = resp.text().await?;
5374        let entity: Option<PostIamSignupError> = serde_json::from_str(&content).ok();
5375        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5376    }
5377}
5378
5379/// Mints an access token for the `?id=<owner>/<name>` target user (optional `?aud=` resource, RFC 8707), issued by the authenticated + allow-listed confidential client. The token's subject + owner are the TARGET USER's, so a resource server scopes on the validated owner claim to the user's tenant — indistinguishable from a token the user obtained directly. Response is the camelCase `{accessToken, expiresIn}` body identity.ts consumes. Equivalent to the RFC 8693 token-exchange grant, minus the subject_token proof (the console has the user's id, not a token) — the reason this compat shim exists.
5380pub async fn post_iam_tokens_issue(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamTokensIssueError>> {
5381
5382    let uri_str = format!("{}/v1/iam/tokens/issue", configuration.base_path);
5383    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5384
5385    if let Some(ref user_agent) = configuration.user_agent {
5386        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5387    }
5388    if let Some(ref token) = configuration.bearer_access_token {
5389        req_builder = req_builder.bearer_auth(token.to_owned());
5390    };
5391
5392    let req = req_builder.build()?;
5393    let resp = configuration.client.execute(req).await?;
5394
5395    let status = resp.status();
5396
5397    if !status.is_client_error() && !status.is_server_error() {
5398        Ok(())
5399    } else {
5400        let content = resp.text().await?;
5401        let entity: Option<PostIamTokensIssueError> = serde_json::from_str(&content).ok();
5402        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5403    }
5404}
5405
5406/// Disconnects one sign-in identity from an account, so that provider can no longer be used to sign in as that person. Their account and every other way they sign in are untouched. Two principals may do it, and only two: the account holder itself, and a SuperAdmin (a member of the reserved admin org, the one predicate). An ORG ADMIN deliberately may NOT — unlinking is not tenant administration, it is unpicking someone's own sign-in method, so the generic org-admin rule is the wrong answer here.  A holder unlinking itself must also be permitted by the application — the provider link's CanUnlink flag — so an organization that mandates federated sign-in cannot have its users strand themselves. A SuperAdmin is not bound by that flag; it is the platform's own recovery path. Fail-closed throughout.
5407pub async fn post_iam_unlink(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamUnlinkError>> {
5408
5409    let uri_str = format!("{}/v1/iam/unlink", configuration.base_path);
5410    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5411
5412    if let Some(ref user_agent) = configuration.user_agent {
5413        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5414    }
5415    if let Some(ref token) = configuration.bearer_access_token {
5416        req_builder = req_builder.bearer_auth(token.to_owned());
5417    };
5418
5419    let req = req_builder.build()?;
5420    let resp = configuration.client.execute(req).await?;
5421
5422    let status = resp.status();
5423
5424    if !status.is_client_error() && !status.is_server_error() {
5425        Ok(())
5426    } else {
5427        let content = resp.text().await?;
5428        let entity: Option<PostIamUnlinkError> = serde_json::from_str(&content).ok();
5429        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5430    }
5431}
5432
5433/// Adds a person to your organization. Send a password and it becomes the one they sign in with; it is hashed before it is stored and never comes back in any response.  The username is checked against the same rule every account in the Hanzo Cloud is held to, whichever way it was created — this call, password signup, a social sign-in, or SCIM — so a name accepted here works everywhere.  A name already taken in your organization is refused rather than overwritten.
5434pub async fn post_iam_users(configuration: &configuration::Configuration, iam_period_create_input: models::IamPeriodCreateInput) -> Result<models::IamPeriodUser, Error<PostIamUsersError>> {
5435    // add a prefix to parameters to efficiently prevent name collisions
5436    let p_iam_period_create_input = iam_period_create_input;
5437
5438    let uri_str = format!("{}/v1/iam/users", configuration.base_path);
5439    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5440
5441    if let Some(ref user_agent) = configuration.user_agent {
5442        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5443    }
5444    if let Some(ref token) = configuration.bearer_access_token {
5445        req_builder = req_builder.bearer_auth(token.to_owned());
5446    };
5447    req_builder = req_builder.json(&p_iam_period_create_input);
5448
5449    let req = req_builder.build()?;
5450    let resp = configuration.client.execute(req).await?;
5451
5452    let status = resp.status();
5453    let content_type = resp
5454        .headers()
5455        .get("content-type")
5456        .and_then(|v| v.to_str().ok())
5457        .unwrap_or("application/octet-stream");
5458    let content_type = super::ContentType::from(content_type);
5459
5460    if !status.is_client_error() && !status.is_server_error() {
5461        let content = resp.text().await?;
5462        match content_type {
5463            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5464            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUser`"))),
5465            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUser`")))),
5466        }
5467    } else {
5468        let content = resp.text().await?;
5469        let entity: Option<PostIamUsersError> = serde_json::from_str(&content).ok();
5470        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5471    }
5472}
5473
5474/// (re)generates the target user's key of the requested TYPE and returns it once, over the shared authorizeMinter + mintTarget seam. `?type=secret` (the default) yields the confidential sk-; `?type=publishable` yields the pk- that is safe to ship in client JS and resolves to an org, never a principal.  It writes the schema.Key row that the resolvers actually read. schema.User.AccessKey is not a credential and nothing resolves it, so a key stamped there would authenticate nobody.
5475pub async fn post_iam_users_by_owner_by_name_keys(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<PostIamUsersByOwnerByNameKeysError>> {
5476    // add a prefix to parameters to efficiently prevent name collisions
5477    let p_owner = owner;
5478    let p_name = name;
5479
5480    let uri_str = format!("{}/v1/iam/users/{owner}/{name}/keys", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
5481    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5482
5483    if let Some(ref user_agent) = configuration.user_agent {
5484        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5485    }
5486    if let Some(ref token) = configuration.bearer_access_token {
5487        req_builder = req_builder.bearer_auth(token.to_owned());
5488    };
5489
5490    let req = req_builder.build()?;
5491    let resp = configuration.client.execute(req).await?;
5492
5493    let status = resp.status();
5494
5495    if !status.is_client_error() && !status.is_server_error() {
5496        Ok(())
5497    } else {
5498        let content = resp.text().await?;
5499        let entity: Option<PostIamUsersByOwnerByNameKeysError> = serde_json::from_str(&content).ok();
5500        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5501    }
5502}
5503
5504/// Validates the request and asks otp to get a code to the person. The request fields are read via fiber's FormValue — the escape hatch zip exposes for form bodies (multipart or urlencoded) — since the typed JSON Bind does not apply here. v1 also accepts countryCode/method/checkUser/captchaType; iam ignores them (the captcha/forget/MFA flows those drive are not ported), and CAPTCHA verification is likewise not enforced — iam models no captcha provider — so the code is issued once the destination and application validate.
5505pub async fn post_iam_verification_codes(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamVerificationCodesError>> {
5506
5507    let uri_str = format!("{}/v1/iam/verification-codes", configuration.base_path);
5508    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5509
5510    if let Some(ref user_agent) = configuration.user_agent {
5511        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5512    }
5513    if let Some(ref token) = configuration.bearer_access_token {
5514        req_builder = req_builder.bearer_auth(token.to_owned());
5515    };
5516
5517    let req = req_builder.build()?;
5518    let resp = configuration.client.execute(req).await?;
5519
5520    let status = resp.status();
5521
5522    if !status.is_client_error() && !status.is_server_error() {
5523        Ok(())
5524    } else {
5525        let content = resp.text().await?;
5526        let entity: Option<PostIamVerificationCodesError> = serde_json::from_str(&content).ok();
5527        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5528    }
5529}
5530
5531/// Completes a wallet sign-in: it verifies the signed challenge and, if it holds, signs the wallet's owner in.  This IS the login — it answers exactly as a password sign-in does, so the rest of your flow does not branch on how somebody arrived.
5532pub async fn post_iam_web3_verify(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamWeb3VerifyError>> {
5533
5534    let uri_str = format!("{}/v1/iam/web3/verify", configuration.base_path);
5535    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5536
5537    if let Some(ref user_agent) = configuration.user_agent {
5538        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5539    }
5540    if let Some(ref token) = configuration.bearer_access_token {
5541        req_builder = req_builder.bearer_auth(token.to_owned());
5542    };
5543
5544    let req = req_builder.build()?;
5545    let resp = configuration.client.execute(req).await?;
5546
5547    let status = resp.status();
5548
5549    if !status.is_client_error() && !status.is_server_error() {
5550        Ok(())
5551    } else {
5552        let content = resp.text().await?;
5553        let entity: Option<PostIamWeb3VerifyError> = serde_json::from_str(&content).ok();
5554        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5555    }
5556}
5557
5558/// Verifies the signed challenge and signs the person in.  It answers exactly as a password sign-in does — the same envelope, through the same grant — so nothing downstream branches on how somebody arrived.
5559pub async fn post_iam_webauthn_signin_finish(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamWebauthnSigninFinishError>> {
5560
5561    let uri_str = format!("{}/v1/iam/webauthn/signin/finish", configuration.base_path);
5562    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5563
5564    if let Some(ref user_agent) = configuration.user_agent {
5565        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5566    }
5567    if let Some(ref token) = configuration.bearer_access_token {
5568        req_builder = req_builder.bearer_auth(token.to_owned());
5569    };
5570
5571    let req = req_builder.build()?;
5572    let resp = configuration.client.execute(req).await?;
5573
5574    let status = resp.status();
5575
5576    if !status.is_client_error() && !status.is_server_error() {
5577        Ok(())
5578    } else {
5579        let content = resp.text().await?;
5580        let entity: Option<PostIamWebauthnSigninFinishError> = serde_json::from_str(&content).ok();
5581        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5582    }
5583}
5584
5585/// Verifies the newly created passkey and stores it, so the person can sign in with their device from then on.
5586pub async fn post_iam_webauthn_signup_finish(configuration: &configuration::Configuration, ) -> Result<(), Error<PostIamWebauthnSignupFinishError>> {
5587
5588    let uri_str = format!("{}/v1/iam/webauthn/signup/finish", configuration.base_path);
5589    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5590
5591    if let Some(ref user_agent) = configuration.user_agent {
5592        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5593    }
5594    if let Some(ref token) = configuration.bearer_access_token {
5595        req_builder = req_builder.bearer_auth(token.to_owned());
5596    };
5597
5598    let req = req_builder.build()?;
5599    let resp = configuration.client.execute(req).await?;
5600
5601    let status = resp.status();
5602
5603    if !status.is_client_error() && !status.is_server_error() {
5604        Ok(())
5605    } else {
5606        let content = resp.text().await?;
5607        let entity: Option<PostIamWebauthnSignupFinishError> = serde_json::from_str(&content).ok();
5608        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5609    }
5610}
5611
5612/// Makes a workspace inside your organization — the scope a team works in, alongside projects rather than instead of them. A name already used in the organization is refused.
5613pub async fn post_iam_workspaces(configuration: &configuration::Configuration, iam_period_workspaces_period_input: models::IamPeriodWorkspacesPeriodInput) -> Result<models::IamPeriodWorkspace, Error<PostIamWorkspacesError>> {
5614    // add a prefix to parameters to efficiently prevent name collisions
5615    let p_iam_period_workspaces_period_input = iam_period_workspaces_period_input;
5616
5617    let uri_str = format!("{}/v1/iam/workspaces", configuration.base_path);
5618    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5619
5620    if let Some(ref user_agent) = configuration.user_agent {
5621        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5622    }
5623    if let Some(ref token) = configuration.bearer_access_token {
5624        req_builder = req_builder.bearer_auth(token.to_owned());
5625    };
5626    req_builder = req_builder.json(&p_iam_period_workspaces_period_input);
5627
5628    let req = req_builder.build()?;
5629    let resp = configuration.client.execute(req).await?;
5630
5631    let status = resp.status();
5632    let content_type = resp
5633        .headers()
5634        .get("content-type")
5635        .and_then(|v| v.to_str().ok())
5636        .unwrap_or("application/octet-stream");
5637    let content_type = super::ContentType::from(content_type);
5638
5639    if !status.is_client_error() && !status.is_server_error() {
5640        let content = resp.text().await?;
5641        match content_type {
5642            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5643            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspace`"))),
5644            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspace`")))),
5645        }
5646    } else {
5647        let content = resp.text().await?;
5648        let entity: Option<PostIamWorkspacesError> = serde_json::from_str(&content).ok();
5649        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5650    }
5651}
5652
5653/// Saves the calling person's own profile — the name they are shown by, their picture, a line about themselves and a link.  Only their own: the request names nobody, so it cannot reach another account. Send only what you are changing; a field you leave out keeps the value it had, and a field you send empty is cleared.  A picture is an https link or an inline image up to 96 KiB, the same value an organization's mark is (schema.AvatarRef) — one rule for how a subject appears, whether the subject is a person or an organization.
5654pub async fn put_iam_account(configuration: &configuration::Configuration, iam_period_account_body: models::IamPeriodAccountBody, cookie: Option<&str>, authorization: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PutIamAccountError>> {
5655    // add a prefix to parameters to efficiently prevent name collisions
5656    let p_iam_period_account_body = iam_period_account_body;
5657    let p_cookie = cookie;
5658    let p_authorization = authorization;
5659
5660    let uri_str = format!("{}/v1/iam/account", configuration.base_path);
5661    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5662
5663    if let Some(ref user_agent) = configuration.user_agent {
5664        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5665    }
5666    if let Some(param_value) = p_cookie {
5667        req_builder = req_builder.header("Cookie", param_value.to_string());
5668    }
5669    if let Some(param_value) = p_authorization {
5670        req_builder = req_builder.header("Authorization", param_value.to_string());
5671    }
5672    if let Some(ref token) = configuration.bearer_access_token {
5673        req_builder = req_builder.bearer_auth(token.to_owned());
5674    };
5675    req_builder = req_builder.json(&p_iam_period_account_body);
5676
5677    let req = req_builder.build()?;
5678    let resp = configuration.client.execute(req).await?;
5679
5680    let status = resp.status();
5681    let content_type = resp
5682        .headers()
5683        .get("content-type")
5684        .and_then(|v| v.to_str().ok())
5685        .unwrap_or("application/octet-stream");
5686    let content_type = super::ContentType::from(content_type);
5687
5688    if !status.is_client_error() && !status.is_server_error() {
5689        let content = resp.text().await?;
5690        match content_type {
5691            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5692            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
5693            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
5694        }
5695    } else {
5696        let content = resp.text().await?;
5697        let entity: Option<PutIamAccountError> = serde_json::from_str(&content).ok();
5698        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5699    }
5700}
5701
5702/// Changes an application's display, its sign-in methods and the redirect URIs it may return to — the call that makes login work from a new host. Which organization it belongs to and what it is named are fixed when it is created and are not editable here.  Exported so the legacy update-application alias reuses this exact path — one update, two spellings.
5703pub async fn put_iam_applications_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_application: models::IamPeriodApplication) -> Result<models::IamPeriodApplication, Error<PutIamApplicationsByOwnerByNameError>> {
5704    // add a prefix to parameters to efficiently prevent name collisions
5705    let p_owner = owner;
5706    let p_name = name;
5707    let p_iam_period_application = iam_period_application;
5708
5709    let uri_str = format!("{}/v1/iam/applications/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
5710    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5711
5712    if let Some(ref user_agent) = configuration.user_agent {
5713        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5714    }
5715    if let Some(ref token) = configuration.bearer_access_token {
5716        req_builder = req_builder.bearer_auth(token.to_owned());
5717    };
5718    req_builder = req_builder.json(&p_iam_period_application);
5719
5720    let req = req_builder.build()?;
5721    let resp = configuration.client.execute(req).await?;
5722
5723    let status = resp.status();
5724    let content_type = resp
5725        .headers()
5726        .get("content-type")
5727        .and_then(|v| v.to_str().ok())
5728        .unwrap_or("application/octet-stream");
5729    let content_type = super::ContentType::from(content_type);
5730
5731    if !status.is_client_error() && !status.is_server_error() {
5732        let content = resp.text().await?;
5733        match content_type {
5734            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5735            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodApplication`"))),
5736            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodApplication`")))),
5737        }
5738    } else {
5739        let content = resp.text().await?;
5740        let entity: Option<PutIamApplicationsByOwnerByNameError> = serde_json::from_str(&content).ok();
5741        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5742    }
5743}
5744
5745/// Corrects an audit entry. The trail is append-only in normal operation and nothing in the Hanzo Cloud rewrites it — this exists for an administrator to correct an entry their own systems recorded wrongly.
5746pub async fn put_iam_audit_logs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_input: models::IamPeriodInput) -> Result<models::IamPeriodAuditLog, Error<PutIamAuditLogsByOwnerByNameError>> {
5747    // add a prefix to parameters to efficiently prevent name collisions
5748    let p_owner = owner;
5749    let p_name = name;
5750    let p_iam_period_input = iam_period_input;
5751
5752    let uri_str = format!("{}/v1/iam/audit-logs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
5753    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5754
5755    if let Some(ref user_agent) = configuration.user_agent {
5756        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5757    }
5758    if let Some(ref token) = configuration.bearer_access_token {
5759        req_builder = req_builder.bearer_auth(token.to_owned());
5760    };
5761    req_builder = req_builder.json(&p_iam_period_input);
5762
5763    let req = req_builder.build()?;
5764    let resp = configuration.client.execute(req).await?;
5765
5766    let status = resp.status();
5767    let content_type = resp
5768        .headers()
5769        .get("content-type")
5770        .and_then(|v| v.to_str().ok())
5771        .unwrap_or("application/octet-stream");
5772    let content_type = super::ContentType::from(content_type);
5773
5774    if !status.is_client_error() && !status.is_server_error() {
5775        let content = resp.text().await?;
5776        match content_type {
5777            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5778            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAuditLog`"))),
5779            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAuditLog`")))),
5780        }
5781    } else {
5782        let content = resp.text().await?;
5783        let entity: Option<PutIamAuditLogsByOwnerByNameError> = serde_json::from_str(&content).ok();
5784        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5785    }
5786}
5787
5788/// Changes a signing certificate's settings. What it is called does not change, and neither does when it was added.  A PUT here is a METADATA edit — display name, expiry, provider. It overlays only the fields the request actually SET onto the loaded row: a field the JSON omits (or leaves at its zero value) keeps what the row holds, rather than blanking it. That is load-bearing, not a nicety. A read serves the public Certificate (Mask hides only PrivateKey and AccessSecret), so a client that reads a cert, changes one field, and writes it back sends the masked halves empty and every other field it did not touch at its zero value — and the old full-struct overlay wrote all of those blanks back. Blanking CryptoAlgorithm alone drops the cert from the JWKS (oidc.Publishes turns false), so every token under its `kid` stops verifying; blanking Provider/Account/ExpireTime breaks ACME renewal and expiry — all from a request that only meant to rename it. Absent-or-zero means \"unchanged\", so the deployment (key) and a rotation (cert) remain the only way key or published material changes; the metadata API cannot clear it.  The overlay is generic — it copies every set field, so a field nobody has added yet is carried without a line here — and leaves three things the request may not move: the bound Model (id, createdAt, key, snapshot), the natural key (owner/name address the row, they do not mutate it), and the creation stamp.
5789pub async fn put_iam_certs_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_cert: models::IamPeriodCert) -> Result<models::IamPeriodCert, Error<PutIamCertsByOwnerByNameError>> {
5790    // add a prefix to parameters to efficiently prevent name collisions
5791    let p_owner = owner;
5792    let p_name = name;
5793    let p_iam_period_cert = iam_period_cert;
5794
5795    let uri_str = format!("{}/v1/iam/certs/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
5796    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5797
5798    if let Some(ref user_agent) = configuration.user_agent {
5799        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5800    }
5801    if let Some(ref token) = configuration.bearer_access_token {
5802        req_builder = req_builder.bearer_auth(token.to_owned());
5803    };
5804    req_builder = req_builder.json(&p_iam_period_cert);
5805
5806    let req = req_builder.build()?;
5807    let resp = configuration.client.execute(req).await?;
5808
5809    let status = resp.status();
5810    let content_type = resp
5811        .headers()
5812        .get("content-type")
5813        .and_then(|v| v.to_str().ok())
5814        .unwrap_or("application/octet-stream");
5815    let content_type = super::ContentType::from(content_type);
5816
5817    if !status.is_client_error() && !status.is_server_error() {
5818        let content = resp.text().await?;
5819        match content_type {
5820            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5821            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodCert`"))),
5822            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodCert`")))),
5823        }
5824    } else {
5825        let content = resp.text().await?;
5826        let entity: Option<PutIamCertsByOwnerByNameError> = serde_json::from_str(&content).ok();
5827        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5828    }
5829}
5830
5831/// Records the calling person's privacy and communication choices. Only their own — there is no way to set consent for somebody else.  Send only the answers you are changing. A question you leave out keeps the answer it already had, so a screen that saves one switch never revokes the other, and two screens saving at once do not undo each other.  An answer this version does not recognize is refused here rather than stored, so nothing is ever persisted for a later reader to have to interpret.
5832pub async fn put_iam_consent(configuration: &configuration::Configuration, ) -> Result<(), Error<PutIamConsentError>> {
5833
5834    let uri_str = format!("{}/v1/iam/consent", configuration.base_path);
5835    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5836
5837    if let Some(ref user_agent) = configuration.user_agent {
5838        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5839    }
5840    if let Some(ref token) = configuration.bearer_access_token {
5841        req_builder = req_builder.bearer_auth(token.to_owned());
5842    };
5843
5844    let req = req_builder.build()?;
5845    let resp = configuration.client.execute(req).await?;
5846
5847    let status = resp.status();
5848
5849    if !status.is_client_error() && !status.is_server_error() {
5850        Ok(())
5851    } else {
5852        let content = resp.text().await?;
5853        let entity: Option<PutIamConsentError> = serde_json::from_str(&content).ok();
5854        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5855    }
5856}
5857
5858/// Changes an invitation's terms — the role it grants, how many may redeem it, or when it expires. What it is called does not change.
5859pub async fn put_iam_invitations_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_invitations_period_input: models::IamPeriodInvitationsPeriodInput) -> Result<models::IamPeriodInvitation, Error<PutIamInvitationsByOwnerByNameError>> {
5860    // add a prefix to parameters to efficiently prevent name collisions
5861    let p_owner = owner;
5862    let p_name = name;
5863    let p_iam_period_invitations_period_input = iam_period_invitations_period_input;
5864
5865    let uri_str = format!("{}/v1/iam/invitations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
5866    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5867
5868    if let Some(ref user_agent) = configuration.user_agent {
5869        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5870    }
5871    if let Some(ref token) = configuration.bearer_access_token {
5872        req_builder = req_builder.bearer_auth(token.to_owned());
5873    };
5874    req_builder = req_builder.json(&p_iam_period_invitations_period_input);
5875
5876    let req = req_builder.build()?;
5877    let resp = configuration.client.execute(req).await?;
5878
5879    let status = resp.status();
5880    let content_type = resp
5881        .headers()
5882        .get("content-type")
5883        .and_then(|v| v.to_str().ok())
5884        .unwrap_or("application/octet-stream");
5885    let content_type = super::ContentType::from(content_type);
5886
5887    if !status.is_client_error() && !status.is_server_error() {
5888        let content = resp.text().await?;
5889        match content_type {
5890            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5891            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodInvitation`"))),
5892            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodInvitation`")))),
5893        }
5894    } else {
5895        let content = resp.text().await?;
5896        let entity: Option<PutIamInvitationsByOwnerByNameError> = serde_json::from_str(&content).ok();
5897        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5898    }
5899}
5900
5901/// Changes what a key is called or what it may reach. The credential itself is not reissued — the key in your deployment keeps working.
5902pub async fn put_iam_keys_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_key: models::IamPeriodKey) -> Result<models::IamPeriodKey, Error<PutIamKeysByOwnerByNameError>> {
5903    // add a prefix to parameters to efficiently prevent name collisions
5904    let p_owner = owner;
5905    let p_name = name;
5906    let p_iam_period_key = iam_period_key;
5907
5908    let uri_str = format!("{}/v1/iam/keys/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
5909    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5910
5911    if let Some(ref user_agent) = configuration.user_agent {
5912        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5913    }
5914    if let Some(ref token) = configuration.bearer_access_token {
5915        req_builder = req_builder.bearer_auth(token.to_owned());
5916    };
5917    req_builder = req_builder.json(&p_iam_period_key);
5918
5919    let req = req_builder.build()?;
5920    let resp = configuration.client.execute(req).await?;
5921
5922    let status = resp.status();
5923    let content_type = resp
5924        .headers()
5925        .get("content-type")
5926        .and_then(|v| v.to_str().ok())
5927        .unwrap_or("application/octet-stream");
5928    let content_type = super::ContentType::from(content_type);
5929
5930    if !status.is_client_error() && !status.is_server_error() {
5931        let content = resp.text().await?;
5932        match content_type {
5933            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5934            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodKey`"))),
5935            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodKey`")))),
5936        }
5937    } else {
5938        let content = resp.text().await?;
5939        let entity: Option<PutIamKeysByOwnerByNameError> = serde_json::from_str(&content).ok();
5940        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5941    }
5942}
5943
5944/// Replaces the calling person's password. Only their own — there is no shape of this request that writes somebody else's.  Prove who you are with the password you are replacing, or — when you cannot sign in at all — with a code sent to the address the account already holds. Exactly one of the two: a request carrying both proves nothing more than either, and answering it would mean deciding which one mattered.  A reset also clears the account lockout, in the SAME transaction as the digest. Replacing a credential retires the run of guesses against the old one, and without this a person who reset a forgotten password was still refused for up to fifteen more minutes — with the brand-new password they had just chosen.
5945pub async fn put_iam_password(configuration: &configuration::Configuration, iam_period_password_body: models::IamPeriodPasswordBody, cookie: Option<&str>, authorization: Option<&str>) -> Result<models::IamPeriodAnswer, Error<PutIamPasswordError>> {
5946    // add a prefix to parameters to efficiently prevent name collisions
5947    let p_iam_period_password_body = iam_period_password_body;
5948    let p_cookie = cookie;
5949    let p_authorization = authorization;
5950
5951    let uri_str = format!("{}/v1/iam/password", configuration.base_path);
5952    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5953
5954    if let Some(ref user_agent) = configuration.user_agent {
5955        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5956    }
5957    if let Some(param_value) = p_cookie {
5958        req_builder = req_builder.header("Cookie", param_value.to_string());
5959    }
5960    if let Some(param_value) = p_authorization {
5961        req_builder = req_builder.header("Authorization", param_value.to_string());
5962    }
5963    if let Some(ref token) = configuration.bearer_access_token {
5964        req_builder = req_builder.bearer_auth(token.to_owned());
5965    };
5966    req_builder = req_builder.json(&p_iam_period_password_body);
5967
5968    let req = req_builder.build()?;
5969    let resp = configuration.client.execute(req).await?;
5970
5971    let status = resp.status();
5972    let content_type = resp
5973        .headers()
5974        .get("content-type")
5975        .and_then(|v| v.to_str().ok())
5976        .unwrap_or("application/octet-stream");
5977    let content_type = super::ContentType::from(content_type);
5978
5979    if !status.is_client_error() && !status.is_server_error() {
5980        let content = resp.text().await?;
5981        match content_type {
5982            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5983            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodAnswer`"))),
5984            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodAnswer`")))),
5985        }
5986    } else {
5987        let content = resp.text().await?;
5988        let entity: Option<PutIamPasswordError> = serde_json::from_str(&content).ok();
5989        Err(Error::ResponseError(ResponseContent { status, content, entity }))
5990    }
5991}
5992
5993/// Changes who a permission grants to, what it allows, or the resources it covers. Access changes as soon as the write lands. What the permission is called does not change, and neither does when it was created.
5994pub async fn put_iam_permissions_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_permission: models::IamPeriodPermission) -> Result<models::IamPeriodPermission, Error<PutIamPermissionsByOwnerByNameError>> {
5995    // add a prefix to parameters to efficiently prevent name collisions
5996    let p_owner = owner;
5997    let p_name = name;
5998    let p_iam_period_permission = iam_period_permission;
5999
6000    let uri_str = format!("{}/v1/iam/permissions/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6001    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6002
6003    if let Some(ref user_agent) = configuration.user_agent {
6004        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6005    }
6006    if let Some(ref token) = configuration.bearer_access_token {
6007        req_builder = req_builder.bearer_auth(token.to_owned());
6008    };
6009    req_builder = req_builder.json(&p_iam_period_permission);
6010
6011    let req = req_builder.build()?;
6012    let resp = configuration.client.execute(req).await?;
6013
6014    let status = resp.status();
6015    let content_type = resp
6016        .headers()
6017        .get("content-type")
6018        .and_then(|v| v.to_str().ok())
6019        .unwrap_or("application/octet-stream");
6020    let content_type = super::ContentType::from(content_type);
6021
6022    if !status.is_client_error() && !status.is_server_error() {
6023        let content = resp.text().await?;
6024        match content_type {
6025            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6026            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodPermission`"))),
6027            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodPermission`")))),
6028        }
6029    } else {
6030        let content = resp.text().await?;
6031        let entity: Option<PutIamPermissionsByOwnerByNameError> = serde_json::from_str(&content).ok();
6032        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6033    }
6034}
6035
6036/// Changes a project's settings. What it is called does not change, and neither does when it was created.
6037pub async fn put_iam_projects_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_projects_period_input: models::IamPeriodProjectsPeriodInput) -> Result<models::IamPeriodProject, Error<PutIamProjectsByOwnerByNameError>> {
6038    // add a prefix to parameters to efficiently prevent name collisions
6039    let p_owner = owner;
6040    let p_name = name;
6041    let p_iam_period_projects_period_input = iam_period_projects_period_input;
6042
6043    let uri_str = format!("{}/v1/iam/projects/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6044    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6045
6046    if let Some(ref user_agent) = configuration.user_agent {
6047        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6048    }
6049    if let Some(ref token) = configuration.bearer_access_token {
6050        req_builder = req_builder.bearer_auth(token.to_owned());
6051    };
6052    req_builder = req_builder.json(&p_iam_period_projects_period_input);
6053
6054    let req = req_builder.build()?;
6055    let resp = configuration.client.execute(req).await?;
6056
6057    let status = resp.status();
6058    let content_type = resp
6059        .headers()
6060        .get("content-type")
6061        .and_then(|v| v.to_str().ok())
6062        .unwrap_or("application/octet-stream");
6063    let content_type = super::ContentType::from(content_type);
6064
6065    if !status.is_client_error() && !status.is_server_error() {
6066        let content = resp.text().await?;
6067        match content_type {
6068            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6069            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodProject`"))),
6070            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodProject`")))),
6071        }
6072    } else {
6073        let content = resp.text().await?;
6074        let entity: Option<PutIamProjectsByOwnerByNameError> = serde_json::from_str(&content).ok();
6075        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6076    }
6077}
6078
6079/// Changes who is in a role, or which roles it includes. Access changes for everyone in it as soon as the write lands. What the role is called does not change, and neither does when it was created.
6080pub async fn put_iam_roles_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_roles_period_input: models::IamPeriodRolesPeriodInput) -> Result<models::IamPeriodRole, Error<PutIamRolesByOwnerByNameError>> {
6081    // add a prefix to parameters to efficiently prevent name collisions
6082    let p_owner = owner;
6083    let p_name = name;
6084    let p_iam_period_roles_period_input = iam_period_roles_period_input;
6085
6086    let uri_str = format!("{}/v1/iam/roles/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6087    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6088
6089    if let Some(ref user_agent) = configuration.user_agent {
6090        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6091    }
6092    if let Some(ref token) = configuration.bearer_access_token {
6093        req_builder = req_builder.bearer_auth(token.to_owned());
6094    };
6095    req_builder = req_builder.json(&p_iam_period_roles_period_input);
6096
6097    let req = req_builder.build()?;
6098    let resp = configuration.client.execute(req).await?;
6099
6100    let status = resp.status();
6101    let content_type = resp
6102        .headers()
6103        .get("content-type")
6104        .and_then(|v| v.to_str().ok())
6105        .unwrap_or("application/octet-stream");
6106    let content_type = super::ContentType::from(content_type);
6107
6108    if !status.is_client_error() && !status.is_server_error() {
6109        let content = resp.text().await?;
6110        match content_type {
6111            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6112            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodRole`"))),
6113            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodRole`")))),
6114        }
6115    } else {
6116        let content = resp.text().await?;
6117        let entity: Option<PutIamRolesByOwnerByNameError> = serde_json::from_str(&content).ok();
6118        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6119    }
6120}
6121
6122/// Overwrites a person's SCIM attributes with what your identity provider sends — how a change made there lands here.  Only the attributes SCIM describes are replaced. Anything the standard does not cover — their multi-factor enrolment above all — survives untouched, so a routine sync from your IdP can never quietly strip someone's second factor or bring a deleted account back.
6123pub async fn put_iam_scim_v2_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str) -> Result<(), Error<PutIamScimV2UsersByOwnerByNameError>> {
6124    // add a prefix to parameters to efficiently prevent name collisions
6125    let p_owner = owner;
6126    let p_name = name;
6127
6128    let uri_str = format!("{}/v1/iam/scim/v2/Users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6129    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6130
6131    if let Some(ref user_agent) = configuration.user_agent {
6132        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6133    }
6134    if let Some(ref token) = configuration.bearer_access_token {
6135        req_builder = req_builder.bearer_auth(token.to_owned());
6136    };
6137
6138    let req = req_builder.build()?;
6139    let resp = configuration.client.execute(req).await?;
6140
6141    let status = resp.status();
6142
6143    if !status.is_client_error() && !status.is_server_error() {
6144        Ok(())
6145    } else {
6146        let content = resp.text().await?;
6147        let entity: Option<PutIamScimV2UsersByOwnerByNameError> = serde_json::from_str(&content).ok();
6148        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6149    }
6150}
6151
6152/// Changes a person's profile, their roles, or the credentials they sign in with. Send a password to reset it; leave it out and their current one keeps working.  Who they are does not change: their organization, username and the identifier their existing sessions are keyed on all survive the write, so an update never signs anyone out.
6153pub async fn put_iam_users_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_update_input: models::IamPeriodUpdateInput) -> Result<models::IamPeriodUser, Error<PutIamUsersByOwnerByNameError>> {
6154    // add a prefix to parameters to efficiently prevent name collisions
6155    let p_owner = owner;
6156    let p_name = name;
6157    let p_iam_period_update_input = iam_period_update_input;
6158
6159    let uri_str = format!("{}/v1/iam/users/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6160    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6161
6162    if let Some(ref user_agent) = configuration.user_agent {
6163        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6164    }
6165    if let Some(ref token) = configuration.bearer_access_token {
6166        req_builder = req_builder.bearer_auth(token.to_owned());
6167    };
6168    req_builder = req_builder.json(&p_iam_period_update_input);
6169
6170    let req = req_builder.build()?;
6171    let resp = configuration.client.execute(req).await?;
6172
6173    let status = resp.status();
6174    let content_type = resp
6175        .headers()
6176        .get("content-type")
6177        .and_then(|v| v.to_str().ok())
6178        .unwrap_or("application/octet-stream");
6179    let content_type = super::ContentType::from(content_type);
6180
6181    if !status.is_client_error() && !status.is_server_error() {
6182        let content = resp.text().await?;
6183        match content_type {
6184            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6185            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodUser`"))),
6186            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodUser`")))),
6187        }
6188    } else {
6189        let content = resp.text().await?;
6190        let entity: Option<PutIamUsersByOwnerByNameError> = serde_json::from_str(&content).ok();
6191        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6192    }
6193}
6194
6195/// Changes a workspace's settings. What it is called does not change, and neither does when it was created.
6196pub async fn put_iam_workspaces_by_owner_by_name(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_workspaces_period_input: models::IamPeriodWorkspacesPeriodInput) -> Result<models::IamPeriodWorkspace, Error<PutIamWorkspacesByOwnerByNameError>> {
6197    // add a prefix to parameters to efficiently prevent name collisions
6198    let p_owner = owner;
6199    let p_name = name;
6200    let p_iam_period_workspaces_period_input = iam_period_workspaces_period_input;
6201
6202    let uri_str = format!("{}/v1/iam/workspaces/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6203    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6204
6205    if let Some(ref user_agent) = configuration.user_agent {
6206        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6207    }
6208    if let Some(ref token) = configuration.bearer_access_token {
6209        req_builder = req_builder.bearer_auth(token.to_owned());
6210    };
6211    req_builder = req_builder.json(&p_iam_period_workspaces_period_input);
6212
6213    let req = req_builder.build()?;
6214    let resp = configuration.client.execute(req).await?;
6215
6216    let status = resp.status();
6217    let content_type = resp
6218        .headers()
6219        .get("content-type")
6220        .and_then(|v| v.to_str().ok())
6221        .unwrap_or("application/octet-stream");
6222    let content_type = super::ContentType::from(content_type);
6223
6224    if !status.is_client_error() && !status.is_server_error() {
6225        let content = resp.text().await?;
6226        match content_type {
6227            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6228            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWorkspace`"))),
6229            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWorkspace`")))),
6230        }
6231    } else {
6232        let content = resp.text().await?;
6233        let entity: Option<PutIamWorkspacesByOwnerByNameError> = serde_json::from_str(&content).ok();
6234        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6235    }
6236}
6237
6238/// Changes how an organization appears across Hanzo: the square mark beside its name, as an uploaded image or as a single emoji. Sending an image clears the emoji and sending an emoji clears the image — an organization has one mark, not a preference order — and sending neither clears both, which is how it goes back to being drawn as its initial.  An image is an https link or the bytes inline as a data URL, up to 96 KiB. Anyone who administers the organization may set this; it is not reserved to the platform.  It writes the two fields onto the stored row and touches nothing else, which update cannot do: update replaces the whole record, and a record read back first arrives masked, so a read-modify-write through it would persist the mask over the organization's own credential settings.
6239pub async fn set_organization_avatar(configuration: &configuration::Configuration, iam_period_set_avatar_input: models::IamPeriodSetAvatarInput) -> Result<models::IamPeriodOrganization, Error<SetOrganizationAvatarError>> {
6240    // add a prefix to parameters to efficiently prevent name collisions
6241    let p_iam_period_set_avatar_input = iam_period_set_avatar_input;
6242
6243    let uri_str = format!("{}/v1/iam/organizations/avatar", configuration.base_path);
6244    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6245
6246    if let Some(ref user_agent) = configuration.user_agent {
6247        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6248    }
6249    if let Some(ref token) = configuration.bearer_access_token {
6250        req_builder = req_builder.bearer_auth(token.to_owned());
6251    };
6252    req_builder = req_builder.json(&p_iam_period_set_avatar_input);
6253
6254    let req = req_builder.build()?;
6255    let resp = configuration.client.execute(req).await?;
6256
6257    let status = resp.status();
6258    let content_type = resp
6259        .headers()
6260        .get("content-type")
6261        .and_then(|v| v.to_str().ok())
6262        .unwrap_or("application/octet-stream");
6263    let content_type = super::ContentType::from(content_type);
6264
6265    if !status.is_client_error() && !status.is_server_error() {
6266        let content = resp.text().await?;
6267        match content_type {
6268            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6269            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
6270            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
6271        }
6272    } else {
6273        let content = resp.text().await?;
6274        let entity: Option<SetOrganizationAvatarError> = serde_json::from_str(&content).ok();
6275        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6276    }
6277}
6278
6279/// Changes an organization's display, its defaults and the sign-in rules everyone in it inherits. Which organization it is does not change, and neither does when it was created.
6280pub async fn update_organization(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_update_organization_input: models::IamPeriodUpdateOrganizationInput) -> Result<models::IamPeriodOrganization, Error<UpdateOrganizationError>> {
6281    // add a prefix to parameters to efficiently prevent name collisions
6282    let p_owner = owner;
6283    let p_name = name;
6284    let p_iam_period_update_organization_input = iam_period_update_organization_input;
6285
6286    let uri_str = format!("{}/v1/iam/organizations/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6287    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6288
6289    if let Some(ref user_agent) = configuration.user_agent {
6290        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6291    }
6292    if let Some(ref token) = configuration.bearer_access_token {
6293        req_builder = req_builder.bearer_auth(token.to_owned());
6294    };
6295    req_builder = req_builder.json(&p_iam_period_update_organization_input);
6296
6297    let req = req_builder.build()?;
6298    let resp = configuration.client.execute(req).await?;
6299
6300    let status = resp.status();
6301    let content_type = resp
6302        .headers()
6303        .get("content-type")
6304        .and_then(|v| v.to_str().ok())
6305        .unwrap_or("application/octet-stream");
6306    let content_type = super::ContentType::from(content_type);
6307
6308    if !status.is_client_error() && !status.is_server_error() {
6309        let content = resp.text().await?;
6310        match content_type {
6311            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6312            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodOrganization`"))),
6313            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodOrganization`")))),
6314        }
6315    } else {
6316        let content = resp.text().await?;
6317        let entity: Option<UpdateOrganizationError> = serde_json::from_str(&content).ok();
6318        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6319    }
6320}
6321
6322/// Changes a provider's settings or rotates the credentials it holds. The change takes effect on the next sign-in through it — sessions already issued are unaffected.  A provider that is not there answers \"nothing changed\" rather than an error, so the call is safe to repeat.
6323pub async fn update_provider(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_provider: models::IamPeriodProvider) -> Result<models::IamPeriodMutationResult, Error<UpdateProviderError>> {
6324    // add a prefix to parameters to efficiently prevent name collisions
6325    let p_owner = owner;
6326    let p_name = name;
6327    let p_iam_period_provider = iam_period_provider;
6328
6329    let uri_str = format!("{}/v1/iam/providers/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6330    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6331
6332    if let Some(ref user_agent) = configuration.user_agent {
6333        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6334    }
6335    if let Some(ref token) = configuration.bearer_access_token {
6336        req_builder = req_builder.bearer_auth(token.to_owned());
6337    };
6338    req_builder = req_builder.json(&p_iam_period_provider);
6339
6340    let req = req_builder.build()?;
6341    let resp = configuration.client.execute(req).await?;
6342
6343    let status = resp.status();
6344    let content_type = resp
6345        .headers()
6346        .get("content-type")
6347        .and_then(|v| v.to_str().ok())
6348        .unwrap_or("application/octet-stream");
6349    let content_type = super::ContentType::from(content_type);
6350
6351    if !status.is_client_error() && !status.is_server_error() {
6352        let content = resp.text().await?;
6353        match content_type {
6354            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6355            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodMutationResult`"))),
6356            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodMutationResult`")))),
6357        }
6358    } else {
6359        let content = resp.text().await?;
6360        let entity: Option<UpdateProviderError> = serde_json::from_str(&content).ok();
6361        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6362    }
6363}
6364
6365/// Replaces the set of browsers a session covers — signing out the ones you leave off while the session itself stays live. A session that does not exist is reported as missing rather than created.
6366pub async fn update_session(configuration: &configuration::Configuration, owner: &str, name: &str, application: &str, iam_period_update_session_in: models::IamPeriodUpdateSessionIn) -> Result<models::IamPeriodSession, Error<UpdateSessionError>> {
6367    // add a prefix to parameters to efficiently prevent name collisions
6368    let p_owner = owner;
6369    let p_name = name;
6370    let p_application = application;
6371    let p_iam_period_update_session_in = iam_period_update_session_in;
6372
6373    let uri_str = format!("{}/v1/iam/sessions/{owner}/{name}/{application}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name), application=crate::apis::urlencode(p_application));
6374    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6375
6376    if let Some(ref user_agent) = configuration.user_agent {
6377        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6378    }
6379    if let Some(ref token) = configuration.bearer_access_token {
6380        req_builder = req_builder.bearer_auth(token.to_owned());
6381    };
6382    req_builder = req_builder.json(&p_iam_period_update_session_in);
6383
6384    let req = req_builder.build()?;
6385    let resp = configuration.client.execute(req).await?;
6386
6387    let status = resp.status();
6388    let content_type = resp
6389        .headers()
6390        .get("content-type")
6391        .and_then(|v| v.to_str().ok())
6392        .unwrap_or("application/octet-stream");
6393    let content_type = super::ContentType::from(content_type);
6394
6395    if !status.is_client_error() && !status.is_server_error() {
6396        let content = resp.text().await?;
6397        match content_type {
6398            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6399            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodSession`"))),
6400            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodSession`")))),
6401        }
6402    } else {
6403        let content = resp.text().await?;
6404        let entity: Option<UpdateSessionError> = serde_json::from_str(&content).ok();
6405        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6406    }
6407}
6408
6409/// Changes an access token's scope or expiry.  A token that is not there answers \"nothing changed\" rather than an error, so the call is safe to repeat.
6410pub async fn update_token(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_token: models::IamPeriodToken) -> Result<models::IamPeriodTokenMutation, Error<UpdateTokenError>> {
6411    // add a prefix to parameters to efficiently prevent name collisions
6412    let p_owner = owner;
6413    let p_name = name;
6414    let p_iam_period_token = iam_period_token;
6415
6416    let uri_str = format!("{}/v1/iam/tokens/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6417    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6418
6419    if let Some(ref user_agent) = configuration.user_agent {
6420        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6421    }
6422    if let Some(ref token) = configuration.bearer_access_token {
6423        req_builder = req_builder.bearer_auth(token.to_owned());
6424    };
6425    req_builder = req_builder.json(&p_iam_period_token);
6426
6427    let req = req_builder.build()?;
6428    let resp = configuration.client.execute(req).await?;
6429
6430    let status = resp.status();
6431    let content_type = resp
6432        .headers()
6433        .get("content-type")
6434        .and_then(|v| v.to_str().ok())
6435        .unwrap_or("application/octet-stream");
6436    let content_type = super::ContentType::from(content_type);
6437
6438    if !status.is_client_error() && !status.is_server_error() {
6439        let content = resp.text().await?;
6440        match content_type {
6441            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6442            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodTokenMutation`"))),
6443            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodTokenMutation`")))),
6444        }
6445    } else {
6446        let content = resp.text().await?;
6447        let entity: Option<UpdateTokenError> = serde_json::from_str(&content).ok();
6448        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6449    }
6450}
6451
6452/// Renames a registered passkey or security key, so a person can tell their devices apart.  A credential that is not there answers \"nothing changed\" rather than an error, so the call is safe to repeat.
6453pub async fn update_webauthn_credential(configuration: &configuration::Configuration, owner: &str, name: &str, iam_period_webauthn_credential: models::IamPeriodWebauthnCredential) -> Result<models::IamPeriodWebauthnCredentialMutationResult, Error<UpdateWebauthnCredentialError>> {
6454    // add a prefix to parameters to efficiently prevent name collisions
6455    let p_owner = owner;
6456    let p_name = name;
6457    let p_iam_period_webauthn_credential = iam_period_webauthn_credential;
6458
6459    let uri_str = format!("{}/v1/iam/webauthn-credentials/{owner}/{name}", configuration.base_path, owner=crate::apis::urlencode(p_owner), name=crate::apis::urlencode(p_name));
6460    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6461
6462    if let Some(ref user_agent) = configuration.user_agent {
6463        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6464    }
6465    if let Some(ref token) = configuration.bearer_access_token {
6466        req_builder = req_builder.bearer_auth(token.to_owned());
6467    };
6468    req_builder = req_builder.json(&p_iam_period_webauthn_credential);
6469
6470    let req = req_builder.build()?;
6471    let resp = configuration.client.execute(req).await?;
6472
6473    let status = resp.status();
6474    let content_type = resp
6475        .headers()
6476        .get("content-type")
6477        .and_then(|v| v.to_str().ok())
6478        .unwrap_or("application/octet-stream");
6479    let content_type = super::ContentType::from(content_type);
6480
6481    if !status.is_client_error() && !status.is_server_error() {
6482        let content = resp.text().await?;
6483        match content_type {
6484            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6485            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`"))),
6486            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodWebauthnCredentialMutationResult`")))),
6487        }
6488    } else {
6489        let content = resp.text().await?;
6490        let entity: Option<UpdateWebauthnCredentialError> = serde_json::from_str(&content).ok();
6491        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6492    }
6493}
6494
6495/// Creates an application or updates it in place, so a deployment can declare the applications it needs and run the same declaration on every environment and on every redeploy.  It says which of the two it did. Leave the client secret out and the existing one is kept — so re-running your deployment does not rotate a credential your running services are holding.
6496pub async fn upsert_application(configuration: &configuration::Configuration, iam_period_registration: models::IamPeriodRegistration, authorization: Option<&str>) -> Result<models::IamPeriodReply, Error<UpsertApplicationError>> {
6497    // add a prefix to parameters to efficiently prevent name collisions
6498    let p_iam_period_registration = iam_period_registration;
6499    let p_authorization = authorization;
6500
6501    let uri_str = format!("{}/v1/iam/admin/applications/upsert", configuration.base_path);
6502    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6503
6504    if let Some(ref user_agent) = configuration.user_agent {
6505        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6506    }
6507    if let Some(param_value) = p_authorization {
6508        req_builder = req_builder.header("Authorization", param_value.to_string());
6509    }
6510    if let Some(ref token) = configuration.bearer_access_token {
6511        req_builder = req_builder.bearer_auth(token.to_owned());
6512    };
6513    req_builder = req_builder.json(&p_iam_period_registration);
6514
6515    let req = req_builder.build()?;
6516    let resp = configuration.client.execute(req).await?;
6517
6518    let status = resp.status();
6519    let content_type = resp
6520        .headers()
6521        .get("content-type")
6522        .and_then(|v| v.to_str().ok())
6523        .unwrap_or("application/octet-stream");
6524    let content_type = super::ContentType::from(content_type);
6525
6526    if !status.is_client_error() && !status.is_server_error() {
6527        let content = resp.text().await?;
6528        match content_type {
6529            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6530            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodReply`"))),
6531            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodReply`")))),
6532        }
6533    } else {
6534        let content = resp.text().await?;
6535        let entity: Option<UpsertApplicationError> = serde_json::from_str(&content).ok();
6536        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6537    }
6538}
6539
6540/// Creates a person or updates them in place, so a deployment can declare the accounts it needs and re-run that declaration safely.  It DESCRIBES an account it meets and GRANTS only to one it creates: org-admin is never raised on a row that already exists, and a machine identity is answered by name rather than adopted. Both are properties of the update itself, so a steady-state reconcile — which changes neither — is unaffected.  Passwords are hashed before they are stored. Leave the password out and their current one is kept, so a redeploy never locks somebody out; send the same one again and it is kept too, so a steady-state re-run is not a rotation.
6541pub async fn upsert_user(configuration: &configuration::Configuration, iam_period_person: models::IamPeriodPerson, authorization: Option<&str>) -> Result<models::IamPeriodReply, Error<UpsertUserError>> {
6542    // add a prefix to parameters to efficiently prevent name collisions
6543    let p_iam_period_person = iam_period_person;
6544    let p_authorization = authorization;
6545
6546    let uri_str = format!("{}/v1/iam/admin/users/upsert", configuration.base_path);
6547    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6548
6549    if let Some(ref user_agent) = configuration.user_agent {
6550        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6551    }
6552    if let Some(param_value) = p_authorization {
6553        req_builder = req_builder.header("Authorization", param_value.to_string());
6554    }
6555    if let Some(ref token) = configuration.bearer_access_token {
6556        req_builder = req_builder.bearer_auth(token.to_owned());
6557    };
6558    req_builder = req_builder.json(&p_iam_period_person);
6559
6560    let req = req_builder.build()?;
6561    let resp = configuration.client.execute(req).await?;
6562
6563    let status = resp.status();
6564    let content_type = resp
6565        .headers()
6566        .get("content-type")
6567        .and_then(|v| v.to_str().ok())
6568        .unwrap_or("application/octet-stream");
6569    let content_type = super::ContentType::from(content_type);
6570
6571    if !status.is_client_error() && !status.is_server_error() {
6572        let content = resp.text().await?;
6573        match content_type {
6574            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6575            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::IamPeriodReply`"))),
6576            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::IamPeriodReply`")))),
6577        }
6578    } else {
6579        let content = resp.text().await?;
6580        let entity: Option<UpsertUserError> = serde_json::from_str(&content).ok();
6581        Err(Error::ResponseError(ResponseContent { status, content, entity }))
6582    }
6583}
6584