Skip to main content

authentik_client/apis/
propertymappings_api.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use super::{configuration, ContentType, Error};
12use crate::{apis::ResponseContent, models};
13use reqwest;
14use serde::{de::Error as _, Deserialize, Serialize};
15
16/// struct for typed errors of method [`propertymappings_all_destroy`]
17#[derive(Debug, Clone, Serialize, Deserialize)]
18#[serde(untagged)]
19pub enum PropertymappingsAllDestroyError {
20    Status400(models::ValidationError),
21    Status403(models::GenericError),
22    UnknownValue(serde_json::Value),
23}
24
25/// struct for typed errors of method [`propertymappings_all_list`]
26#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum PropertymappingsAllListError {
29    Status400(models::ValidationError),
30    Status403(models::GenericError),
31    UnknownValue(serde_json::Value),
32}
33
34/// struct for typed errors of method [`propertymappings_all_retrieve`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum PropertymappingsAllRetrieveError {
38    Status400(models::ValidationError),
39    Status403(models::GenericError),
40    UnknownValue(serde_json::Value),
41}
42
43/// struct for typed errors of method [`propertymappings_all_test_create`]
44#[derive(Debug, Clone, Serialize, Deserialize)]
45#[serde(untagged)]
46pub enum PropertymappingsAllTestCreateError {
47    Status400(),
48    Status403(models::GenericError),
49    UnknownValue(serde_json::Value),
50}
51
52/// struct for typed errors of method [`propertymappings_all_types_list`]
53#[derive(Debug, Clone, Serialize, Deserialize)]
54#[serde(untagged)]
55pub enum PropertymappingsAllTypesListError {
56    Status400(models::ValidationError),
57    Status403(models::GenericError),
58    UnknownValue(serde_json::Value),
59}
60
61/// struct for typed errors of method [`propertymappings_all_used_by_list`]
62#[derive(Debug, Clone, Serialize, Deserialize)]
63#[serde(untagged)]
64pub enum PropertymappingsAllUsedByListError {
65    Status400(models::ValidationError),
66    Status403(models::GenericError),
67    UnknownValue(serde_json::Value),
68}
69
70/// struct for typed errors of method [`propertymappings_notification_create`]
71#[derive(Debug, Clone, Serialize, Deserialize)]
72#[serde(untagged)]
73pub enum PropertymappingsNotificationCreateError {
74    Status400(models::ValidationError),
75    Status403(models::GenericError),
76    UnknownValue(serde_json::Value),
77}
78
79/// struct for typed errors of method [`propertymappings_notification_destroy`]
80#[derive(Debug, Clone, Serialize, Deserialize)]
81#[serde(untagged)]
82pub enum PropertymappingsNotificationDestroyError {
83    Status400(models::ValidationError),
84    Status403(models::GenericError),
85    UnknownValue(serde_json::Value),
86}
87
88/// struct for typed errors of method [`propertymappings_notification_list`]
89#[derive(Debug, Clone, Serialize, Deserialize)]
90#[serde(untagged)]
91pub enum PropertymappingsNotificationListError {
92    Status400(models::ValidationError),
93    Status403(models::GenericError),
94    UnknownValue(serde_json::Value),
95}
96
97/// struct for typed errors of method [`propertymappings_notification_partial_update`]
98#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum PropertymappingsNotificationPartialUpdateError {
101    Status400(models::ValidationError),
102    Status403(models::GenericError),
103    UnknownValue(serde_json::Value),
104}
105
106/// struct for typed errors of method [`propertymappings_notification_retrieve`]
107#[derive(Debug, Clone, Serialize, Deserialize)]
108#[serde(untagged)]
109pub enum PropertymappingsNotificationRetrieveError {
110    Status400(models::ValidationError),
111    Status403(models::GenericError),
112    UnknownValue(serde_json::Value),
113}
114
115/// struct for typed errors of method [`propertymappings_notification_update`]
116#[derive(Debug, Clone, Serialize, Deserialize)]
117#[serde(untagged)]
118pub enum PropertymappingsNotificationUpdateError {
119    Status400(models::ValidationError),
120    Status403(models::GenericError),
121    UnknownValue(serde_json::Value),
122}
123
124/// struct for typed errors of method [`propertymappings_notification_used_by_list`]
125#[derive(Debug, Clone, Serialize, Deserialize)]
126#[serde(untagged)]
127pub enum PropertymappingsNotificationUsedByListError {
128    Status400(models::ValidationError),
129    Status403(models::GenericError),
130    UnknownValue(serde_json::Value),
131}
132
133/// struct for typed errors of method [`propertymappings_provider_google_workspace_create`]
134#[derive(Debug, Clone, Serialize, Deserialize)]
135#[serde(untagged)]
136pub enum PropertymappingsProviderGoogleWorkspaceCreateError {
137    Status400(models::ValidationError),
138    Status403(models::GenericError),
139    UnknownValue(serde_json::Value),
140}
141
142/// struct for typed errors of method [`propertymappings_provider_google_workspace_destroy`]
143#[derive(Debug, Clone, Serialize, Deserialize)]
144#[serde(untagged)]
145pub enum PropertymappingsProviderGoogleWorkspaceDestroyError {
146    Status400(models::ValidationError),
147    Status403(models::GenericError),
148    UnknownValue(serde_json::Value),
149}
150
151/// struct for typed errors of method [`propertymappings_provider_google_workspace_list`]
152#[derive(Debug, Clone, Serialize, Deserialize)]
153#[serde(untagged)]
154pub enum PropertymappingsProviderGoogleWorkspaceListError {
155    Status400(models::ValidationError),
156    Status403(models::GenericError),
157    UnknownValue(serde_json::Value),
158}
159
160/// struct for typed errors of method [`propertymappings_provider_google_workspace_partial_update`]
161#[derive(Debug, Clone, Serialize, Deserialize)]
162#[serde(untagged)]
163pub enum PropertymappingsProviderGoogleWorkspacePartialUpdateError {
164    Status400(models::ValidationError),
165    Status403(models::GenericError),
166    UnknownValue(serde_json::Value),
167}
168
169/// struct for typed errors of method [`propertymappings_provider_google_workspace_retrieve`]
170#[derive(Debug, Clone, Serialize, Deserialize)]
171#[serde(untagged)]
172pub enum PropertymappingsProviderGoogleWorkspaceRetrieveError {
173    Status400(models::ValidationError),
174    Status403(models::GenericError),
175    UnknownValue(serde_json::Value),
176}
177
178/// struct for typed errors of method [`propertymappings_provider_google_workspace_update`]
179#[derive(Debug, Clone, Serialize, Deserialize)]
180#[serde(untagged)]
181pub enum PropertymappingsProviderGoogleWorkspaceUpdateError {
182    Status400(models::ValidationError),
183    Status403(models::GenericError),
184    UnknownValue(serde_json::Value),
185}
186
187/// struct for typed errors of method [`propertymappings_provider_google_workspace_used_by_list`]
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(untagged)]
190pub enum PropertymappingsProviderGoogleWorkspaceUsedByListError {
191    Status400(models::ValidationError),
192    Status403(models::GenericError),
193    UnknownValue(serde_json::Value),
194}
195
196/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_create`]
197#[derive(Debug, Clone, Serialize, Deserialize)]
198#[serde(untagged)]
199pub enum PropertymappingsProviderMicrosoftEntraCreateError {
200    Status400(models::ValidationError),
201    Status403(models::GenericError),
202    UnknownValue(serde_json::Value),
203}
204
205/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_destroy`]
206#[derive(Debug, Clone, Serialize, Deserialize)]
207#[serde(untagged)]
208pub enum PropertymappingsProviderMicrosoftEntraDestroyError {
209    Status400(models::ValidationError),
210    Status403(models::GenericError),
211    UnknownValue(serde_json::Value),
212}
213
214/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_list`]
215#[derive(Debug, Clone, Serialize, Deserialize)]
216#[serde(untagged)]
217pub enum PropertymappingsProviderMicrosoftEntraListError {
218    Status400(models::ValidationError),
219    Status403(models::GenericError),
220    UnknownValue(serde_json::Value),
221}
222
223/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_partial_update`]
224#[derive(Debug, Clone, Serialize, Deserialize)]
225#[serde(untagged)]
226pub enum PropertymappingsProviderMicrosoftEntraPartialUpdateError {
227    Status400(models::ValidationError),
228    Status403(models::GenericError),
229    UnknownValue(serde_json::Value),
230}
231
232/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_retrieve`]
233#[derive(Debug, Clone, Serialize, Deserialize)]
234#[serde(untagged)]
235pub enum PropertymappingsProviderMicrosoftEntraRetrieveError {
236    Status400(models::ValidationError),
237    Status403(models::GenericError),
238    UnknownValue(serde_json::Value),
239}
240
241/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_update`]
242#[derive(Debug, Clone, Serialize, Deserialize)]
243#[serde(untagged)]
244pub enum PropertymappingsProviderMicrosoftEntraUpdateError {
245    Status400(models::ValidationError),
246    Status403(models::GenericError),
247    UnknownValue(serde_json::Value),
248}
249
250/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_used_by_list`]
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(untagged)]
253pub enum PropertymappingsProviderMicrosoftEntraUsedByListError {
254    Status400(models::ValidationError),
255    Status403(models::GenericError),
256    UnknownValue(serde_json::Value),
257}
258
259/// struct for typed errors of method [`propertymappings_provider_rac_create`]
260#[derive(Debug, Clone, Serialize, Deserialize)]
261#[serde(untagged)]
262pub enum PropertymappingsProviderRacCreateError {
263    Status400(models::ValidationError),
264    Status403(models::GenericError),
265    UnknownValue(serde_json::Value),
266}
267
268/// struct for typed errors of method [`propertymappings_provider_rac_destroy`]
269#[derive(Debug, Clone, Serialize, Deserialize)]
270#[serde(untagged)]
271pub enum PropertymappingsProviderRacDestroyError {
272    Status400(models::ValidationError),
273    Status403(models::GenericError),
274    UnknownValue(serde_json::Value),
275}
276
277/// struct for typed errors of method [`propertymappings_provider_rac_list`]
278#[derive(Debug, Clone, Serialize, Deserialize)]
279#[serde(untagged)]
280pub enum PropertymappingsProviderRacListError {
281    Status400(models::ValidationError),
282    Status403(models::GenericError),
283    UnknownValue(serde_json::Value),
284}
285
286/// struct for typed errors of method [`propertymappings_provider_rac_partial_update`]
287#[derive(Debug, Clone, Serialize, Deserialize)]
288#[serde(untagged)]
289pub enum PropertymappingsProviderRacPartialUpdateError {
290    Status400(models::ValidationError),
291    Status403(models::GenericError),
292    UnknownValue(serde_json::Value),
293}
294
295/// struct for typed errors of method [`propertymappings_provider_rac_retrieve`]
296#[derive(Debug, Clone, Serialize, Deserialize)]
297#[serde(untagged)]
298pub enum PropertymappingsProviderRacRetrieveError {
299    Status400(models::ValidationError),
300    Status403(models::GenericError),
301    UnknownValue(serde_json::Value),
302}
303
304/// struct for typed errors of method [`propertymappings_provider_rac_update`]
305#[derive(Debug, Clone, Serialize, Deserialize)]
306#[serde(untagged)]
307pub enum PropertymappingsProviderRacUpdateError {
308    Status400(models::ValidationError),
309    Status403(models::GenericError),
310    UnknownValue(serde_json::Value),
311}
312
313/// struct for typed errors of method [`propertymappings_provider_rac_used_by_list`]
314#[derive(Debug, Clone, Serialize, Deserialize)]
315#[serde(untagged)]
316pub enum PropertymappingsProviderRacUsedByListError {
317    Status400(models::ValidationError),
318    Status403(models::GenericError),
319    UnknownValue(serde_json::Value),
320}
321
322/// struct for typed errors of method [`propertymappings_provider_radius_create`]
323#[derive(Debug, Clone, Serialize, Deserialize)]
324#[serde(untagged)]
325pub enum PropertymappingsProviderRadiusCreateError {
326    Status400(models::ValidationError),
327    Status403(models::GenericError),
328    UnknownValue(serde_json::Value),
329}
330
331/// struct for typed errors of method [`propertymappings_provider_radius_destroy`]
332#[derive(Debug, Clone, Serialize, Deserialize)]
333#[serde(untagged)]
334pub enum PropertymappingsProviderRadiusDestroyError {
335    Status400(models::ValidationError),
336    Status403(models::GenericError),
337    UnknownValue(serde_json::Value),
338}
339
340/// struct for typed errors of method [`propertymappings_provider_radius_list`]
341#[derive(Debug, Clone, Serialize, Deserialize)]
342#[serde(untagged)]
343pub enum PropertymappingsProviderRadiusListError {
344    Status400(models::ValidationError),
345    Status403(models::GenericError),
346    UnknownValue(serde_json::Value),
347}
348
349/// struct for typed errors of method [`propertymappings_provider_radius_partial_update`]
350#[derive(Debug, Clone, Serialize, Deserialize)]
351#[serde(untagged)]
352pub enum PropertymappingsProviderRadiusPartialUpdateError {
353    Status400(models::ValidationError),
354    Status403(models::GenericError),
355    UnknownValue(serde_json::Value),
356}
357
358/// struct for typed errors of method [`propertymappings_provider_radius_retrieve`]
359#[derive(Debug, Clone, Serialize, Deserialize)]
360#[serde(untagged)]
361pub enum PropertymappingsProviderRadiusRetrieveError {
362    Status400(models::ValidationError),
363    Status403(models::GenericError),
364    UnknownValue(serde_json::Value),
365}
366
367/// struct for typed errors of method [`propertymappings_provider_radius_update`]
368#[derive(Debug, Clone, Serialize, Deserialize)]
369#[serde(untagged)]
370pub enum PropertymappingsProviderRadiusUpdateError {
371    Status400(models::ValidationError),
372    Status403(models::GenericError),
373    UnknownValue(serde_json::Value),
374}
375
376/// struct for typed errors of method [`propertymappings_provider_radius_used_by_list`]
377#[derive(Debug, Clone, Serialize, Deserialize)]
378#[serde(untagged)]
379pub enum PropertymappingsProviderRadiusUsedByListError {
380    Status400(models::ValidationError),
381    Status403(models::GenericError),
382    UnknownValue(serde_json::Value),
383}
384
385/// struct for typed errors of method [`propertymappings_provider_saml_create`]
386#[derive(Debug, Clone, Serialize, Deserialize)]
387#[serde(untagged)]
388pub enum PropertymappingsProviderSamlCreateError {
389    Status400(models::ValidationError),
390    Status403(models::GenericError),
391    UnknownValue(serde_json::Value),
392}
393
394/// struct for typed errors of method [`propertymappings_provider_saml_destroy`]
395#[derive(Debug, Clone, Serialize, Deserialize)]
396#[serde(untagged)]
397pub enum PropertymappingsProviderSamlDestroyError {
398    Status400(models::ValidationError),
399    Status403(models::GenericError),
400    UnknownValue(serde_json::Value),
401}
402
403/// struct for typed errors of method [`propertymappings_provider_saml_list`]
404#[derive(Debug, Clone, Serialize, Deserialize)]
405#[serde(untagged)]
406pub enum PropertymappingsProviderSamlListError {
407    Status400(models::ValidationError),
408    Status403(models::GenericError),
409    UnknownValue(serde_json::Value),
410}
411
412/// struct for typed errors of method [`propertymappings_provider_saml_partial_update`]
413#[derive(Debug, Clone, Serialize, Deserialize)]
414#[serde(untagged)]
415pub enum PropertymappingsProviderSamlPartialUpdateError {
416    Status400(models::ValidationError),
417    Status403(models::GenericError),
418    UnknownValue(serde_json::Value),
419}
420
421/// struct for typed errors of method [`propertymappings_provider_saml_retrieve`]
422#[derive(Debug, Clone, Serialize, Deserialize)]
423#[serde(untagged)]
424pub enum PropertymappingsProviderSamlRetrieveError {
425    Status400(models::ValidationError),
426    Status403(models::GenericError),
427    UnknownValue(serde_json::Value),
428}
429
430/// struct for typed errors of method [`propertymappings_provider_saml_update`]
431#[derive(Debug, Clone, Serialize, Deserialize)]
432#[serde(untagged)]
433pub enum PropertymappingsProviderSamlUpdateError {
434    Status400(models::ValidationError),
435    Status403(models::GenericError),
436    UnknownValue(serde_json::Value),
437}
438
439/// struct for typed errors of method [`propertymappings_provider_saml_used_by_list`]
440#[derive(Debug, Clone, Serialize, Deserialize)]
441#[serde(untagged)]
442pub enum PropertymappingsProviderSamlUsedByListError {
443    Status400(models::ValidationError),
444    Status403(models::GenericError),
445    UnknownValue(serde_json::Value),
446}
447
448/// struct for typed errors of method [`propertymappings_provider_scim_create`]
449#[derive(Debug, Clone, Serialize, Deserialize)]
450#[serde(untagged)]
451pub enum PropertymappingsProviderScimCreateError {
452    Status400(models::ValidationError),
453    Status403(models::GenericError),
454    UnknownValue(serde_json::Value),
455}
456
457/// struct for typed errors of method [`propertymappings_provider_scim_destroy`]
458#[derive(Debug, Clone, Serialize, Deserialize)]
459#[serde(untagged)]
460pub enum PropertymappingsProviderScimDestroyError {
461    Status400(models::ValidationError),
462    Status403(models::GenericError),
463    UnknownValue(serde_json::Value),
464}
465
466/// struct for typed errors of method [`propertymappings_provider_scim_list`]
467#[derive(Debug, Clone, Serialize, Deserialize)]
468#[serde(untagged)]
469pub enum PropertymappingsProviderScimListError {
470    Status400(models::ValidationError),
471    Status403(models::GenericError),
472    UnknownValue(serde_json::Value),
473}
474
475/// struct for typed errors of method [`propertymappings_provider_scim_partial_update`]
476#[derive(Debug, Clone, Serialize, Deserialize)]
477#[serde(untagged)]
478pub enum PropertymappingsProviderScimPartialUpdateError {
479    Status400(models::ValidationError),
480    Status403(models::GenericError),
481    UnknownValue(serde_json::Value),
482}
483
484/// struct for typed errors of method [`propertymappings_provider_scim_retrieve`]
485#[derive(Debug, Clone, Serialize, Deserialize)]
486#[serde(untagged)]
487pub enum PropertymappingsProviderScimRetrieveError {
488    Status400(models::ValidationError),
489    Status403(models::GenericError),
490    UnknownValue(serde_json::Value),
491}
492
493/// struct for typed errors of method [`propertymappings_provider_scim_update`]
494#[derive(Debug, Clone, Serialize, Deserialize)]
495#[serde(untagged)]
496pub enum PropertymappingsProviderScimUpdateError {
497    Status400(models::ValidationError),
498    Status403(models::GenericError),
499    UnknownValue(serde_json::Value),
500}
501
502/// struct for typed errors of method [`propertymappings_provider_scim_used_by_list`]
503#[derive(Debug, Clone, Serialize, Deserialize)]
504#[serde(untagged)]
505pub enum PropertymappingsProviderScimUsedByListError {
506    Status400(models::ValidationError),
507    Status403(models::GenericError),
508    UnknownValue(serde_json::Value),
509}
510
511/// struct for typed errors of method [`propertymappings_provider_scope_create`]
512#[derive(Debug, Clone, Serialize, Deserialize)]
513#[serde(untagged)]
514pub enum PropertymappingsProviderScopeCreateError {
515    Status400(models::ValidationError),
516    Status403(models::GenericError),
517    UnknownValue(serde_json::Value),
518}
519
520/// struct for typed errors of method [`propertymappings_provider_scope_destroy`]
521#[derive(Debug, Clone, Serialize, Deserialize)]
522#[serde(untagged)]
523pub enum PropertymappingsProviderScopeDestroyError {
524    Status400(models::ValidationError),
525    Status403(models::GenericError),
526    UnknownValue(serde_json::Value),
527}
528
529/// struct for typed errors of method [`propertymappings_provider_scope_list`]
530#[derive(Debug, Clone, Serialize, Deserialize)]
531#[serde(untagged)]
532pub enum PropertymappingsProviderScopeListError {
533    Status400(models::ValidationError),
534    Status403(models::GenericError),
535    UnknownValue(serde_json::Value),
536}
537
538/// struct for typed errors of method [`propertymappings_provider_scope_partial_update`]
539#[derive(Debug, Clone, Serialize, Deserialize)]
540#[serde(untagged)]
541pub enum PropertymappingsProviderScopePartialUpdateError {
542    Status400(models::ValidationError),
543    Status403(models::GenericError),
544    UnknownValue(serde_json::Value),
545}
546
547/// struct for typed errors of method [`propertymappings_provider_scope_retrieve`]
548#[derive(Debug, Clone, Serialize, Deserialize)]
549#[serde(untagged)]
550pub enum PropertymappingsProviderScopeRetrieveError {
551    Status400(models::ValidationError),
552    Status403(models::GenericError),
553    UnknownValue(serde_json::Value),
554}
555
556/// struct for typed errors of method [`propertymappings_provider_scope_update`]
557#[derive(Debug, Clone, Serialize, Deserialize)]
558#[serde(untagged)]
559pub enum PropertymappingsProviderScopeUpdateError {
560    Status400(models::ValidationError),
561    Status403(models::GenericError),
562    UnknownValue(serde_json::Value),
563}
564
565/// struct for typed errors of method [`propertymappings_provider_scope_used_by_list`]
566#[derive(Debug, Clone, Serialize, Deserialize)]
567#[serde(untagged)]
568pub enum PropertymappingsProviderScopeUsedByListError {
569    Status400(models::ValidationError),
570    Status403(models::GenericError),
571    UnknownValue(serde_json::Value),
572}
573
574/// struct for typed errors of method [`propertymappings_source_kerberos_create`]
575#[derive(Debug, Clone, Serialize, Deserialize)]
576#[serde(untagged)]
577pub enum PropertymappingsSourceKerberosCreateError {
578    Status400(models::ValidationError),
579    Status403(models::GenericError),
580    UnknownValue(serde_json::Value),
581}
582
583/// struct for typed errors of method [`propertymappings_source_kerberos_destroy`]
584#[derive(Debug, Clone, Serialize, Deserialize)]
585#[serde(untagged)]
586pub enum PropertymappingsSourceKerberosDestroyError {
587    Status400(models::ValidationError),
588    Status403(models::GenericError),
589    UnknownValue(serde_json::Value),
590}
591
592/// struct for typed errors of method [`propertymappings_source_kerberos_list`]
593#[derive(Debug, Clone, Serialize, Deserialize)]
594#[serde(untagged)]
595pub enum PropertymappingsSourceKerberosListError {
596    Status400(models::ValidationError),
597    Status403(models::GenericError),
598    UnknownValue(serde_json::Value),
599}
600
601/// struct for typed errors of method [`propertymappings_source_kerberos_partial_update`]
602#[derive(Debug, Clone, Serialize, Deserialize)]
603#[serde(untagged)]
604pub enum PropertymappingsSourceKerberosPartialUpdateError {
605    Status400(models::ValidationError),
606    Status403(models::GenericError),
607    UnknownValue(serde_json::Value),
608}
609
610/// struct for typed errors of method [`propertymappings_source_kerberos_retrieve`]
611#[derive(Debug, Clone, Serialize, Deserialize)]
612#[serde(untagged)]
613pub enum PropertymappingsSourceKerberosRetrieveError {
614    Status400(models::ValidationError),
615    Status403(models::GenericError),
616    UnknownValue(serde_json::Value),
617}
618
619/// struct for typed errors of method [`propertymappings_source_kerberos_update`]
620#[derive(Debug, Clone, Serialize, Deserialize)]
621#[serde(untagged)]
622pub enum PropertymappingsSourceKerberosUpdateError {
623    Status400(models::ValidationError),
624    Status403(models::GenericError),
625    UnknownValue(serde_json::Value),
626}
627
628/// struct for typed errors of method [`propertymappings_source_kerberos_used_by_list`]
629#[derive(Debug, Clone, Serialize, Deserialize)]
630#[serde(untagged)]
631pub enum PropertymappingsSourceKerberosUsedByListError {
632    Status400(models::ValidationError),
633    Status403(models::GenericError),
634    UnknownValue(serde_json::Value),
635}
636
637/// struct for typed errors of method [`propertymappings_source_ldap_create`]
638#[derive(Debug, Clone, Serialize, Deserialize)]
639#[serde(untagged)]
640pub enum PropertymappingsSourceLdapCreateError {
641    Status400(models::ValidationError),
642    Status403(models::GenericError),
643    UnknownValue(serde_json::Value),
644}
645
646/// struct for typed errors of method [`propertymappings_source_ldap_destroy`]
647#[derive(Debug, Clone, Serialize, Deserialize)]
648#[serde(untagged)]
649pub enum PropertymappingsSourceLdapDestroyError {
650    Status400(models::ValidationError),
651    Status403(models::GenericError),
652    UnknownValue(serde_json::Value),
653}
654
655/// struct for typed errors of method [`propertymappings_source_ldap_list`]
656#[derive(Debug, Clone, Serialize, Deserialize)]
657#[serde(untagged)]
658pub enum PropertymappingsSourceLdapListError {
659    Status400(models::ValidationError),
660    Status403(models::GenericError),
661    UnknownValue(serde_json::Value),
662}
663
664/// struct for typed errors of method [`propertymappings_source_ldap_partial_update`]
665#[derive(Debug, Clone, Serialize, Deserialize)]
666#[serde(untagged)]
667pub enum PropertymappingsSourceLdapPartialUpdateError {
668    Status400(models::ValidationError),
669    Status403(models::GenericError),
670    UnknownValue(serde_json::Value),
671}
672
673/// struct for typed errors of method [`propertymappings_source_ldap_retrieve`]
674#[derive(Debug, Clone, Serialize, Deserialize)]
675#[serde(untagged)]
676pub enum PropertymappingsSourceLdapRetrieveError {
677    Status400(models::ValidationError),
678    Status403(models::GenericError),
679    UnknownValue(serde_json::Value),
680}
681
682/// struct for typed errors of method [`propertymappings_source_ldap_update`]
683#[derive(Debug, Clone, Serialize, Deserialize)]
684#[serde(untagged)]
685pub enum PropertymappingsSourceLdapUpdateError {
686    Status400(models::ValidationError),
687    Status403(models::GenericError),
688    UnknownValue(serde_json::Value),
689}
690
691/// struct for typed errors of method [`propertymappings_source_ldap_used_by_list`]
692#[derive(Debug, Clone, Serialize, Deserialize)]
693#[serde(untagged)]
694pub enum PropertymappingsSourceLdapUsedByListError {
695    Status400(models::ValidationError),
696    Status403(models::GenericError),
697    UnknownValue(serde_json::Value),
698}
699
700/// struct for typed errors of method [`propertymappings_source_oauth_create`]
701#[derive(Debug, Clone, Serialize, Deserialize)]
702#[serde(untagged)]
703pub enum PropertymappingsSourceOauthCreateError {
704    Status400(models::ValidationError),
705    Status403(models::GenericError),
706    UnknownValue(serde_json::Value),
707}
708
709/// struct for typed errors of method [`propertymappings_source_oauth_destroy`]
710#[derive(Debug, Clone, Serialize, Deserialize)]
711#[serde(untagged)]
712pub enum PropertymappingsSourceOauthDestroyError {
713    Status400(models::ValidationError),
714    Status403(models::GenericError),
715    UnknownValue(serde_json::Value),
716}
717
718/// struct for typed errors of method [`propertymappings_source_oauth_list`]
719#[derive(Debug, Clone, Serialize, Deserialize)]
720#[serde(untagged)]
721pub enum PropertymappingsSourceOauthListError {
722    Status400(models::ValidationError),
723    Status403(models::GenericError),
724    UnknownValue(serde_json::Value),
725}
726
727/// struct for typed errors of method [`propertymappings_source_oauth_partial_update`]
728#[derive(Debug, Clone, Serialize, Deserialize)]
729#[serde(untagged)]
730pub enum PropertymappingsSourceOauthPartialUpdateError {
731    Status400(models::ValidationError),
732    Status403(models::GenericError),
733    UnknownValue(serde_json::Value),
734}
735
736/// struct for typed errors of method [`propertymappings_source_oauth_retrieve`]
737#[derive(Debug, Clone, Serialize, Deserialize)]
738#[serde(untagged)]
739pub enum PropertymappingsSourceOauthRetrieveError {
740    Status400(models::ValidationError),
741    Status403(models::GenericError),
742    UnknownValue(serde_json::Value),
743}
744
745/// struct for typed errors of method [`propertymappings_source_oauth_update`]
746#[derive(Debug, Clone, Serialize, Deserialize)]
747#[serde(untagged)]
748pub enum PropertymappingsSourceOauthUpdateError {
749    Status400(models::ValidationError),
750    Status403(models::GenericError),
751    UnknownValue(serde_json::Value),
752}
753
754/// struct for typed errors of method [`propertymappings_source_oauth_used_by_list`]
755#[derive(Debug, Clone, Serialize, Deserialize)]
756#[serde(untagged)]
757pub enum PropertymappingsSourceOauthUsedByListError {
758    Status400(models::ValidationError),
759    Status403(models::GenericError),
760    UnknownValue(serde_json::Value),
761}
762
763/// struct for typed errors of method [`propertymappings_source_plex_create`]
764#[derive(Debug, Clone, Serialize, Deserialize)]
765#[serde(untagged)]
766pub enum PropertymappingsSourcePlexCreateError {
767    Status400(models::ValidationError),
768    Status403(models::GenericError),
769    UnknownValue(serde_json::Value),
770}
771
772/// struct for typed errors of method [`propertymappings_source_plex_destroy`]
773#[derive(Debug, Clone, Serialize, Deserialize)]
774#[serde(untagged)]
775pub enum PropertymappingsSourcePlexDestroyError {
776    Status400(models::ValidationError),
777    Status403(models::GenericError),
778    UnknownValue(serde_json::Value),
779}
780
781/// struct for typed errors of method [`propertymappings_source_plex_list`]
782#[derive(Debug, Clone, Serialize, Deserialize)]
783#[serde(untagged)]
784pub enum PropertymappingsSourcePlexListError {
785    Status400(models::ValidationError),
786    Status403(models::GenericError),
787    UnknownValue(serde_json::Value),
788}
789
790/// struct for typed errors of method [`propertymappings_source_plex_partial_update`]
791#[derive(Debug, Clone, Serialize, Deserialize)]
792#[serde(untagged)]
793pub enum PropertymappingsSourcePlexPartialUpdateError {
794    Status400(models::ValidationError),
795    Status403(models::GenericError),
796    UnknownValue(serde_json::Value),
797}
798
799/// struct for typed errors of method [`propertymappings_source_plex_retrieve`]
800#[derive(Debug, Clone, Serialize, Deserialize)]
801#[serde(untagged)]
802pub enum PropertymappingsSourcePlexRetrieveError {
803    Status400(models::ValidationError),
804    Status403(models::GenericError),
805    UnknownValue(serde_json::Value),
806}
807
808/// struct for typed errors of method [`propertymappings_source_plex_update`]
809#[derive(Debug, Clone, Serialize, Deserialize)]
810#[serde(untagged)]
811pub enum PropertymappingsSourcePlexUpdateError {
812    Status400(models::ValidationError),
813    Status403(models::GenericError),
814    UnknownValue(serde_json::Value),
815}
816
817/// struct for typed errors of method [`propertymappings_source_plex_used_by_list`]
818#[derive(Debug, Clone, Serialize, Deserialize)]
819#[serde(untagged)]
820pub enum PropertymappingsSourcePlexUsedByListError {
821    Status400(models::ValidationError),
822    Status403(models::GenericError),
823    UnknownValue(serde_json::Value),
824}
825
826/// struct for typed errors of method [`propertymappings_source_saml_create`]
827#[derive(Debug, Clone, Serialize, Deserialize)]
828#[serde(untagged)]
829pub enum PropertymappingsSourceSamlCreateError {
830    Status400(models::ValidationError),
831    Status403(models::GenericError),
832    UnknownValue(serde_json::Value),
833}
834
835/// struct for typed errors of method [`propertymappings_source_saml_destroy`]
836#[derive(Debug, Clone, Serialize, Deserialize)]
837#[serde(untagged)]
838pub enum PropertymappingsSourceSamlDestroyError {
839    Status400(models::ValidationError),
840    Status403(models::GenericError),
841    UnknownValue(serde_json::Value),
842}
843
844/// struct for typed errors of method [`propertymappings_source_saml_list`]
845#[derive(Debug, Clone, Serialize, Deserialize)]
846#[serde(untagged)]
847pub enum PropertymappingsSourceSamlListError {
848    Status400(models::ValidationError),
849    Status403(models::GenericError),
850    UnknownValue(serde_json::Value),
851}
852
853/// struct for typed errors of method [`propertymappings_source_saml_partial_update`]
854#[derive(Debug, Clone, Serialize, Deserialize)]
855#[serde(untagged)]
856pub enum PropertymappingsSourceSamlPartialUpdateError {
857    Status400(models::ValidationError),
858    Status403(models::GenericError),
859    UnknownValue(serde_json::Value),
860}
861
862/// struct for typed errors of method [`propertymappings_source_saml_retrieve`]
863#[derive(Debug, Clone, Serialize, Deserialize)]
864#[serde(untagged)]
865pub enum PropertymappingsSourceSamlRetrieveError {
866    Status400(models::ValidationError),
867    Status403(models::GenericError),
868    UnknownValue(serde_json::Value),
869}
870
871/// struct for typed errors of method [`propertymappings_source_saml_update`]
872#[derive(Debug, Clone, Serialize, Deserialize)]
873#[serde(untagged)]
874pub enum PropertymappingsSourceSamlUpdateError {
875    Status400(models::ValidationError),
876    Status403(models::GenericError),
877    UnknownValue(serde_json::Value),
878}
879
880/// struct for typed errors of method [`propertymappings_source_saml_used_by_list`]
881#[derive(Debug, Clone, Serialize, Deserialize)]
882#[serde(untagged)]
883pub enum PropertymappingsSourceSamlUsedByListError {
884    Status400(models::ValidationError),
885    Status403(models::GenericError),
886    UnknownValue(serde_json::Value),
887}
888
889/// struct for typed errors of method [`propertymappings_source_scim_create`]
890#[derive(Debug, Clone, Serialize, Deserialize)]
891#[serde(untagged)]
892pub enum PropertymappingsSourceScimCreateError {
893    Status400(models::ValidationError),
894    Status403(models::GenericError),
895    UnknownValue(serde_json::Value),
896}
897
898/// struct for typed errors of method [`propertymappings_source_scim_destroy`]
899#[derive(Debug, Clone, Serialize, Deserialize)]
900#[serde(untagged)]
901pub enum PropertymappingsSourceScimDestroyError {
902    Status400(models::ValidationError),
903    Status403(models::GenericError),
904    UnknownValue(serde_json::Value),
905}
906
907/// struct for typed errors of method [`propertymappings_source_scim_list`]
908#[derive(Debug, Clone, Serialize, Deserialize)]
909#[serde(untagged)]
910pub enum PropertymappingsSourceScimListError {
911    Status400(models::ValidationError),
912    Status403(models::GenericError),
913    UnknownValue(serde_json::Value),
914}
915
916/// struct for typed errors of method [`propertymappings_source_scim_partial_update`]
917#[derive(Debug, Clone, Serialize, Deserialize)]
918#[serde(untagged)]
919pub enum PropertymappingsSourceScimPartialUpdateError {
920    Status400(models::ValidationError),
921    Status403(models::GenericError),
922    UnknownValue(serde_json::Value),
923}
924
925/// struct for typed errors of method [`propertymappings_source_scim_retrieve`]
926#[derive(Debug, Clone, Serialize, Deserialize)]
927#[serde(untagged)]
928pub enum PropertymappingsSourceScimRetrieveError {
929    Status400(models::ValidationError),
930    Status403(models::GenericError),
931    UnknownValue(serde_json::Value),
932}
933
934/// struct for typed errors of method [`propertymappings_source_scim_update`]
935#[derive(Debug, Clone, Serialize, Deserialize)]
936#[serde(untagged)]
937pub enum PropertymappingsSourceScimUpdateError {
938    Status400(models::ValidationError),
939    Status403(models::GenericError),
940    UnknownValue(serde_json::Value),
941}
942
943/// struct for typed errors of method [`propertymappings_source_scim_used_by_list`]
944#[derive(Debug, Clone, Serialize, Deserialize)]
945#[serde(untagged)]
946pub enum PropertymappingsSourceScimUsedByListError {
947    Status400(models::ValidationError),
948    Status403(models::GenericError),
949    UnknownValue(serde_json::Value),
950}
951
952/// struct for typed errors of method [`propertymappings_source_telegram_create`]
953#[derive(Debug, Clone, Serialize, Deserialize)]
954#[serde(untagged)]
955pub enum PropertymappingsSourceTelegramCreateError {
956    Status400(models::ValidationError),
957    Status403(models::GenericError),
958    UnknownValue(serde_json::Value),
959}
960
961/// struct for typed errors of method [`propertymappings_source_telegram_destroy`]
962#[derive(Debug, Clone, Serialize, Deserialize)]
963#[serde(untagged)]
964pub enum PropertymappingsSourceTelegramDestroyError {
965    Status400(models::ValidationError),
966    Status403(models::GenericError),
967    UnknownValue(serde_json::Value),
968}
969
970/// struct for typed errors of method [`propertymappings_source_telegram_list`]
971#[derive(Debug, Clone, Serialize, Deserialize)]
972#[serde(untagged)]
973pub enum PropertymappingsSourceTelegramListError {
974    Status400(models::ValidationError),
975    Status403(models::GenericError),
976    UnknownValue(serde_json::Value),
977}
978
979/// struct for typed errors of method [`propertymappings_source_telegram_partial_update`]
980#[derive(Debug, Clone, Serialize, Deserialize)]
981#[serde(untagged)]
982pub enum PropertymappingsSourceTelegramPartialUpdateError {
983    Status400(models::ValidationError),
984    Status403(models::GenericError),
985    UnknownValue(serde_json::Value),
986}
987
988/// struct for typed errors of method [`propertymappings_source_telegram_retrieve`]
989#[derive(Debug, Clone, Serialize, Deserialize)]
990#[serde(untagged)]
991pub enum PropertymappingsSourceTelegramRetrieveError {
992    Status400(models::ValidationError),
993    Status403(models::GenericError),
994    UnknownValue(serde_json::Value),
995}
996
997/// struct for typed errors of method [`propertymappings_source_telegram_update`]
998#[derive(Debug, Clone, Serialize, Deserialize)]
999#[serde(untagged)]
1000pub enum PropertymappingsSourceTelegramUpdateError {
1001    Status400(models::ValidationError),
1002    Status403(models::GenericError),
1003    UnknownValue(serde_json::Value),
1004}
1005
1006/// struct for typed errors of method [`propertymappings_source_telegram_used_by_list`]
1007#[derive(Debug, Clone, Serialize, Deserialize)]
1008#[serde(untagged)]
1009pub enum PropertymappingsSourceTelegramUsedByListError {
1010    Status400(models::ValidationError),
1011    Status403(models::GenericError),
1012    UnknownValue(serde_json::Value),
1013}
1014
1015/// PropertyMapping Viewset
1016pub async fn propertymappings_all_destroy(
1017    configuration: &configuration::Configuration,
1018    pm_uuid: &str,
1019) -> Result<(), Error<PropertymappingsAllDestroyError>> {
1020    // add a prefix to parameters to efficiently prevent name collisions
1021    let p_path_pm_uuid = pm_uuid;
1022
1023    let uri_str = format!(
1024        "{}/propertymappings/all/{pm_uuid}/",
1025        configuration.base_path,
1026        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1027    );
1028    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1029
1030    if let Some(ref user_agent) = configuration.user_agent {
1031        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1032    }
1033    if let Some(ref token) = configuration.bearer_access_token {
1034        req_builder = req_builder.bearer_auth(token.to_owned());
1035    };
1036
1037    let req = req_builder.build()?;
1038    let resp = configuration.client.execute(req).await?;
1039
1040    let status = resp.status();
1041
1042    if !status.is_client_error() && !status.is_server_error() {
1043        Ok(())
1044    } else {
1045        let content = resp.text().await?;
1046        let entity: Option<PropertymappingsAllDestroyError> = serde_json::from_str(&content).ok();
1047        Err(Error::ResponseError(ResponseContent {
1048            status,
1049            content,
1050            entity,
1051        }))
1052    }
1053}
1054
1055/// PropertyMapping Viewset
1056pub async fn propertymappings_all_list(
1057    configuration: &configuration::Configuration,
1058    managed: Option<Vec<String>>,
1059    managed__isnull: Option<bool>,
1060    name: Option<&str>,
1061    ordering: Option<&str>,
1062    page: Option<i32>,
1063    page_size: Option<i32>,
1064    search: Option<&str>,
1065) -> Result<models::PaginatedPropertyMappingList, Error<PropertymappingsAllListError>> {
1066    // add a prefix to parameters to efficiently prevent name collisions
1067    let p_query_managed = managed;
1068    let p_query_managed__isnull = managed__isnull;
1069    let p_query_name = name;
1070    let p_query_ordering = ordering;
1071    let p_query_page = page;
1072    let p_query_page_size = page_size;
1073    let p_query_search = search;
1074
1075    let uri_str = format!("{}/propertymappings/all/", configuration.base_path);
1076    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1077
1078    if let Some(ref param_value) = p_query_managed {
1079        req_builder = match "multi" {
1080            "multi" => req_builder.query(
1081                &param_value
1082                    .into_iter()
1083                    .map(|p| ("managed".to_owned(), p.to_string()))
1084                    .collect::<Vec<(std::string::String, std::string::String)>>(),
1085            ),
1086            _ => req_builder.query(&[(
1087                "managed",
1088                &param_value
1089                    .into_iter()
1090                    .map(|p| p.to_string())
1091                    .collect::<Vec<String>>()
1092                    .join(",")
1093                    .to_string(),
1094            )]),
1095        };
1096    }
1097    if let Some(ref param_value) = p_query_managed__isnull {
1098        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
1099    }
1100    if let Some(ref param_value) = p_query_name {
1101        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
1102    }
1103    if let Some(ref param_value) = p_query_ordering {
1104        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1105    }
1106    if let Some(ref param_value) = p_query_page {
1107        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1108    }
1109    if let Some(ref param_value) = p_query_page_size {
1110        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1111    }
1112    if let Some(ref param_value) = p_query_search {
1113        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1114    }
1115    if let Some(ref user_agent) = configuration.user_agent {
1116        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1117    }
1118    if let Some(ref token) = configuration.bearer_access_token {
1119        req_builder = req_builder.bearer_auth(token.to_owned());
1120    };
1121
1122    let req = req_builder.build()?;
1123    let resp = configuration.client.execute(req).await?;
1124
1125    let status = resp.status();
1126    let content_type = resp
1127        .headers()
1128        .get("content-type")
1129        .and_then(|v| v.to_str().ok())
1130        .unwrap_or("application/octet-stream");
1131    let content_type = super::ContentType::from(content_type);
1132
1133    if !status.is_client_error() && !status.is_server_error() {
1134        let content = resp.text().await?;
1135        match content_type {
1136            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1137            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPropertyMappingList`"))),
1138            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::PaginatedPropertyMappingList`")))),
1139        }
1140    } else {
1141        let content = resp.text().await?;
1142        let entity: Option<PropertymappingsAllListError> = serde_json::from_str(&content).ok();
1143        Err(Error::ResponseError(ResponseContent {
1144            status,
1145            content,
1146            entity,
1147        }))
1148    }
1149}
1150
1151/// PropertyMapping Viewset
1152pub async fn propertymappings_all_retrieve(
1153    configuration: &configuration::Configuration,
1154    pm_uuid: &str,
1155) -> Result<models::PropertyMapping, Error<PropertymappingsAllRetrieveError>> {
1156    // add a prefix to parameters to efficiently prevent name collisions
1157    let p_path_pm_uuid = pm_uuid;
1158
1159    let uri_str = format!(
1160        "{}/propertymappings/all/{pm_uuid}/",
1161        configuration.base_path,
1162        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1163    );
1164    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1165
1166    if let Some(ref user_agent) = configuration.user_agent {
1167        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1168    }
1169    if let Some(ref token) = configuration.bearer_access_token {
1170        req_builder = req_builder.bearer_auth(token.to_owned());
1171    };
1172
1173    let req = req_builder.build()?;
1174    let resp = configuration.client.execute(req).await?;
1175
1176    let status = resp.status();
1177    let content_type = resp
1178        .headers()
1179        .get("content-type")
1180        .and_then(|v| v.to_str().ok())
1181        .unwrap_or("application/octet-stream");
1182    let content_type = super::ContentType::from(content_type);
1183
1184    if !status.is_client_error() && !status.is_server_error() {
1185        let content = resp.text().await?;
1186        match content_type {
1187            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1188            ContentType::Text => {
1189                return Err(Error::from(serde_json::Error::custom(
1190                    "Received `text/plain` content type response that cannot be converted to `models::PropertyMapping`",
1191                )))
1192            }
1193            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
1194                "Received `{unknown_type}` content type response that cannot be converted to `models::PropertyMapping`"
1195            )))),
1196        }
1197    } else {
1198        let content = resp.text().await?;
1199        let entity: Option<PropertymappingsAllRetrieveError> = serde_json::from_str(&content).ok();
1200        Err(Error::ResponseError(ResponseContent {
1201            status,
1202            content,
1203            entity,
1204        }))
1205    }
1206}
1207
1208/// Test Property Mapping
1209pub async fn propertymappings_all_test_create(
1210    configuration: &configuration::Configuration,
1211    pm_uuid: &str,
1212    format_result: Option<bool>,
1213    property_mapping_test_request: Option<models::PropertyMappingTestRequest>,
1214) -> Result<models::PropertyMappingTestResult, Error<PropertymappingsAllTestCreateError>> {
1215    // add a prefix to parameters to efficiently prevent name collisions
1216    let p_path_pm_uuid = pm_uuid;
1217    let p_query_format_result = format_result;
1218    let p_body_property_mapping_test_request = property_mapping_test_request;
1219
1220    let uri_str = format!(
1221        "{}/propertymappings/all/{pm_uuid}/test/",
1222        configuration.base_path,
1223        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1224    );
1225    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1226
1227    if let Some(ref param_value) = p_query_format_result {
1228        req_builder = req_builder.query(&[("format_result", &param_value.to_string())]);
1229    }
1230    if let Some(ref user_agent) = configuration.user_agent {
1231        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1232    }
1233    if let Some(ref token) = configuration.bearer_access_token {
1234        req_builder = req_builder.bearer_auth(token.to_owned());
1235    };
1236    req_builder = req_builder.json(&p_body_property_mapping_test_request);
1237
1238    let req = req_builder.build()?;
1239    let resp = configuration.client.execute(req).await?;
1240
1241    let status = resp.status();
1242    let content_type = resp
1243        .headers()
1244        .get("content-type")
1245        .and_then(|v| v.to_str().ok())
1246        .unwrap_or("application/octet-stream");
1247    let content_type = super::ContentType::from(content_type);
1248
1249    if !status.is_client_error() && !status.is_server_error() {
1250        let content = resp.text().await?;
1251        match content_type {
1252            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1253            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PropertyMappingTestResult`"))),
1254            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::PropertyMappingTestResult`")))),
1255        }
1256    } else {
1257        let content = resp.text().await?;
1258        let entity: Option<PropertymappingsAllTestCreateError> = serde_json::from_str(&content).ok();
1259        Err(Error::ResponseError(ResponseContent {
1260            status,
1261            content,
1262            entity,
1263        }))
1264    }
1265}
1266
1267/// Get all creatable types
1268pub async fn propertymappings_all_types_list(
1269    configuration: &configuration::Configuration,
1270) -> Result<Vec<models::TypeCreate>, Error<PropertymappingsAllTypesListError>> {
1271    let uri_str = format!("{}/propertymappings/all/types/", configuration.base_path);
1272    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1273
1274    if let Some(ref user_agent) = configuration.user_agent {
1275        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1276    }
1277    if let Some(ref token) = configuration.bearer_access_token {
1278        req_builder = req_builder.bearer_auth(token.to_owned());
1279    };
1280
1281    let req = req_builder.build()?;
1282    let resp = configuration.client.execute(req).await?;
1283
1284    let status = resp.status();
1285    let content_type = resp
1286        .headers()
1287        .get("content-type")
1288        .and_then(|v| v.to_str().ok())
1289        .unwrap_or("application/octet-stream");
1290    let content_type = super::ContentType::from(content_type);
1291
1292    if !status.is_client_error() && !status.is_server_error() {
1293        let content = resp.text().await?;
1294        match content_type {
1295            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1296            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::TypeCreate&gt;`"))),
1297            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::TypeCreate&gt;`")))),
1298        }
1299    } else {
1300        let content = resp.text().await?;
1301        let entity: Option<PropertymappingsAllTypesListError> = serde_json::from_str(&content).ok();
1302        Err(Error::ResponseError(ResponseContent {
1303            status,
1304            content,
1305            entity,
1306        }))
1307    }
1308}
1309
1310/// Get a list of all objects that use this object
1311pub async fn propertymappings_all_used_by_list(
1312    configuration: &configuration::Configuration,
1313    pm_uuid: &str,
1314) -> Result<Vec<models::UsedBy>, Error<PropertymappingsAllUsedByListError>> {
1315    // add a prefix to parameters to efficiently prevent name collisions
1316    let p_path_pm_uuid = pm_uuid;
1317
1318    let uri_str = format!(
1319        "{}/propertymappings/all/{pm_uuid}/used_by/",
1320        configuration.base_path,
1321        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1322    );
1323    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1324
1325    if let Some(ref user_agent) = configuration.user_agent {
1326        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1327    }
1328    if let Some(ref token) = configuration.bearer_access_token {
1329        req_builder = req_builder.bearer_auth(token.to_owned());
1330    };
1331
1332    let req = req_builder.build()?;
1333    let resp = configuration.client.execute(req).await?;
1334
1335    let status = resp.status();
1336    let content_type = resp
1337        .headers()
1338        .get("content-type")
1339        .and_then(|v| v.to_str().ok())
1340        .unwrap_or("application/octet-stream");
1341    let content_type = super::ContentType::from(content_type);
1342
1343    if !status.is_client_error() && !status.is_server_error() {
1344        let content = resp.text().await?;
1345        match content_type {
1346            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1347            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
1348            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
1349        }
1350    } else {
1351        let content = resp.text().await?;
1352        let entity: Option<PropertymappingsAllUsedByListError> = serde_json::from_str(&content).ok();
1353        Err(Error::ResponseError(ResponseContent {
1354            status,
1355            content,
1356            entity,
1357        }))
1358    }
1359}
1360
1361/// NotificationWebhookMapping Viewset
1362pub async fn propertymappings_notification_create(
1363    configuration: &configuration::Configuration,
1364    notification_webhook_mapping_request: models::NotificationWebhookMappingRequest,
1365) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationCreateError>> {
1366    // add a prefix to parameters to efficiently prevent name collisions
1367    let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request;
1368
1369    let uri_str = format!("{}/propertymappings/notification/", configuration.base_path);
1370    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1371
1372    if let Some(ref user_agent) = configuration.user_agent {
1373        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1374    }
1375    if let Some(ref token) = configuration.bearer_access_token {
1376        req_builder = req_builder.bearer_auth(token.to_owned());
1377    };
1378    req_builder = req_builder.json(&p_body_notification_webhook_mapping_request);
1379
1380    let req = req_builder.build()?;
1381    let resp = configuration.client.execute(req).await?;
1382
1383    let status = resp.status();
1384    let content_type = resp
1385        .headers()
1386        .get("content-type")
1387        .and_then(|v| v.to_str().ok())
1388        .unwrap_or("application/octet-stream");
1389    let content_type = super::ContentType::from(content_type);
1390
1391    if !status.is_client_error() && !status.is_server_error() {
1392        let content = resp.text().await?;
1393        match content_type {
1394            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1395            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
1396            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::NotificationWebhookMapping`")))),
1397        }
1398    } else {
1399        let content = resp.text().await?;
1400        let entity: Option<PropertymappingsNotificationCreateError> = serde_json::from_str(&content).ok();
1401        Err(Error::ResponseError(ResponseContent {
1402            status,
1403            content,
1404            entity,
1405        }))
1406    }
1407}
1408
1409/// NotificationWebhookMapping Viewset
1410pub async fn propertymappings_notification_destroy(
1411    configuration: &configuration::Configuration,
1412    pm_uuid: &str,
1413) -> Result<(), Error<PropertymappingsNotificationDestroyError>> {
1414    // add a prefix to parameters to efficiently prevent name collisions
1415    let p_path_pm_uuid = pm_uuid;
1416
1417    let uri_str = format!(
1418        "{}/propertymappings/notification/{pm_uuid}/",
1419        configuration.base_path,
1420        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1421    );
1422    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1423
1424    if let Some(ref user_agent) = configuration.user_agent {
1425        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1426    }
1427    if let Some(ref token) = configuration.bearer_access_token {
1428        req_builder = req_builder.bearer_auth(token.to_owned());
1429    };
1430
1431    let req = req_builder.build()?;
1432    let resp = configuration.client.execute(req).await?;
1433
1434    let status = resp.status();
1435
1436    if !status.is_client_error() && !status.is_server_error() {
1437        Ok(())
1438    } else {
1439        let content = resp.text().await?;
1440        let entity: Option<PropertymappingsNotificationDestroyError> = serde_json::from_str(&content).ok();
1441        Err(Error::ResponseError(ResponseContent {
1442            status,
1443            content,
1444            entity,
1445        }))
1446    }
1447}
1448
1449/// NotificationWebhookMapping Viewset
1450pub async fn propertymappings_notification_list(
1451    configuration: &configuration::Configuration,
1452    name: Option<&str>,
1453    ordering: Option<&str>,
1454    page: Option<i32>,
1455    page_size: Option<i32>,
1456    search: Option<&str>,
1457) -> Result<models::PaginatedNotificationWebhookMappingList, Error<PropertymappingsNotificationListError>> {
1458    // add a prefix to parameters to efficiently prevent name collisions
1459    let p_query_name = name;
1460    let p_query_ordering = ordering;
1461    let p_query_page = page;
1462    let p_query_page_size = page_size;
1463    let p_query_search = search;
1464
1465    let uri_str = format!("{}/propertymappings/notification/", configuration.base_path);
1466    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1467
1468    if let Some(ref param_value) = p_query_name {
1469        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
1470    }
1471    if let Some(ref param_value) = p_query_ordering {
1472        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1473    }
1474    if let Some(ref param_value) = p_query_page {
1475        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1476    }
1477    if let Some(ref param_value) = p_query_page_size {
1478        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1479    }
1480    if let Some(ref param_value) = p_query_search {
1481        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1482    }
1483    if let Some(ref user_agent) = configuration.user_agent {
1484        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1485    }
1486    if let Some(ref token) = configuration.bearer_access_token {
1487        req_builder = req_builder.bearer_auth(token.to_owned());
1488    };
1489
1490    let req = req_builder.build()?;
1491    let resp = configuration.client.execute(req).await?;
1492
1493    let status = resp.status();
1494    let content_type = resp
1495        .headers()
1496        .get("content-type")
1497        .and_then(|v| v.to_str().ok())
1498        .unwrap_or("application/octet-stream");
1499    let content_type = super::ContentType::from(content_type);
1500
1501    if !status.is_client_error() && !status.is_server_error() {
1502        let content = resp.text().await?;
1503        match content_type {
1504            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1505            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedNotificationWebhookMappingList`"))),
1506            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::PaginatedNotificationWebhookMappingList`")))),
1507        }
1508    } else {
1509        let content = resp.text().await?;
1510        let entity: Option<PropertymappingsNotificationListError> = serde_json::from_str(&content).ok();
1511        Err(Error::ResponseError(ResponseContent {
1512            status,
1513            content,
1514            entity,
1515        }))
1516    }
1517}
1518
1519/// NotificationWebhookMapping Viewset
1520pub async fn propertymappings_notification_partial_update(
1521    configuration: &configuration::Configuration,
1522    pm_uuid: &str,
1523    patched_notification_webhook_mapping_request: Option<models::PatchedNotificationWebhookMappingRequest>,
1524) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationPartialUpdateError>> {
1525    // add a prefix to parameters to efficiently prevent name collisions
1526    let p_path_pm_uuid = pm_uuid;
1527    let p_body_patched_notification_webhook_mapping_request = patched_notification_webhook_mapping_request;
1528
1529    let uri_str = format!(
1530        "{}/propertymappings/notification/{pm_uuid}/",
1531        configuration.base_path,
1532        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1533    );
1534    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
1535
1536    if let Some(ref user_agent) = configuration.user_agent {
1537        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1538    }
1539    if let Some(ref token) = configuration.bearer_access_token {
1540        req_builder = req_builder.bearer_auth(token.to_owned());
1541    };
1542    req_builder = req_builder.json(&p_body_patched_notification_webhook_mapping_request);
1543
1544    let req = req_builder.build()?;
1545    let resp = configuration.client.execute(req).await?;
1546
1547    let status = resp.status();
1548    let content_type = resp
1549        .headers()
1550        .get("content-type")
1551        .and_then(|v| v.to_str().ok())
1552        .unwrap_or("application/octet-stream");
1553    let content_type = super::ContentType::from(content_type);
1554
1555    if !status.is_client_error() && !status.is_server_error() {
1556        let content = resp.text().await?;
1557        match content_type {
1558            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1559            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
1560            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::NotificationWebhookMapping`")))),
1561        }
1562    } else {
1563        let content = resp.text().await?;
1564        let entity: Option<PropertymappingsNotificationPartialUpdateError> = serde_json::from_str(&content).ok();
1565        Err(Error::ResponseError(ResponseContent {
1566            status,
1567            content,
1568            entity,
1569        }))
1570    }
1571}
1572
1573/// NotificationWebhookMapping Viewset
1574pub async fn propertymappings_notification_retrieve(
1575    configuration: &configuration::Configuration,
1576    pm_uuid: &str,
1577) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationRetrieveError>> {
1578    // add a prefix to parameters to efficiently prevent name collisions
1579    let p_path_pm_uuid = pm_uuid;
1580
1581    let uri_str = format!(
1582        "{}/propertymappings/notification/{pm_uuid}/",
1583        configuration.base_path,
1584        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1585    );
1586    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1587
1588    if let Some(ref user_agent) = configuration.user_agent {
1589        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1590    }
1591    if let Some(ref token) = configuration.bearer_access_token {
1592        req_builder = req_builder.bearer_auth(token.to_owned());
1593    };
1594
1595    let req = req_builder.build()?;
1596    let resp = configuration.client.execute(req).await?;
1597
1598    let status = resp.status();
1599    let content_type = resp
1600        .headers()
1601        .get("content-type")
1602        .and_then(|v| v.to_str().ok())
1603        .unwrap_or("application/octet-stream");
1604    let content_type = super::ContentType::from(content_type);
1605
1606    if !status.is_client_error() && !status.is_server_error() {
1607        let content = resp.text().await?;
1608        match content_type {
1609            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1610            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
1611            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::NotificationWebhookMapping`")))),
1612        }
1613    } else {
1614        let content = resp.text().await?;
1615        let entity: Option<PropertymappingsNotificationRetrieveError> = serde_json::from_str(&content).ok();
1616        Err(Error::ResponseError(ResponseContent {
1617            status,
1618            content,
1619            entity,
1620        }))
1621    }
1622}
1623
1624/// NotificationWebhookMapping Viewset
1625pub async fn propertymappings_notification_update(
1626    configuration: &configuration::Configuration,
1627    pm_uuid: &str,
1628    notification_webhook_mapping_request: models::NotificationWebhookMappingRequest,
1629) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationUpdateError>> {
1630    // add a prefix to parameters to efficiently prevent name collisions
1631    let p_path_pm_uuid = pm_uuid;
1632    let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request;
1633
1634    let uri_str = format!(
1635        "{}/propertymappings/notification/{pm_uuid}/",
1636        configuration.base_path,
1637        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1638    );
1639    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
1640
1641    if let Some(ref user_agent) = configuration.user_agent {
1642        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1643    }
1644    if let Some(ref token) = configuration.bearer_access_token {
1645        req_builder = req_builder.bearer_auth(token.to_owned());
1646    };
1647    req_builder = req_builder.json(&p_body_notification_webhook_mapping_request);
1648
1649    let req = req_builder.build()?;
1650    let resp = configuration.client.execute(req).await?;
1651
1652    let status = resp.status();
1653    let content_type = resp
1654        .headers()
1655        .get("content-type")
1656        .and_then(|v| v.to_str().ok())
1657        .unwrap_or("application/octet-stream");
1658    let content_type = super::ContentType::from(content_type);
1659
1660    if !status.is_client_error() && !status.is_server_error() {
1661        let content = resp.text().await?;
1662        match content_type {
1663            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1664            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
1665            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::NotificationWebhookMapping`")))),
1666        }
1667    } else {
1668        let content = resp.text().await?;
1669        let entity: Option<PropertymappingsNotificationUpdateError> = serde_json::from_str(&content).ok();
1670        Err(Error::ResponseError(ResponseContent {
1671            status,
1672            content,
1673            entity,
1674        }))
1675    }
1676}
1677
1678/// Get a list of all objects that use this object
1679pub async fn propertymappings_notification_used_by_list(
1680    configuration: &configuration::Configuration,
1681    pm_uuid: &str,
1682) -> Result<Vec<models::UsedBy>, Error<PropertymappingsNotificationUsedByListError>> {
1683    // add a prefix to parameters to efficiently prevent name collisions
1684    let p_path_pm_uuid = pm_uuid;
1685
1686    let uri_str = format!(
1687        "{}/propertymappings/notification/{pm_uuid}/used_by/",
1688        configuration.base_path,
1689        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1690    );
1691    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1692
1693    if let Some(ref user_agent) = configuration.user_agent {
1694        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1695    }
1696    if let Some(ref token) = configuration.bearer_access_token {
1697        req_builder = req_builder.bearer_auth(token.to_owned());
1698    };
1699
1700    let req = req_builder.build()?;
1701    let resp = configuration.client.execute(req).await?;
1702
1703    let status = resp.status();
1704    let content_type = resp
1705        .headers()
1706        .get("content-type")
1707        .and_then(|v| v.to_str().ok())
1708        .unwrap_or("application/octet-stream");
1709    let content_type = super::ContentType::from(content_type);
1710
1711    if !status.is_client_error() && !status.is_server_error() {
1712        let content = resp.text().await?;
1713        match content_type {
1714            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1715            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
1716            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
1717        }
1718    } else {
1719        let content = resp.text().await?;
1720        let entity: Option<PropertymappingsNotificationUsedByListError> = serde_json::from_str(&content).ok();
1721        Err(Error::ResponseError(ResponseContent {
1722            status,
1723            content,
1724            entity,
1725        }))
1726    }
1727}
1728
1729/// GoogleWorkspaceProviderMapping Viewset
1730pub async fn propertymappings_provider_google_workspace_create(
1731    configuration: &configuration::Configuration,
1732    google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest,
1733) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspaceCreateError>> {
1734    // add a prefix to parameters to efficiently prevent name collisions
1735    let p_body_google_workspace_provider_mapping_request = google_workspace_provider_mapping_request;
1736
1737    let uri_str = format!(
1738        "{}/propertymappings/provider/google_workspace/",
1739        configuration.base_path
1740    );
1741    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
1742
1743    if let Some(ref user_agent) = configuration.user_agent {
1744        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1745    }
1746    if let Some(ref token) = configuration.bearer_access_token {
1747        req_builder = req_builder.bearer_auth(token.to_owned());
1748    };
1749    req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request);
1750
1751    let req = req_builder.build()?;
1752    let resp = configuration.client.execute(req).await?;
1753
1754    let status = resp.status();
1755    let content_type = resp
1756        .headers()
1757        .get("content-type")
1758        .and_then(|v| v.to_str().ok())
1759        .unwrap_or("application/octet-stream");
1760    let content_type = super::ContentType::from(content_type);
1761
1762    if !status.is_client_error() && !status.is_server_error() {
1763        let content = resp.text().await?;
1764        match content_type {
1765            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1766            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
1767            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::GoogleWorkspaceProviderMapping`")))),
1768        }
1769    } else {
1770        let content = resp.text().await?;
1771        let entity: Option<PropertymappingsProviderGoogleWorkspaceCreateError> = serde_json::from_str(&content).ok();
1772        Err(Error::ResponseError(ResponseContent {
1773            status,
1774            content,
1775            entity,
1776        }))
1777    }
1778}
1779
1780/// GoogleWorkspaceProviderMapping Viewset
1781pub async fn propertymappings_provider_google_workspace_destroy(
1782    configuration: &configuration::Configuration,
1783    pm_uuid: &str,
1784) -> Result<(), Error<PropertymappingsProviderGoogleWorkspaceDestroyError>> {
1785    // add a prefix to parameters to efficiently prevent name collisions
1786    let p_path_pm_uuid = pm_uuid;
1787
1788    let uri_str = format!(
1789        "{}/propertymappings/provider/google_workspace/{pm_uuid}/",
1790        configuration.base_path,
1791        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1792    );
1793    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
1794
1795    if let Some(ref user_agent) = configuration.user_agent {
1796        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1797    }
1798    if let Some(ref token) = configuration.bearer_access_token {
1799        req_builder = req_builder.bearer_auth(token.to_owned());
1800    };
1801
1802    let req = req_builder.build()?;
1803    let resp = configuration.client.execute(req).await?;
1804
1805    let status = resp.status();
1806
1807    if !status.is_client_error() && !status.is_server_error() {
1808        Ok(())
1809    } else {
1810        let content = resp.text().await?;
1811        let entity: Option<PropertymappingsProviderGoogleWorkspaceDestroyError> = serde_json::from_str(&content).ok();
1812        Err(Error::ResponseError(ResponseContent {
1813            status,
1814            content,
1815            entity,
1816        }))
1817    }
1818}
1819
1820/// GoogleWorkspaceProviderMapping Viewset
1821pub async fn propertymappings_provider_google_workspace_list(
1822    configuration: &configuration::Configuration,
1823    expression: Option<&str>,
1824    managed: Option<Vec<String>>,
1825    name: Option<&str>,
1826    ordering: Option<&str>,
1827    page: Option<i32>,
1828    page_size: Option<i32>,
1829    pm_uuid: Option<&str>,
1830    search: Option<&str>,
1831) -> Result<models::PaginatedGoogleWorkspaceProviderMappingList, Error<PropertymappingsProviderGoogleWorkspaceListError>>
1832{
1833    // add a prefix to parameters to efficiently prevent name collisions
1834    let p_query_expression = expression;
1835    let p_query_managed = managed;
1836    let p_query_name = name;
1837    let p_query_ordering = ordering;
1838    let p_query_page = page;
1839    let p_query_page_size = page_size;
1840    let p_query_pm_uuid = pm_uuid;
1841    let p_query_search = search;
1842
1843    let uri_str = format!(
1844        "{}/propertymappings/provider/google_workspace/",
1845        configuration.base_path
1846    );
1847    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1848
1849    if let Some(ref param_value) = p_query_expression {
1850        req_builder = req_builder.query(&[("expression", &param_value.to_string())]);
1851    }
1852    if let Some(ref param_value) = p_query_managed {
1853        req_builder = match "multi" {
1854            "multi" => req_builder.query(
1855                &param_value
1856                    .into_iter()
1857                    .map(|p| ("managed".to_owned(), p.to_string()))
1858                    .collect::<Vec<(std::string::String, std::string::String)>>(),
1859            ),
1860            _ => req_builder.query(&[(
1861                "managed",
1862                &param_value
1863                    .into_iter()
1864                    .map(|p| p.to_string())
1865                    .collect::<Vec<String>>()
1866                    .join(",")
1867                    .to_string(),
1868            )]),
1869        };
1870    }
1871    if let Some(ref param_value) = p_query_name {
1872        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
1873    }
1874    if let Some(ref param_value) = p_query_ordering {
1875        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
1876    }
1877    if let Some(ref param_value) = p_query_page {
1878        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
1879    }
1880    if let Some(ref param_value) = p_query_page_size {
1881        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
1882    }
1883    if let Some(ref param_value) = p_query_pm_uuid {
1884        req_builder = req_builder.query(&[("pm_uuid", &param_value.to_string())]);
1885    }
1886    if let Some(ref param_value) = p_query_search {
1887        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
1888    }
1889    if let Some(ref user_agent) = configuration.user_agent {
1890        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1891    }
1892    if let Some(ref token) = configuration.bearer_access_token {
1893        req_builder = req_builder.bearer_auth(token.to_owned());
1894    };
1895
1896    let req = req_builder.build()?;
1897    let resp = configuration.client.execute(req).await?;
1898
1899    let status = resp.status();
1900    let content_type = resp
1901        .headers()
1902        .get("content-type")
1903        .and_then(|v| v.to_str().ok())
1904        .unwrap_or("application/octet-stream");
1905    let content_type = super::ContentType::from(content_type);
1906
1907    if !status.is_client_error() && !status.is_server_error() {
1908        let content = resp.text().await?;
1909        match content_type {
1910            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1911            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderMappingList`"))),
1912            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::PaginatedGoogleWorkspaceProviderMappingList`")))),
1913        }
1914    } else {
1915        let content = resp.text().await?;
1916        let entity: Option<PropertymappingsProviderGoogleWorkspaceListError> = serde_json::from_str(&content).ok();
1917        Err(Error::ResponseError(ResponseContent {
1918            status,
1919            content,
1920            entity,
1921        }))
1922    }
1923}
1924
1925/// GoogleWorkspaceProviderMapping Viewset
1926pub async fn propertymappings_provider_google_workspace_partial_update(
1927    configuration: &configuration::Configuration,
1928    pm_uuid: &str,
1929    patched_google_workspace_provider_mapping_request: Option<models::PatchedGoogleWorkspaceProviderMappingRequest>,
1930) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspacePartialUpdateError>> {
1931    // add a prefix to parameters to efficiently prevent name collisions
1932    let p_path_pm_uuid = pm_uuid;
1933    let p_body_patched_google_workspace_provider_mapping_request = patched_google_workspace_provider_mapping_request;
1934
1935    let uri_str = format!(
1936        "{}/propertymappings/provider/google_workspace/{pm_uuid}/",
1937        configuration.base_path,
1938        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1939    );
1940    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
1941
1942    if let Some(ref user_agent) = configuration.user_agent {
1943        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1944    }
1945    if let Some(ref token) = configuration.bearer_access_token {
1946        req_builder = req_builder.bearer_auth(token.to_owned());
1947    };
1948    req_builder = req_builder.json(&p_body_patched_google_workspace_provider_mapping_request);
1949
1950    let req = req_builder.build()?;
1951    let resp = configuration.client.execute(req).await?;
1952
1953    let status = resp.status();
1954    let content_type = resp
1955        .headers()
1956        .get("content-type")
1957        .and_then(|v| v.to_str().ok())
1958        .unwrap_or("application/octet-stream");
1959    let content_type = super::ContentType::from(content_type);
1960
1961    if !status.is_client_error() && !status.is_server_error() {
1962        let content = resp.text().await?;
1963        match content_type {
1964            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
1965            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
1966            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::GoogleWorkspaceProviderMapping`")))),
1967        }
1968    } else {
1969        let content = resp.text().await?;
1970        let entity: Option<PropertymappingsProviderGoogleWorkspacePartialUpdateError> =
1971            serde_json::from_str(&content).ok();
1972        Err(Error::ResponseError(ResponseContent {
1973            status,
1974            content,
1975            entity,
1976        }))
1977    }
1978}
1979
1980/// GoogleWorkspaceProviderMapping Viewset
1981pub async fn propertymappings_provider_google_workspace_retrieve(
1982    configuration: &configuration::Configuration,
1983    pm_uuid: &str,
1984) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspaceRetrieveError>> {
1985    // add a prefix to parameters to efficiently prevent name collisions
1986    let p_path_pm_uuid = pm_uuid;
1987
1988    let uri_str = format!(
1989        "{}/propertymappings/provider/google_workspace/{pm_uuid}/",
1990        configuration.base_path,
1991        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
1992    );
1993    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
1994
1995    if let Some(ref user_agent) = configuration.user_agent {
1996        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
1997    }
1998    if let Some(ref token) = configuration.bearer_access_token {
1999        req_builder = req_builder.bearer_auth(token.to_owned());
2000    };
2001
2002    let req = req_builder.build()?;
2003    let resp = configuration.client.execute(req).await?;
2004
2005    let status = resp.status();
2006    let content_type = resp
2007        .headers()
2008        .get("content-type")
2009        .and_then(|v| v.to_str().ok())
2010        .unwrap_or("application/octet-stream");
2011    let content_type = super::ContentType::from(content_type);
2012
2013    if !status.is_client_error() && !status.is_server_error() {
2014        let content = resp.text().await?;
2015        match content_type {
2016            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2017            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
2018            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::GoogleWorkspaceProviderMapping`")))),
2019        }
2020    } else {
2021        let content = resp.text().await?;
2022        let entity: Option<PropertymappingsProviderGoogleWorkspaceRetrieveError> = serde_json::from_str(&content).ok();
2023        Err(Error::ResponseError(ResponseContent {
2024            status,
2025            content,
2026            entity,
2027        }))
2028    }
2029}
2030
2031/// GoogleWorkspaceProviderMapping Viewset
2032pub async fn propertymappings_provider_google_workspace_update(
2033    configuration: &configuration::Configuration,
2034    pm_uuid: &str,
2035    google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest,
2036) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspaceUpdateError>> {
2037    // add a prefix to parameters to efficiently prevent name collisions
2038    let p_path_pm_uuid = pm_uuid;
2039    let p_body_google_workspace_provider_mapping_request = google_workspace_provider_mapping_request;
2040
2041    let uri_str = format!(
2042        "{}/propertymappings/provider/google_workspace/{pm_uuid}/",
2043        configuration.base_path,
2044        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2045    );
2046    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2047
2048    if let Some(ref user_agent) = configuration.user_agent {
2049        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2050    }
2051    if let Some(ref token) = configuration.bearer_access_token {
2052        req_builder = req_builder.bearer_auth(token.to_owned());
2053    };
2054    req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request);
2055
2056    let req = req_builder.build()?;
2057    let resp = configuration.client.execute(req).await?;
2058
2059    let status = resp.status();
2060    let content_type = resp
2061        .headers()
2062        .get("content-type")
2063        .and_then(|v| v.to_str().ok())
2064        .unwrap_or("application/octet-stream");
2065    let content_type = super::ContentType::from(content_type);
2066
2067    if !status.is_client_error() && !status.is_server_error() {
2068        let content = resp.text().await?;
2069        match content_type {
2070            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2071            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
2072            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::GoogleWorkspaceProviderMapping`")))),
2073        }
2074    } else {
2075        let content = resp.text().await?;
2076        let entity: Option<PropertymappingsProviderGoogleWorkspaceUpdateError> = serde_json::from_str(&content).ok();
2077        Err(Error::ResponseError(ResponseContent {
2078            status,
2079            content,
2080            entity,
2081        }))
2082    }
2083}
2084
2085/// Get a list of all objects that use this object
2086pub async fn propertymappings_provider_google_workspace_used_by_list(
2087    configuration: &configuration::Configuration,
2088    pm_uuid: &str,
2089) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderGoogleWorkspaceUsedByListError>> {
2090    // add a prefix to parameters to efficiently prevent name collisions
2091    let p_path_pm_uuid = pm_uuid;
2092
2093    let uri_str = format!(
2094        "{}/propertymappings/provider/google_workspace/{pm_uuid}/used_by/",
2095        configuration.base_path,
2096        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2097    );
2098    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2099
2100    if let Some(ref user_agent) = configuration.user_agent {
2101        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2102    }
2103    if let Some(ref token) = configuration.bearer_access_token {
2104        req_builder = req_builder.bearer_auth(token.to_owned());
2105    };
2106
2107    let req = req_builder.build()?;
2108    let resp = configuration.client.execute(req).await?;
2109
2110    let status = resp.status();
2111    let content_type = resp
2112        .headers()
2113        .get("content-type")
2114        .and_then(|v| v.to_str().ok())
2115        .unwrap_or("application/octet-stream");
2116    let content_type = super::ContentType::from(content_type);
2117
2118    if !status.is_client_error() && !status.is_server_error() {
2119        let content = resp.text().await?;
2120        match content_type {
2121            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2122            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
2123            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
2124        }
2125    } else {
2126        let content = resp.text().await?;
2127        let entity: Option<PropertymappingsProviderGoogleWorkspaceUsedByListError> =
2128            serde_json::from_str(&content).ok();
2129        Err(Error::ResponseError(ResponseContent {
2130            status,
2131            content,
2132            entity,
2133        }))
2134    }
2135}
2136
2137/// MicrosoftEntraProviderMapping Viewset
2138pub async fn propertymappings_provider_microsoft_entra_create(
2139    configuration: &configuration::Configuration,
2140    microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest,
2141) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraCreateError>> {
2142    // add a prefix to parameters to efficiently prevent name collisions
2143    let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request;
2144
2145    let uri_str = format!("{}/propertymappings/provider/microsoft_entra/", configuration.base_path);
2146    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2147
2148    if let Some(ref user_agent) = configuration.user_agent {
2149        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2150    }
2151    if let Some(ref token) = configuration.bearer_access_token {
2152        req_builder = req_builder.bearer_auth(token.to_owned());
2153    };
2154    req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request);
2155
2156    let req = req_builder.build()?;
2157    let resp = configuration.client.execute(req).await?;
2158
2159    let status = resp.status();
2160    let content_type = resp
2161        .headers()
2162        .get("content-type")
2163        .and_then(|v| v.to_str().ok())
2164        .unwrap_or("application/octet-stream");
2165    let content_type = super::ContentType::from(content_type);
2166
2167    if !status.is_client_error() && !status.is_server_error() {
2168        let content = resp.text().await?;
2169        match content_type {
2170            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2171            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
2172            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::MicrosoftEntraProviderMapping`")))),
2173        }
2174    } else {
2175        let content = resp.text().await?;
2176        let entity: Option<PropertymappingsProviderMicrosoftEntraCreateError> = serde_json::from_str(&content).ok();
2177        Err(Error::ResponseError(ResponseContent {
2178            status,
2179            content,
2180            entity,
2181        }))
2182    }
2183}
2184
2185/// MicrosoftEntraProviderMapping Viewset
2186pub async fn propertymappings_provider_microsoft_entra_destroy(
2187    configuration: &configuration::Configuration,
2188    pm_uuid: &str,
2189) -> Result<(), Error<PropertymappingsProviderMicrosoftEntraDestroyError>> {
2190    // add a prefix to parameters to efficiently prevent name collisions
2191    let p_path_pm_uuid = pm_uuid;
2192
2193    let uri_str = format!(
2194        "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
2195        configuration.base_path,
2196        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2197    );
2198    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2199
2200    if let Some(ref user_agent) = configuration.user_agent {
2201        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2202    }
2203    if let Some(ref token) = configuration.bearer_access_token {
2204        req_builder = req_builder.bearer_auth(token.to_owned());
2205    };
2206
2207    let req = req_builder.build()?;
2208    let resp = configuration.client.execute(req).await?;
2209
2210    let status = resp.status();
2211
2212    if !status.is_client_error() && !status.is_server_error() {
2213        Ok(())
2214    } else {
2215        let content = resp.text().await?;
2216        let entity: Option<PropertymappingsProviderMicrosoftEntraDestroyError> = serde_json::from_str(&content).ok();
2217        Err(Error::ResponseError(ResponseContent {
2218            status,
2219            content,
2220            entity,
2221        }))
2222    }
2223}
2224
2225/// MicrosoftEntraProviderMapping Viewset
2226pub async fn propertymappings_provider_microsoft_entra_list(
2227    configuration: &configuration::Configuration,
2228    expression: Option<&str>,
2229    managed: Option<Vec<String>>,
2230    name: Option<&str>,
2231    ordering: Option<&str>,
2232    page: Option<i32>,
2233    page_size: Option<i32>,
2234    pm_uuid: Option<&str>,
2235    search: Option<&str>,
2236) -> Result<models::PaginatedMicrosoftEntraProviderMappingList, Error<PropertymappingsProviderMicrosoftEntraListError>>
2237{
2238    // add a prefix to parameters to efficiently prevent name collisions
2239    let p_query_expression = expression;
2240    let p_query_managed = managed;
2241    let p_query_name = name;
2242    let p_query_ordering = ordering;
2243    let p_query_page = page;
2244    let p_query_page_size = page_size;
2245    let p_query_pm_uuid = pm_uuid;
2246    let p_query_search = search;
2247
2248    let uri_str = format!("{}/propertymappings/provider/microsoft_entra/", configuration.base_path);
2249    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2250
2251    if let Some(ref param_value) = p_query_expression {
2252        req_builder = req_builder.query(&[("expression", &param_value.to_string())]);
2253    }
2254    if let Some(ref param_value) = p_query_managed {
2255        req_builder = match "multi" {
2256            "multi" => req_builder.query(
2257                &param_value
2258                    .into_iter()
2259                    .map(|p| ("managed".to_owned(), p.to_string()))
2260                    .collect::<Vec<(std::string::String, std::string::String)>>(),
2261            ),
2262            _ => req_builder.query(&[(
2263                "managed",
2264                &param_value
2265                    .into_iter()
2266                    .map(|p| p.to_string())
2267                    .collect::<Vec<String>>()
2268                    .join(",")
2269                    .to_string(),
2270            )]),
2271        };
2272    }
2273    if let Some(ref param_value) = p_query_name {
2274        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
2275    }
2276    if let Some(ref param_value) = p_query_ordering {
2277        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2278    }
2279    if let Some(ref param_value) = p_query_page {
2280        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2281    }
2282    if let Some(ref param_value) = p_query_page_size {
2283        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2284    }
2285    if let Some(ref param_value) = p_query_pm_uuid {
2286        req_builder = req_builder.query(&[("pm_uuid", &param_value.to_string())]);
2287    }
2288    if let Some(ref param_value) = p_query_search {
2289        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2290    }
2291    if let Some(ref user_agent) = configuration.user_agent {
2292        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2293    }
2294    if let Some(ref token) = configuration.bearer_access_token {
2295        req_builder = req_builder.bearer_auth(token.to_owned());
2296    };
2297
2298    let req = req_builder.build()?;
2299    let resp = configuration.client.execute(req).await?;
2300
2301    let status = resp.status();
2302    let content_type = resp
2303        .headers()
2304        .get("content-type")
2305        .and_then(|v| v.to_str().ok())
2306        .unwrap_or("application/octet-stream");
2307    let content_type = super::ContentType::from(content_type);
2308
2309    if !status.is_client_error() && !status.is_server_error() {
2310        let content = resp.text().await?;
2311        match content_type {
2312            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2313            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderMappingList`"))),
2314            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::PaginatedMicrosoftEntraProviderMappingList`")))),
2315        }
2316    } else {
2317        let content = resp.text().await?;
2318        let entity: Option<PropertymappingsProviderMicrosoftEntraListError> = serde_json::from_str(&content).ok();
2319        Err(Error::ResponseError(ResponseContent {
2320            status,
2321            content,
2322            entity,
2323        }))
2324    }
2325}
2326
2327/// MicrosoftEntraProviderMapping Viewset
2328pub async fn propertymappings_provider_microsoft_entra_partial_update(
2329    configuration: &configuration::Configuration,
2330    pm_uuid: &str,
2331    patched_microsoft_entra_provider_mapping_request: Option<models::PatchedMicrosoftEntraProviderMappingRequest>,
2332) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraPartialUpdateError>> {
2333    // add a prefix to parameters to efficiently prevent name collisions
2334    let p_path_pm_uuid = pm_uuid;
2335    let p_body_patched_microsoft_entra_provider_mapping_request = patched_microsoft_entra_provider_mapping_request;
2336
2337    let uri_str = format!(
2338        "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
2339        configuration.base_path,
2340        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2341    );
2342    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2343
2344    if let Some(ref user_agent) = configuration.user_agent {
2345        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2346    }
2347    if let Some(ref token) = configuration.bearer_access_token {
2348        req_builder = req_builder.bearer_auth(token.to_owned());
2349    };
2350    req_builder = req_builder.json(&p_body_patched_microsoft_entra_provider_mapping_request);
2351
2352    let req = req_builder.build()?;
2353    let resp = configuration.client.execute(req).await?;
2354
2355    let status = resp.status();
2356    let content_type = resp
2357        .headers()
2358        .get("content-type")
2359        .and_then(|v| v.to_str().ok())
2360        .unwrap_or("application/octet-stream");
2361    let content_type = super::ContentType::from(content_type);
2362
2363    if !status.is_client_error() && !status.is_server_error() {
2364        let content = resp.text().await?;
2365        match content_type {
2366            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2367            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
2368            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::MicrosoftEntraProviderMapping`")))),
2369        }
2370    } else {
2371        let content = resp.text().await?;
2372        let entity: Option<PropertymappingsProviderMicrosoftEntraPartialUpdateError> =
2373            serde_json::from_str(&content).ok();
2374        Err(Error::ResponseError(ResponseContent {
2375            status,
2376            content,
2377            entity,
2378        }))
2379    }
2380}
2381
2382/// MicrosoftEntraProviderMapping Viewset
2383pub async fn propertymappings_provider_microsoft_entra_retrieve(
2384    configuration: &configuration::Configuration,
2385    pm_uuid: &str,
2386) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraRetrieveError>> {
2387    // add a prefix to parameters to efficiently prevent name collisions
2388    let p_path_pm_uuid = pm_uuid;
2389
2390    let uri_str = format!(
2391        "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
2392        configuration.base_path,
2393        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2394    );
2395    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2396
2397    if let Some(ref user_agent) = configuration.user_agent {
2398        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2399    }
2400    if let Some(ref token) = configuration.bearer_access_token {
2401        req_builder = req_builder.bearer_auth(token.to_owned());
2402    };
2403
2404    let req = req_builder.build()?;
2405    let resp = configuration.client.execute(req).await?;
2406
2407    let status = resp.status();
2408    let content_type = resp
2409        .headers()
2410        .get("content-type")
2411        .and_then(|v| v.to_str().ok())
2412        .unwrap_or("application/octet-stream");
2413    let content_type = super::ContentType::from(content_type);
2414
2415    if !status.is_client_error() && !status.is_server_error() {
2416        let content = resp.text().await?;
2417        match content_type {
2418            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2419            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
2420            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::MicrosoftEntraProviderMapping`")))),
2421        }
2422    } else {
2423        let content = resp.text().await?;
2424        let entity: Option<PropertymappingsProviderMicrosoftEntraRetrieveError> = serde_json::from_str(&content).ok();
2425        Err(Error::ResponseError(ResponseContent {
2426            status,
2427            content,
2428            entity,
2429        }))
2430    }
2431}
2432
2433/// MicrosoftEntraProviderMapping Viewset
2434pub async fn propertymappings_provider_microsoft_entra_update(
2435    configuration: &configuration::Configuration,
2436    pm_uuid: &str,
2437    microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest,
2438) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraUpdateError>> {
2439    // add a prefix to parameters to efficiently prevent name collisions
2440    let p_path_pm_uuid = pm_uuid;
2441    let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request;
2442
2443    let uri_str = format!(
2444        "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
2445        configuration.base_path,
2446        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2447    );
2448    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2449
2450    if let Some(ref user_agent) = configuration.user_agent {
2451        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2452    }
2453    if let Some(ref token) = configuration.bearer_access_token {
2454        req_builder = req_builder.bearer_auth(token.to_owned());
2455    };
2456    req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request);
2457
2458    let req = req_builder.build()?;
2459    let resp = configuration.client.execute(req).await?;
2460
2461    let status = resp.status();
2462    let content_type = resp
2463        .headers()
2464        .get("content-type")
2465        .and_then(|v| v.to_str().ok())
2466        .unwrap_or("application/octet-stream");
2467    let content_type = super::ContentType::from(content_type);
2468
2469    if !status.is_client_error() && !status.is_server_error() {
2470        let content = resp.text().await?;
2471        match content_type {
2472            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2473            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
2474            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::MicrosoftEntraProviderMapping`")))),
2475        }
2476    } else {
2477        let content = resp.text().await?;
2478        let entity: Option<PropertymappingsProviderMicrosoftEntraUpdateError> = serde_json::from_str(&content).ok();
2479        Err(Error::ResponseError(ResponseContent {
2480            status,
2481            content,
2482            entity,
2483        }))
2484    }
2485}
2486
2487/// Get a list of all objects that use this object
2488pub async fn propertymappings_provider_microsoft_entra_used_by_list(
2489    configuration: &configuration::Configuration,
2490    pm_uuid: &str,
2491) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderMicrosoftEntraUsedByListError>> {
2492    // add a prefix to parameters to efficiently prevent name collisions
2493    let p_path_pm_uuid = pm_uuid;
2494
2495    let uri_str = format!(
2496        "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/used_by/",
2497        configuration.base_path,
2498        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2499    );
2500    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2501
2502    if let Some(ref user_agent) = configuration.user_agent {
2503        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2504    }
2505    if let Some(ref token) = configuration.bearer_access_token {
2506        req_builder = req_builder.bearer_auth(token.to_owned());
2507    };
2508
2509    let req = req_builder.build()?;
2510    let resp = configuration.client.execute(req).await?;
2511
2512    let status = resp.status();
2513    let content_type = resp
2514        .headers()
2515        .get("content-type")
2516        .and_then(|v| v.to_str().ok())
2517        .unwrap_or("application/octet-stream");
2518    let content_type = super::ContentType::from(content_type);
2519
2520    if !status.is_client_error() && !status.is_server_error() {
2521        let content = resp.text().await?;
2522        match content_type {
2523            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2524            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
2525            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
2526        }
2527    } else {
2528        let content = resp.text().await?;
2529        let entity: Option<PropertymappingsProviderMicrosoftEntraUsedByListError> = serde_json::from_str(&content).ok();
2530        Err(Error::ResponseError(ResponseContent {
2531            status,
2532            content,
2533            entity,
2534        }))
2535    }
2536}
2537
2538/// RACPropertyMapping Viewset
2539pub async fn propertymappings_provider_rac_create(
2540    configuration: &configuration::Configuration,
2541    rac_property_mapping_request: models::RacPropertyMappingRequest,
2542) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacCreateError>> {
2543    // add a prefix to parameters to efficiently prevent name collisions
2544    let p_body_rac_property_mapping_request = rac_property_mapping_request;
2545
2546    let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path);
2547    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2548
2549    if let Some(ref user_agent) = configuration.user_agent {
2550        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2551    }
2552    if let Some(ref token) = configuration.bearer_access_token {
2553        req_builder = req_builder.bearer_auth(token.to_owned());
2554    };
2555    req_builder = req_builder.json(&p_body_rac_property_mapping_request);
2556
2557    let req = req_builder.build()?;
2558    let resp = configuration.client.execute(req).await?;
2559
2560    let status = resp.status();
2561    let content_type = resp
2562        .headers()
2563        .get("content-type")
2564        .and_then(|v| v.to_str().ok())
2565        .unwrap_or("application/octet-stream");
2566    let content_type = super::ContentType::from(content_type);
2567
2568    if !status.is_client_error() && !status.is_server_error() {
2569        let content = resp.text().await?;
2570        match content_type {
2571            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2572            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
2573            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::RacPropertyMapping`")))),
2574        }
2575    } else {
2576        let content = resp.text().await?;
2577        let entity: Option<PropertymappingsProviderRacCreateError> = serde_json::from_str(&content).ok();
2578        Err(Error::ResponseError(ResponseContent {
2579            status,
2580            content,
2581            entity,
2582        }))
2583    }
2584}
2585
2586/// RACPropertyMapping Viewset
2587pub async fn propertymappings_provider_rac_destroy(
2588    configuration: &configuration::Configuration,
2589    pm_uuid: &str,
2590) -> Result<(), Error<PropertymappingsProviderRacDestroyError>> {
2591    // add a prefix to parameters to efficiently prevent name collisions
2592    let p_path_pm_uuid = pm_uuid;
2593
2594    let uri_str = format!(
2595        "{}/propertymappings/provider/rac/{pm_uuid}/",
2596        configuration.base_path,
2597        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2598    );
2599    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2600
2601    if let Some(ref user_agent) = configuration.user_agent {
2602        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2603    }
2604    if let Some(ref token) = configuration.bearer_access_token {
2605        req_builder = req_builder.bearer_auth(token.to_owned());
2606    };
2607
2608    let req = req_builder.build()?;
2609    let resp = configuration.client.execute(req).await?;
2610
2611    let status = resp.status();
2612
2613    if !status.is_client_error() && !status.is_server_error() {
2614        Ok(())
2615    } else {
2616        let content = resp.text().await?;
2617        let entity: Option<PropertymappingsProviderRacDestroyError> = serde_json::from_str(&content).ok();
2618        Err(Error::ResponseError(ResponseContent {
2619            status,
2620            content,
2621            entity,
2622        }))
2623    }
2624}
2625
2626/// RACPropertyMapping Viewset
2627pub async fn propertymappings_provider_rac_list(
2628    configuration: &configuration::Configuration,
2629    managed: Option<Vec<String>>,
2630    name: Option<&str>,
2631    ordering: Option<&str>,
2632    page: Option<i32>,
2633    page_size: Option<i32>,
2634    search: Option<&str>,
2635) -> Result<models::PaginatedRacPropertyMappingList, Error<PropertymappingsProviderRacListError>> {
2636    // add a prefix to parameters to efficiently prevent name collisions
2637    let p_query_managed = managed;
2638    let p_query_name = name;
2639    let p_query_ordering = ordering;
2640    let p_query_page = page;
2641    let p_query_page_size = page_size;
2642    let p_query_search = search;
2643
2644    let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path);
2645    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2646
2647    if let Some(ref param_value) = p_query_managed {
2648        req_builder = match "multi" {
2649            "multi" => req_builder.query(
2650                &param_value
2651                    .into_iter()
2652                    .map(|p| ("managed".to_owned(), p.to_string()))
2653                    .collect::<Vec<(std::string::String, std::string::String)>>(),
2654            ),
2655            _ => req_builder.query(&[(
2656                "managed",
2657                &param_value
2658                    .into_iter()
2659                    .map(|p| p.to_string())
2660                    .collect::<Vec<String>>()
2661                    .join(",")
2662                    .to_string(),
2663            )]),
2664        };
2665    }
2666    if let Some(ref param_value) = p_query_name {
2667        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
2668    }
2669    if let Some(ref param_value) = p_query_ordering {
2670        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
2671    }
2672    if let Some(ref param_value) = p_query_page {
2673        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
2674    }
2675    if let Some(ref param_value) = p_query_page_size {
2676        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
2677    }
2678    if let Some(ref param_value) = p_query_search {
2679        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
2680    }
2681    if let Some(ref user_agent) = configuration.user_agent {
2682        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2683    }
2684    if let Some(ref token) = configuration.bearer_access_token {
2685        req_builder = req_builder.bearer_auth(token.to_owned());
2686    };
2687
2688    let req = req_builder.build()?;
2689    let resp = configuration.client.execute(req).await?;
2690
2691    let status = resp.status();
2692    let content_type = resp
2693        .headers()
2694        .get("content-type")
2695        .and_then(|v| v.to_str().ok())
2696        .unwrap_or("application/octet-stream");
2697    let content_type = super::ContentType::from(content_type);
2698
2699    if !status.is_client_error() && !status.is_server_error() {
2700        let content = resp.text().await?;
2701        match content_type {
2702            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2703            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRacPropertyMappingList`"))),
2704            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::PaginatedRacPropertyMappingList`")))),
2705        }
2706    } else {
2707        let content = resp.text().await?;
2708        let entity: Option<PropertymappingsProviderRacListError> = serde_json::from_str(&content).ok();
2709        Err(Error::ResponseError(ResponseContent {
2710            status,
2711            content,
2712            entity,
2713        }))
2714    }
2715}
2716
2717/// RACPropertyMapping Viewset
2718pub async fn propertymappings_provider_rac_partial_update(
2719    configuration: &configuration::Configuration,
2720    pm_uuid: &str,
2721    patched_rac_property_mapping_request: Option<models::PatchedRacPropertyMappingRequest>,
2722) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacPartialUpdateError>> {
2723    // add a prefix to parameters to efficiently prevent name collisions
2724    let p_path_pm_uuid = pm_uuid;
2725    let p_body_patched_rac_property_mapping_request = patched_rac_property_mapping_request;
2726
2727    let uri_str = format!(
2728        "{}/propertymappings/provider/rac/{pm_uuid}/",
2729        configuration.base_path,
2730        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2731    );
2732    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
2733
2734    if let Some(ref user_agent) = configuration.user_agent {
2735        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2736    }
2737    if let Some(ref token) = configuration.bearer_access_token {
2738        req_builder = req_builder.bearer_auth(token.to_owned());
2739    };
2740    req_builder = req_builder.json(&p_body_patched_rac_property_mapping_request);
2741
2742    let req = req_builder.build()?;
2743    let resp = configuration.client.execute(req).await?;
2744
2745    let status = resp.status();
2746    let content_type = resp
2747        .headers()
2748        .get("content-type")
2749        .and_then(|v| v.to_str().ok())
2750        .unwrap_or("application/octet-stream");
2751    let content_type = super::ContentType::from(content_type);
2752
2753    if !status.is_client_error() && !status.is_server_error() {
2754        let content = resp.text().await?;
2755        match content_type {
2756            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2757            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
2758            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::RacPropertyMapping`")))),
2759        }
2760    } else {
2761        let content = resp.text().await?;
2762        let entity: Option<PropertymappingsProviderRacPartialUpdateError> = serde_json::from_str(&content).ok();
2763        Err(Error::ResponseError(ResponseContent {
2764            status,
2765            content,
2766            entity,
2767        }))
2768    }
2769}
2770
2771/// RACPropertyMapping Viewset
2772pub async fn propertymappings_provider_rac_retrieve(
2773    configuration: &configuration::Configuration,
2774    pm_uuid: &str,
2775) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacRetrieveError>> {
2776    // add a prefix to parameters to efficiently prevent name collisions
2777    let p_path_pm_uuid = pm_uuid;
2778
2779    let uri_str = format!(
2780        "{}/propertymappings/provider/rac/{pm_uuid}/",
2781        configuration.base_path,
2782        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2783    );
2784    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2785
2786    if let Some(ref user_agent) = configuration.user_agent {
2787        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2788    }
2789    if let Some(ref token) = configuration.bearer_access_token {
2790        req_builder = req_builder.bearer_auth(token.to_owned());
2791    };
2792
2793    let req = req_builder.build()?;
2794    let resp = configuration.client.execute(req).await?;
2795
2796    let status = resp.status();
2797    let content_type = resp
2798        .headers()
2799        .get("content-type")
2800        .and_then(|v| v.to_str().ok())
2801        .unwrap_or("application/octet-stream");
2802    let content_type = super::ContentType::from(content_type);
2803
2804    if !status.is_client_error() && !status.is_server_error() {
2805        let content = resp.text().await?;
2806        match content_type {
2807            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2808            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
2809            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::RacPropertyMapping`")))),
2810        }
2811    } else {
2812        let content = resp.text().await?;
2813        let entity: Option<PropertymappingsProviderRacRetrieveError> = serde_json::from_str(&content).ok();
2814        Err(Error::ResponseError(ResponseContent {
2815            status,
2816            content,
2817            entity,
2818        }))
2819    }
2820}
2821
2822/// RACPropertyMapping Viewset
2823pub async fn propertymappings_provider_rac_update(
2824    configuration: &configuration::Configuration,
2825    pm_uuid: &str,
2826    rac_property_mapping_request: models::RacPropertyMappingRequest,
2827) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacUpdateError>> {
2828    // add a prefix to parameters to efficiently prevent name collisions
2829    let p_path_pm_uuid = pm_uuid;
2830    let p_body_rac_property_mapping_request = rac_property_mapping_request;
2831
2832    let uri_str = format!(
2833        "{}/propertymappings/provider/rac/{pm_uuid}/",
2834        configuration.base_path,
2835        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2836    );
2837    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
2838
2839    if let Some(ref user_agent) = configuration.user_agent {
2840        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2841    }
2842    if let Some(ref token) = configuration.bearer_access_token {
2843        req_builder = req_builder.bearer_auth(token.to_owned());
2844    };
2845    req_builder = req_builder.json(&p_body_rac_property_mapping_request);
2846
2847    let req = req_builder.build()?;
2848    let resp = configuration.client.execute(req).await?;
2849
2850    let status = resp.status();
2851    let content_type = resp
2852        .headers()
2853        .get("content-type")
2854        .and_then(|v| v.to_str().ok())
2855        .unwrap_or("application/octet-stream");
2856    let content_type = super::ContentType::from(content_type);
2857
2858    if !status.is_client_error() && !status.is_server_error() {
2859        let content = resp.text().await?;
2860        match content_type {
2861            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2862            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
2863            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::RacPropertyMapping`")))),
2864        }
2865    } else {
2866        let content = resp.text().await?;
2867        let entity: Option<PropertymappingsProviderRacUpdateError> = serde_json::from_str(&content).ok();
2868        Err(Error::ResponseError(ResponseContent {
2869            status,
2870            content,
2871            entity,
2872        }))
2873    }
2874}
2875
2876/// Get a list of all objects that use this object
2877pub async fn propertymappings_provider_rac_used_by_list(
2878    configuration: &configuration::Configuration,
2879    pm_uuid: &str,
2880) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderRacUsedByListError>> {
2881    // add a prefix to parameters to efficiently prevent name collisions
2882    let p_path_pm_uuid = pm_uuid;
2883
2884    let uri_str = format!(
2885        "{}/propertymappings/provider/rac/{pm_uuid}/used_by/",
2886        configuration.base_path,
2887        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2888    );
2889    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
2890
2891    if let Some(ref user_agent) = configuration.user_agent {
2892        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2893    }
2894    if let Some(ref token) = configuration.bearer_access_token {
2895        req_builder = req_builder.bearer_auth(token.to_owned());
2896    };
2897
2898    let req = req_builder.build()?;
2899    let resp = configuration.client.execute(req).await?;
2900
2901    let status = resp.status();
2902    let content_type = resp
2903        .headers()
2904        .get("content-type")
2905        .and_then(|v| v.to_str().ok())
2906        .unwrap_or("application/octet-stream");
2907    let content_type = super::ContentType::from(content_type);
2908
2909    if !status.is_client_error() && !status.is_server_error() {
2910        let content = resp.text().await?;
2911        match content_type {
2912            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2913            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
2914            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
2915        }
2916    } else {
2917        let content = resp.text().await?;
2918        let entity: Option<PropertymappingsProviderRacUsedByListError> = serde_json::from_str(&content).ok();
2919        Err(Error::ResponseError(ResponseContent {
2920            status,
2921            content,
2922            entity,
2923        }))
2924    }
2925}
2926
2927/// RadiusProviderPropertyMapping Viewset
2928pub async fn propertymappings_provider_radius_create(
2929    configuration: &configuration::Configuration,
2930    radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest,
2931) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusCreateError>> {
2932    // add a prefix to parameters to efficiently prevent name collisions
2933    let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request;
2934
2935    let uri_str = format!("{}/propertymappings/provider/radius/", configuration.base_path);
2936    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
2937
2938    if let Some(ref user_agent) = configuration.user_agent {
2939        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2940    }
2941    if let Some(ref token) = configuration.bearer_access_token {
2942        req_builder = req_builder.bearer_auth(token.to_owned());
2943    };
2944    req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request);
2945
2946    let req = req_builder.build()?;
2947    let resp = configuration.client.execute(req).await?;
2948
2949    let status = resp.status();
2950    let content_type = resp
2951        .headers()
2952        .get("content-type")
2953        .and_then(|v| v.to_str().ok())
2954        .unwrap_or("application/octet-stream");
2955    let content_type = super::ContentType::from(content_type);
2956
2957    if !status.is_client_error() && !status.is_server_error() {
2958        let content = resp.text().await?;
2959        match content_type {
2960            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
2961            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
2962            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::RadiusProviderPropertyMapping`")))),
2963        }
2964    } else {
2965        let content = resp.text().await?;
2966        let entity: Option<PropertymappingsProviderRadiusCreateError> = serde_json::from_str(&content).ok();
2967        Err(Error::ResponseError(ResponseContent {
2968            status,
2969            content,
2970            entity,
2971        }))
2972    }
2973}
2974
2975/// RadiusProviderPropertyMapping Viewset
2976pub async fn propertymappings_provider_radius_destroy(
2977    configuration: &configuration::Configuration,
2978    pm_uuid: &str,
2979) -> Result<(), Error<PropertymappingsProviderRadiusDestroyError>> {
2980    // add a prefix to parameters to efficiently prevent name collisions
2981    let p_path_pm_uuid = pm_uuid;
2982
2983    let uri_str = format!(
2984        "{}/propertymappings/provider/radius/{pm_uuid}/",
2985        configuration.base_path,
2986        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
2987    );
2988    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
2989
2990    if let Some(ref user_agent) = configuration.user_agent {
2991        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
2992    }
2993    if let Some(ref token) = configuration.bearer_access_token {
2994        req_builder = req_builder.bearer_auth(token.to_owned());
2995    };
2996
2997    let req = req_builder.build()?;
2998    let resp = configuration.client.execute(req).await?;
2999
3000    let status = resp.status();
3001
3002    if !status.is_client_error() && !status.is_server_error() {
3003        Ok(())
3004    } else {
3005        let content = resp.text().await?;
3006        let entity: Option<PropertymappingsProviderRadiusDestroyError> = serde_json::from_str(&content).ok();
3007        Err(Error::ResponseError(ResponseContent {
3008            status,
3009            content,
3010            entity,
3011        }))
3012    }
3013}
3014
3015/// RadiusProviderPropertyMapping Viewset
3016pub async fn propertymappings_provider_radius_list(
3017    configuration: &configuration::Configuration,
3018    managed: Option<Vec<String>>,
3019    managed__isnull: Option<bool>,
3020    name: Option<&str>,
3021    ordering: Option<&str>,
3022    page: Option<i32>,
3023    page_size: Option<i32>,
3024    search: Option<&str>,
3025) -> Result<models::PaginatedRadiusProviderPropertyMappingList, Error<PropertymappingsProviderRadiusListError>> {
3026    // add a prefix to parameters to efficiently prevent name collisions
3027    let p_query_managed = managed;
3028    let p_query_managed__isnull = managed__isnull;
3029    let p_query_name = name;
3030    let p_query_ordering = ordering;
3031    let p_query_page = page;
3032    let p_query_page_size = page_size;
3033    let p_query_search = search;
3034
3035    let uri_str = format!("{}/propertymappings/provider/radius/", configuration.base_path);
3036    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3037
3038    if let Some(ref param_value) = p_query_managed {
3039        req_builder = match "multi" {
3040            "multi" => req_builder.query(
3041                &param_value
3042                    .into_iter()
3043                    .map(|p| ("managed".to_owned(), p.to_string()))
3044                    .collect::<Vec<(std::string::String, std::string::String)>>(),
3045            ),
3046            _ => req_builder.query(&[(
3047                "managed",
3048                &param_value
3049                    .into_iter()
3050                    .map(|p| p.to_string())
3051                    .collect::<Vec<String>>()
3052                    .join(",")
3053                    .to_string(),
3054            )]),
3055        };
3056    }
3057    if let Some(ref param_value) = p_query_managed__isnull {
3058        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
3059    }
3060    if let Some(ref param_value) = p_query_name {
3061        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
3062    }
3063    if let Some(ref param_value) = p_query_ordering {
3064        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3065    }
3066    if let Some(ref param_value) = p_query_page {
3067        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3068    }
3069    if let Some(ref param_value) = p_query_page_size {
3070        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3071    }
3072    if let Some(ref param_value) = p_query_search {
3073        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3074    }
3075    if let Some(ref user_agent) = configuration.user_agent {
3076        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3077    }
3078    if let Some(ref token) = configuration.bearer_access_token {
3079        req_builder = req_builder.bearer_auth(token.to_owned());
3080    };
3081
3082    let req = req_builder.build()?;
3083    let resp = configuration.client.execute(req).await?;
3084
3085    let status = resp.status();
3086    let content_type = resp
3087        .headers()
3088        .get("content-type")
3089        .and_then(|v| v.to_str().ok())
3090        .unwrap_or("application/octet-stream");
3091    let content_type = super::ContentType::from(content_type);
3092
3093    if !status.is_client_error() && !status.is_server_error() {
3094        let content = resp.text().await?;
3095        match content_type {
3096            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3097            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRadiusProviderPropertyMappingList`"))),
3098            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::PaginatedRadiusProviderPropertyMappingList`")))),
3099        }
3100    } else {
3101        let content = resp.text().await?;
3102        let entity: Option<PropertymappingsProviderRadiusListError> = serde_json::from_str(&content).ok();
3103        Err(Error::ResponseError(ResponseContent {
3104            status,
3105            content,
3106            entity,
3107        }))
3108    }
3109}
3110
3111/// RadiusProviderPropertyMapping Viewset
3112pub async fn propertymappings_provider_radius_partial_update(
3113    configuration: &configuration::Configuration,
3114    pm_uuid: &str,
3115    patched_radius_provider_property_mapping_request: Option<models::PatchedRadiusProviderPropertyMappingRequest>,
3116) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusPartialUpdateError>> {
3117    // add a prefix to parameters to efficiently prevent name collisions
3118    let p_path_pm_uuid = pm_uuid;
3119    let p_body_patched_radius_provider_property_mapping_request = patched_radius_provider_property_mapping_request;
3120
3121    let uri_str = format!(
3122        "{}/propertymappings/provider/radius/{pm_uuid}/",
3123        configuration.base_path,
3124        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3125    );
3126    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3127
3128    if let Some(ref user_agent) = configuration.user_agent {
3129        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3130    }
3131    if let Some(ref token) = configuration.bearer_access_token {
3132        req_builder = req_builder.bearer_auth(token.to_owned());
3133    };
3134    req_builder = req_builder.json(&p_body_patched_radius_provider_property_mapping_request);
3135
3136    let req = req_builder.build()?;
3137    let resp = configuration.client.execute(req).await?;
3138
3139    let status = resp.status();
3140    let content_type = resp
3141        .headers()
3142        .get("content-type")
3143        .and_then(|v| v.to_str().ok())
3144        .unwrap_or("application/octet-stream");
3145    let content_type = super::ContentType::from(content_type);
3146
3147    if !status.is_client_error() && !status.is_server_error() {
3148        let content = resp.text().await?;
3149        match content_type {
3150            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3151            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
3152            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::RadiusProviderPropertyMapping`")))),
3153        }
3154    } else {
3155        let content = resp.text().await?;
3156        let entity: Option<PropertymappingsProviderRadiusPartialUpdateError> = serde_json::from_str(&content).ok();
3157        Err(Error::ResponseError(ResponseContent {
3158            status,
3159            content,
3160            entity,
3161        }))
3162    }
3163}
3164
3165/// RadiusProviderPropertyMapping Viewset
3166pub async fn propertymappings_provider_radius_retrieve(
3167    configuration: &configuration::Configuration,
3168    pm_uuid: &str,
3169) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusRetrieveError>> {
3170    // add a prefix to parameters to efficiently prevent name collisions
3171    let p_path_pm_uuid = pm_uuid;
3172
3173    let uri_str = format!(
3174        "{}/propertymappings/provider/radius/{pm_uuid}/",
3175        configuration.base_path,
3176        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3177    );
3178    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3179
3180    if let Some(ref user_agent) = configuration.user_agent {
3181        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3182    }
3183    if let Some(ref token) = configuration.bearer_access_token {
3184        req_builder = req_builder.bearer_auth(token.to_owned());
3185    };
3186
3187    let req = req_builder.build()?;
3188    let resp = configuration.client.execute(req).await?;
3189
3190    let status = resp.status();
3191    let content_type = resp
3192        .headers()
3193        .get("content-type")
3194        .and_then(|v| v.to_str().ok())
3195        .unwrap_or("application/octet-stream");
3196    let content_type = super::ContentType::from(content_type);
3197
3198    if !status.is_client_error() && !status.is_server_error() {
3199        let content = resp.text().await?;
3200        match content_type {
3201            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3202            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
3203            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::RadiusProviderPropertyMapping`")))),
3204        }
3205    } else {
3206        let content = resp.text().await?;
3207        let entity: Option<PropertymappingsProviderRadiusRetrieveError> = serde_json::from_str(&content).ok();
3208        Err(Error::ResponseError(ResponseContent {
3209            status,
3210            content,
3211            entity,
3212        }))
3213    }
3214}
3215
3216/// RadiusProviderPropertyMapping Viewset
3217pub async fn propertymappings_provider_radius_update(
3218    configuration: &configuration::Configuration,
3219    pm_uuid: &str,
3220    radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest,
3221) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusUpdateError>> {
3222    // add a prefix to parameters to efficiently prevent name collisions
3223    let p_path_pm_uuid = pm_uuid;
3224    let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request;
3225
3226    let uri_str = format!(
3227        "{}/propertymappings/provider/radius/{pm_uuid}/",
3228        configuration.base_path,
3229        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3230    );
3231    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3232
3233    if let Some(ref user_agent) = configuration.user_agent {
3234        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3235    }
3236    if let Some(ref token) = configuration.bearer_access_token {
3237        req_builder = req_builder.bearer_auth(token.to_owned());
3238    };
3239    req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request);
3240
3241    let req = req_builder.build()?;
3242    let resp = configuration.client.execute(req).await?;
3243
3244    let status = resp.status();
3245    let content_type = resp
3246        .headers()
3247        .get("content-type")
3248        .and_then(|v| v.to_str().ok())
3249        .unwrap_or("application/octet-stream");
3250    let content_type = super::ContentType::from(content_type);
3251
3252    if !status.is_client_error() && !status.is_server_error() {
3253        let content = resp.text().await?;
3254        match content_type {
3255            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3256            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
3257            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::RadiusProviderPropertyMapping`")))),
3258        }
3259    } else {
3260        let content = resp.text().await?;
3261        let entity: Option<PropertymappingsProviderRadiusUpdateError> = serde_json::from_str(&content).ok();
3262        Err(Error::ResponseError(ResponseContent {
3263            status,
3264            content,
3265            entity,
3266        }))
3267    }
3268}
3269
3270/// Get a list of all objects that use this object
3271pub async fn propertymappings_provider_radius_used_by_list(
3272    configuration: &configuration::Configuration,
3273    pm_uuid: &str,
3274) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderRadiusUsedByListError>> {
3275    // add a prefix to parameters to efficiently prevent name collisions
3276    let p_path_pm_uuid = pm_uuid;
3277
3278    let uri_str = format!(
3279        "{}/propertymappings/provider/radius/{pm_uuid}/used_by/",
3280        configuration.base_path,
3281        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3282    );
3283    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3284
3285    if let Some(ref user_agent) = configuration.user_agent {
3286        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3287    }
3288    if let Some(ref token) = configuration.bearer_access_token {
3289        req_builder = req_builder.bearer_auth(token.to_owned());
3290    };
3291
3292    let req = req_builder.build()?;
3293    let resp = configuration.client.execute(req).await?;
3294
3295    let status = resp.status();
3296    let content_type = resp
3297        .headers()
3298        .get("content-type")
3299        .and_then(|v| v.to_str().ok())
3300        .unwrap_or("application/octet-stream");
3301    let content_type = super::ContentType::from(content_type);
3302
3303    if !status.is_client_error() && !status.is_server_error() {
3304        let content = resp.text().await?;
3305        match content_type {
3306            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3307            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
3308            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
3309        }
3310    } else {
3311        let content = resp.text().await?;
3312        let entity: Option<PropertymappingsProviderRadiusUsedByListError> = serde_json::from_str(&content).ok();
3313        Err(Error::ResponseError(ResponseContent {
3314            status,
3315            content,
3316            entity,
3317        }))
3318    }
3319}
3320
3321/// SAMLPropertyMapping Viewset
3322pub async fn propertymappings_provider_saml_create(
3323    configuration: &configuration::Configuration,
3324    saml_property_mapping_request: models::SamlPropertyMappingRequest,
3325) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlCreateError>> {
3326    // add a prefix to parameters to efficiently prevent name collisions
3327    let p_body_saml_property_mapping_request = saml_property_mapping_request;
3328
3329    let uri_str = format!("{}/propertymappings/provider/saml/", configuration.base_path);
3330    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3331
3332    if let Some(ref user_agent) = configuration.user_agent {
3333        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3334    }
3335    if let Some(ref token) = configuration.bearer_access_token {
3336        req_builder = req_builder.bearer_auth(token.to_owned());
3337    };
3338    req_builder = req_builder.json(&p_body_saml_property_mapping_request);
3339
3340    let req = req_builder.build()?;
3341    let resp = configuration.client.execute(req).await?;
3342
3343    let status = resp.status();
3344    let content_type = resp
3345        .headers()
3346        .get("content-type")
3347        .and_then(|v| v.to_str().ok())
3348        .unwrap_or("application/octet-stream");
3349    let content_type = super::ContentType::from(content_type);
3350
3351    if !status.is_client_error() && !status.is_server_error() {
3352        let content = resp.text().await?;
3353        match content_type {
3354            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3355            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
3356            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::SamlPropertyMapping`")))),
3357        }
3358    } else {
3359        let content = resp.text().await?;
3360        let entity: Option<PropertymappingsProviderSamlCreateError> = serde_json::from_str(&content).ok();
3361        Err(Error::ResponseError(ResponseContent {
3362            status,
3363            content,
3364            entity,
3365        }))
3366    }
3367}
3368
3369/// SAMLPropertyMapping Viewset
3370pub async fn propertymappings_provider_saml_destroy(
3371    configuration: &configuration::Configuration,
3372    pm_uuid: &str,
3373) -> Result<(), Error<PropertymappingsProviderSamlDestroyError>> {
3374    // add a prefix to parameters to efficiently prevent name collisions
3375    let p_path_pm_uuid = pm_uuid;
3376
3377    let uri_str = format!(
3378        "{}/propertymappings/provider/saml/{pm_uuid}/",
3379        configuration.base_path,
3380        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3381    );
3382    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3383
3384    if let Some(ref user_agent) = configuration.user_agent {
3385        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3386    }
3387    if let Some(ref token) = configuration.bearer_access_token {
3388        req_builder = req_builder.bearer_auth(token.to_owned());
3389    };
3390
3391    let req = req_builder.build()?;
3392    let resp = configuration.client.execute(req).await?;
3393
3394    let status = resp.status();
3395
3396    if !status.is_client_error() && !status.is_server_error() {
3397        Ok(())
3398    } else {
3399        let content = resp.text().await?;
3400        let entity: Option<PropertymappingsProviderSamlDestroyError> = serde_json::from_str(&content).ok();
3401        Err(Error::ResponseError(ResponseContent {
3402            status,
3403            content,
3404            entity,
3405        }))
3406    }
3407}
3408
3409/// SAMLPropertyMapping Viewset
3410pub async fn propertymappings_provider_saml_list(
3411    configuration: &configuration::Configuration,
3412    friendly_name: Option<&str>,
3413    managed: Option<Vec<String>>,
3414    managed__isnull: Option<bool>,
3415    name: Option<&str>,
3416    ordering: Option<&str>,
3417    page: Option<i32>,
3418    page_size: Option<i32>,
3419    saml_name: Option<&str>,
3420    search: Option<&str>,
3421) -> Result<models::PaginatedSamlPropertyMappingList, Error<PropertymappingsProviderSamlListError>> {
3422    // add a prefix to parameters to efficiently prevent name collisions
3423    let p_query_friendly_name = friendly_name;
3424    let p_query_managed = managed;
3425    let p_query_managed__isnull = managed__isnull;
3426    let p_query_name = name;
3427    let p_query_ordering = ordering;
3428    let p_query_page = page;
3429    let p_query_page_size = page_size;
3430    let p_query_saml_name = saml_name;
3431    let p_query_search = search;
3432
3433    let uri_str = format!("{}/propertymappings/provider/saml/", configuration.base_path);
3434    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3435
3436    if let Some(ref param_value) = p_query_friendly_name {
3437        req_builder = req_builder.query(&[("friendly_name", &param_value.to_string())]);
3438    }
3439    if let Some(ref param_value) = p_query_managed {
3440        req_builder = match "multi" {
3441            "multi" => req_builder.query(
3442                &param_value
3443                    .into_iter()
3444                    .map(|p| ("managed".to_owned(), p.to_string()))
3445                    .collect::<Vec<(std::string::String, std::string::String)>>(),
3446            ),
3447            _ => req_builder.query(&[(
3448                "managed",
3449                &param_value
3450                    .into_iter()
3451                    .map(|p| p.to_string())
3452                    .collect::<Vec<String>>()
3453                    .join(",")
3454                    .to_string(),
3455            )]),
3456        };
3457    }
3458    if let Some(ref param_value) = p_query_managed__isnull {
3459        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
3460    }
3461    if let Some(ref param_value) = p_query_name {
3462        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
3463    }
3464    if let Some(ref param_value) = p_query_ordering {
3465        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3466    }
3467    if let Some(ref param_value) = p_query_page {
3468        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3469    }
3470    if let Some(ref param_value) = p_query_page_size {
3471        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3472    }
3473    if let Some(ref param_value) = p_query_saml_name {
3474        req_builder = req_builder.query(&[("saml_name", &param_value.to_string())]);
3475    }
3476    if let Some(ref param_value) = p_query_search {
3477        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3478    }
3479    if let Some(ref user_agent) = configuration.user_agent {
3480        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3481    }
3482    if let Some(ref token) = configuration.bearer_access_token {
3483        req_builder = req_builder.bearer_auth(token.to_owned());
3484    };
3485
3486    let req = req_builder.build()?;
3487    let resp = configuration.client.execute(req).await?;
3488
3489    let status = resp.status();
3490    let content_type = resp
3491        .headers()
3492        .get("content-type")
3493        .and_then(|v| v.to_str().ok())
3494        .unwrap_or("application/octet-stream");
3495    let content_type = super::ContentType::from(content_type);
3496
3497    if !status.is_client_error() && !status.is_server_error() {
3498        let content = resp.text().await?;
3499        match content_type {
3500            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3501            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlPropertyMappingList`"))),
3502            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::PaginatedSamlPropertyMappingList`")))),
3503        }
3504    } else {
3505        let content = resp.text().await?;
3506        let entity: Option<PropertymappingsProviderSamlListError> = serde_json::from_str(&content).ok();
3507        Err(Error::ResponseError(ResponseContent {
3508            status,
3509            content,
3510            entity,
3511        }))
3512    }
3513}
3514
3515/// SAMLPropertyMapping Viewset
3516pub async fn propertymappings_provider_saml_partial_update(
3517    configuration: &configuration::Configuration,
3518    pm_uuid: &str,
3519    patched_saml_property_mapping_request: Option<models::PatchedSamlPropertyMappingRequest>,
3520) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlPartialUpdateError>> {
3521    // add a prefix to parameters to efficiently prevent name collisions
3522    let p_path_pm_uuid = pm_uuid;
3523    let p_body_patched_saml_property_mapping_request = patched_saml_property_mapping_request;
3524
3525    let uri_str = format!(
3526        "{}/propertymappings/provider/saml/{pm_uuid}/",
3527        configuration.base_path,
3528        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3529    );
3530    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3531
3532    if let Some(ref user_agent) = configuration.user_agent {
3533        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3534    }
3535    if let Some(ref token) = configuration.bearer_access_token {
3536        req_builder = req_builder.bearer_auth(token.to_owned());
3537    };
3538    req_builder = req_builder.json(&p_body_patched_saml_property_mapping_request);
3539
3540    let req = req_builder.build()?;
3541    let resp = configuration.client.execute(req).await?;
3542
3543    let status = resp.status();
3544    let content_type = resp
3545        .headers()
3546        .get("content-type")
3547        .and_then(|v| v.to_str().ok())
3548        .unwrap_or("application/octet-stream");
3549    let content_type = super::ContentType::from(content_type);
3550
3551    if !status.is_client_error() && !status.is_server_error() {
3552        let content = resp.text().await?;
3553        match content_type {
3554            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3555            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
3556            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::SamlPropertyMapping`")))),
3557        }
3558    } else {
3559        let content = resp.text().await?;
3560        let entity: Option<PropertymappingsProviderSamlPartialUpdateError> = serde_json::from_str(&content).ok();
3561        Err(Error::ResponseError(ResponseContent {
3562            status,
3563            content,
3564            entity,
3565        }))
3566    }
3567}
3568
3569/// SAMLPropertyMapping Viewset
3570pub async fn propertymappings_provider_saml_retrieve(
3571    configuration: &configuration::Configuration,
3572    pm_uuid: &str,
3573) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlRetrieveError>> {
3574    // add a prefix to parameters to efficiently prevent name collisions
3575    let p_path_pm_uuid = pm_uuid;
3576
3577    let uri_str = format!(
3578        "{}/propertymappings/provider/saml/{pm_uuid}/",
3579        configuration.base_path,
3580        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3581    );
3582    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3583
3584    if let Some(ref user_agent) = configuration.user_agent {
3585        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3586    }
3587    if let Some(ref token) = configuration.bearer_access_token {
3588        req_builder = req_builder.bearer_auth(token.to_owned());
3589    };
3590
3591    let req = req_builder.build()?;
3592    let resp = configuration.client.execute(req).await?;
3593
3594    let status = resp.status();
3595    let content_type = resp
3596        .headers()
3597        .get("content-type")
3598        .and_then(|v| v.to_str().ok())
3599        .unwrap_or("application/octet-stream");
3600    let content_type = super::ContentType::from(content_type);
3601
3602    if !status.is_client_error() && !status.is_server_error() {
3603        let content = resp.text().await?;
3604        match content_type {
3605            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3606            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
3607            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::SamlPropertyMapping`")))),
3608        }
3609    } else {
3610        let content = resp.text().await?;
3611        let entity: Option<PropertymappingsProviderSamlRetrieveError> = serde_json::from_str(&content).ok();
3612        Err(Error::ResponseError(ResponseContent {
3613            status,
3614            content,
3615            entity,
3616        }))
3617    }
3618}
3619
3620/// SAMLPropertyMapping Viewset
3621pub async fn propertymappings_provider_saml_update(
3622    configuration: &configuration::Configuration,
3623    pm_uuid: &str,
3624    saml_property_mapping_request: models::SamlPropertyMappingRequest,
3625) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlUpdateError>> {
3626    // add a prefix to parameters to efficiently prevent name collisions
3627    let p_path_pm_uuid = pm_uuid;
3628    let p_body_saml_property_mapping_request = saml_property_mapping_request;
3629
3630    let uri_str = format!(
3631        "{}/propertymappings/provider/saml/{pm_uuid}/",
3632        configuration.base_path,
3633        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3634    );
3635    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
3636
3637    if let Some(ref user_agent) = configuration.user_agent {
3638        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3639    }
3640    if let Some(ref token) = configuration.bearer_access_token {
3641        req_builder = req_builder.bearer_auth(token.to_owned());
3642    };
3643    req_builder = req_builder.json(&p_body_saml_property_mapping_request);
3644
3645    let req = req_builder.build()?;
3646    let resp = configuration.client.execute(req).await?;
3647
3648    let status = resp.status();
3649    let content_type = resp
3650        .headers()
3651        .get("content-type")
3652        .and_then(|v| v.to_str().ok())
3653        .unwrap_or("application/octet-stream");
3654    let content_type = super::ContentType::from(content_type);
3655
3656    if !status.is_client_error() && !status.is_server_error() {
3657        let content = resp.text().await?;
3658        match content_type {
3659            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3660            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
3661            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::SamlPropertyMapping`")))),
3662        }
3663    } else {
3664        let content = resp.text().await?;
3665        let entity: Option<PropertymappingsProviderSamlUpdateError> = serde_json::from_str(&content).ok();
3666        Err(Error::ResponseError(ResponseContent {
3667            status,
3668            content,
3669            entity,
3670        }))
3671    }
3672}
3673
3674/// Get a list of all objects that use this object
3675pub async fn propertymappings_provider_saml_used_by_list(
3676    configuration: &configuration::Configuration,
3677    pm_uuid: &str,
3678) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderSamlUsedByListError>> {
3679    // add a prefix to parameters to efficiently prevent name collisions
3680    let p_path_pm_uuid = pm_uuid;
3681
3682    let uri_str = format!(
3683        "{}/propertymappings/provider/saml/{pm_uuid}/used_by/",
3684        configuration.base_path,
3685        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3686    );
3687    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3688
3689    if let Some(ref user_agent) = configuration.user_agent {
3690        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3691    }
3692    if let Some(ref token) = configuration.bearer_access_token {
3693        req_builder = req_builder.bearer_auth(token.to_owned());
3694    };
3695
3696    let req = req_builder.build()?;
3697    let resp = configuration.client.execute(req).await?;
3698
3699    let status = resp.status();
3700    let content_type = resp
3701        .headers()
3702        .get("content-type")
3703        .and_then(|v| v.to_str().ok())
3704        .unwrap_or("application/octet-stream");
3705    let content_type = super::ContentType::from(content_type);
3706
3707    if !status.is_client_error() && !status.is_server_error() {
3708        let content = resp.text().await?;
3709        match content_type {
3710            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3711            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
3712            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
3713        }
3714    } else {
3715        let content = resp.text().await?;
3716        let entity: Option<PropertymappingsProviderSamlUsedByListError> = serde_json::from_str(&content).ok();
3717        Err(Error::ResponseError(ResponseContent {
3718            status,
3719            content,
3720            entity,
3721        }))
3722    }
3723}
3724
3725/// SCIMMapping Viewset
3726pub async fn propertymappings_provider_scim_create(
3727    configuration: &configuration::Configuration,
3728    scim_mapping_request: models::ScimMappingRequest,
3729) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimCreateError>> {
3730    // add a prefix to parameters to efficiently prevent name collisions
3731    let p_body_scim_mapping_request = scim_mapping_request;
3732
3733    let uri_str = format!("{}/propertymappings/provider/scim/", configuration.base_path);
3734    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
3735
3736    if let Some(ref user_agent) = configuration.user_agent {
3737        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3738    }
3739    if let Some(ref token) = configuration.bearer_access_token {
3740        req_builder = req_builder.bearer_auth(token.to_owned());
3741    };
3742    req_builder = req_builder.json(&p_body_scim_mapping_request);
3743
3744    let req = req_builder.build()?;
3745    let resp = configuration.client.execute(req).await?;
3746
3747    let status = resp.status();
3748    let content_type = resp
3749        .headers()
3750        .get("content-type")
3751        .and_then(|v| v.to_str().ok())
3752        .unwrap_or("application/octet-stream");
3753    let content_type = super::ContentType::from(content_type);
3754
3755    if !status.is_client_error() && !status.is_server_error() {
3756        let content = resp.text().await?;
3757        match content_type {
3758            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3759            ContentType::Text => {
3760                return Err(Error::from(serde_json::Error::custom(
3761                    "Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
3762                )))
3763            }
3764            ContentType::Unsupported(unknown_type) => {
3765                return Err(Error::from(serde_json::Error::custom(format!(
3766                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
3767                ))))
3768            }
3769        }
3770    } else {
3771        let content = resp.text().await?;
3772        let entity: Option<PropertymappingsProviderScimCreateError> = serde_json::from_str(&content).ok();
3773        Err(Error::ResponseError(ResponseContent {
3774            status,
3775            content,
3776            entity,
3777        }))
3778    }
3779}
3780
3781/// SCIMMapping Viewset
3782pub async fn propertymappings_provider_scim_destroy(
3783    configuration: &configuration::Configuration,
3784    pm_uuid: &str,
3785) -> Result<(), Error<PropertymappingsProviderScimDestroyError>> {
3786    // add a prefix to parameters to efficiently prevent name collisions
3787    let p_path_pm_uuid = pm_uuid;
3788
3789    let uri_str = format!(
3790        "{}/propertymappings/provider/scim/{pm_uuid}/",
3791        configuration.base_path,
3792        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3793    );
3794    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
3795
3796    if let Some(ref user_agent) = configuration.user_agent {
3797        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3798    }
3799    if let Some(ref token) = configuration.bearer_access_token {
3800        req_builder = req_builder.bearer_auth(token.to_owned());
3801    };
3802
3803    let req = req_builder.build()?;
3804    let resp = configuration.client.execute(req).await?;
3805
3806    let status = resp.status();
3807
3808    if !status.is_client_error() && !status.is_server_error() {
3809        Ok(())
3810    } else {
3811        let content = resp.text().await?;
3812        let entity: Option<PropertymappingsProviderScimDestroyError> = serde_json::from_str(&content).ok();
3813        Err(Error::ResponseError(ResponseContent {
3814            status,
3815            content,
3816            entity,
3817        }))
3818    }
3819}
3820
3821/// SCIMMapping Viewset
3822pub async fn propertymappings_provider_scim_list(
3823    configuration: &configuration::Configuration,
3824    managed: Option<Vec<String>>,
3825    managed__isnull: Option<bool>,
3826    name: Option<&str>,
3827    ordering: Option<&str>,
3828    page: Option<i32>,
3829    page_size: Option<i32>,
3830    search: Option<&str>,
3831) -> Result<models::PaginatedScimMappingList, Error<PropertymappingsProviderScimListError>> {
3832    // add a prefix to parameters to efficiently prevent name collisions
3833    let p_query_managed = managed;
3834    let p_query_managed__isnull = managed__isnull;
3835    let p_query_name = name;
3836    let p_query_ordering = ordering;
3837    let p_query_page = page;
3838    let p_query_page_size = page_size;
3839    let p_query_search = search;
3840
3841    let uri_str = format!("{}/propertymappings/provider/scim/", configuration.base_path);
3842    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3843
3844    if let Some(ref param_value) = p_query_managed {
3845        req_builder = match "multi" {
3846            "multi" => req_builder.query(
3847                &param_value
3848                    .into_iter()
3849                    .map(|p| ("managed".to_owned(), p.to_string()))
3850                    .collect::<Vec<(std::string::String, std::string::String)>>(),
3851            ),
3852            _ => req_builder.query(&[(
3853                "managed",
3854                &param_value
3855                    .into_iter()
3856                    .map(|p| p.to_string())
3857                    .collect::<Vec<String>>()
3858                    .join(",")
3859                    .to_string(),
3860            )]),
3861        };
3862    }
3863    if let Some(ref param_value) = p_query_managed__isnull {
3864        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
3865    }
3866    if let Some(ref param_value) = p_query_name {
3867        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
3868    }
3869    if let Some(ref param_value) = p_query_ordering {
3870        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
3871    }
3872    if let Some(ref param_value) = p_query_page {
3873        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
3874    }
3875    if let Some(ref param_value) = p_query_page_size {
3876        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
3877    }
3878    if let Some(ref param_value) = p_query_search {
3879        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
3880    }
3881    if let Some(ref user_agent) = configuration.user_agent {
3882        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3883    }
3884    if let Some(ref token) = configuration.bearer_access_token {
3885        req_builder = req_builder.bearer_auth(token.to_owned());
3886    };
3887
3888    let req = req_builder.build()?;
3889    let resp = configuration.client.execute(req).await?;
3890
3891    let status = resp.status();
3892    let content_type = resp
3893        .headers()
3894        .get("content-type")
3895        .and_then(|v| v.to_str().ok())
3896        .unwrap_or("application/octet-stream");
3897    let content_type = super::ContentType::from(content_type);
3898
3899    if !status.is_client_error() && !status.is_server_error() {
3900        let content = resp.text().await?;
3901        match content_type {
3902            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3903            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimMappingList`"))),
3904            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::PaginatedScimMappingList`")))),
3905        }
3906    } else {
3907        let content = resp.text().await?;
3908        let entity: Option<PropertymappingsProviderScimListError> = serde_json::from_str(&content).ok();
3909        Err(Error::ResponseError(ResponseContent {
3910            status,
3911            content,
3912            entity,
3913        }))
3914    }
3915}
3916
3917/// SCIMMapping Viewset
3918pub async fn propertymappings_provider_scim_partial_update(
3919    configuration: &configuration::Configuration,
3920    pm_uuid: &str,
3921    patched_scim_mapping_request: Option<models::PatchedScimMappingRequest>,
3922) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimPartialUpdateError>> {
3923    // add a prefix to parameters to efficiently prevent name collisions
3924    let p_path_pm_uuid = pm_uuid;
3925    let p_body_patched_scim_mapping_request = patched_scim_mapping_request;
3926
3927    let uri_str = format!(
3928        "{}/propertymappings/provider/scim/{pm_uuid}/",
3929        configuration.base_path,
3930        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3931    );
3932    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
3933
3934    if let Some(ref user_agent) = configuration.user_agent {
3935        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3936    }
3937    if let Some(ref token) = configuration.bearer_access_token {
3938        req_builder = req_builder.bearer_auth(token.to_owned());
3939    };
3940    req_builder = req_builder.json(&p_body_patched_scim_mapping_request);
3941
3942    let req = req_builder.build()?;
3943    let resp = configuration.client.execute(req).await?;
3944
3945    let status = resp.status();
3946    let content_type = resp
3947        .headers()
3948        .get("content-type")
3949        .and_then(|v| v.to_str().ok())
3950        .unwrap_or("application/octet-stream");
3951    let content_type = super::ContentType::from(content_type);
3952
3953    if !status.is_client_error() && !status.is_server_error() {
3954        let content = resp.text().await?;
3955        match content_type {
3956            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
3957            ContentType::Text => {
3958                return Err(Error::from(serde_json::Error::custom(
3959                    "Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
3960                )))
3961            }
3962            ContentType::Unsupported(unknown_type) => {
3963                return Err(Error::from(serde_json::Error::custom(format!(
3964                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
3965                ))))
3966            }
3967        }
3968    } else {
3969        let content = resp.text().await?;
3970        let entity: Option<PropertymappingsProviderScimPartialUpdateError> = serde_json::from_str(&content).ok();
3971        Err(Error::ResponseError(ResponseContent {
3972            status,
3973            content,
3974            entity,
3975        }))
3976    }
3977}
3978
3979/// SCIMMapping Viewset
3980pub async fn propertymappings_provider_scim_retrieve(
3981    configuration: &configuration::Configuration,
3982    pm_uuid: &str,
3983) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimRetrieveError>> {
3984    // add a prefix to parameters to efficiently prevent name collisions
3985    let p_path_pm_uuid = pm_uuid;
3986
3987    let uri_str = format!(
3988        "{}/propertymappings/provider/scim/{pm_uuid}/",
3989        configuration.base_path,
3990        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
3991    );
3992    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
3993
3994    if let Some(ref user_agent) = configuration.user_agent {
3995        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
3996    }
3997    if let Some(ref token) = configuration.bearer_access_token {
3998        req_builder = req_builder.bearer_auth(token.to_owned());
3999    };
4000
4001    let req = req_builder.build()?;
4002    let resp = configuration.client.execute(req).await?;
4003
4004    let status = resp.status();
4005    let content_type = resp
4006        .headers()
4007        .get("content-type")
4008        .and_then(|v| v.to_str().ok())
4009        .unwrap_or("application/octet-stream");
4010    let content_type = super::ContentType::from(content_type);
4011
4012    if !status.is_client_error() && !status.is_server_error() {
4013        let content = resp.text().await?;
4014        match content_type {
4015            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4016            ContentType::Text => {
4017                return Err(Error::from(serde_json::Error::custom(
4018                    "Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
4019                )))
4020            }
4021            ContentType::Unsupported(unknown_type) => {
4022                return Err(Error::from(serde_json::Error::custom(format!(
4023                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
4024                ))))
4025            }
4026        }
4027    } else {
4028        let content = resp.text().await?;
4029        let entity: Option<PropertymappingsProviderScimRetrieveError> = serde_json::from_str(&content).ok();
4030        Err(Error::ResponseError(ResponseContent {
4031            status,
4032            content,
4033            entity,
4034        }))
4035    }
4036}
4037
4038/// SCIMMapping Viewset
4039pub async fn propertymappings_provider_scim_update(
4040    configuration: &configuration::Configuration,
4041    pm_uuid: &str,
4042    scim_mapping_request: models::ScimMappingRequest,
4043) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimUpdateError>> {
4044    // add a prefix to parameters to efficiently prevent name collisions
4045    let p_path_pm_uuid = pm_uuid;
4046    let p_body_scim_mapping_request = scim_mapping_request;
4047
4048    let uri_str = format!(
4049        "{}/propertymappings/provider/scim/{pm_uuid}/",
4050        configuration.base_path,
4051        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4052    );
4053    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4054
4055    if let Some(ref user_agent) = configuration.user_agent {
4056        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4057    }
4058    if let Some(ref token) = configuration.bearer_access_token {
4059        req_builder = req_builder.bearer_auth(token.to_owned());
4060    };
4061    req_builder = req_builder.json(&p_body_scim_mapping_request);
4062
4063    let req = req_builder.build()?;
4064    let resp = configuration.client.execute(req).await?;
4065
4066    let status = resp.status();
4067    let content_type = resp
4068        .headers()
4069        .get("content-type")
4070        .and_then(|v| v.to_str().ok())
4071        .unwrap_or("application/octet-stream");
4072    let content_type = super::ContentType::from(content_type);
4073
4074    if !status.is_client_error() && !status.is_server_error() {
4075        let content = resp.text().await?;
4076        match content_type {
4077            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4078            ContentType::Text => {
4079                return Err(Error::from(serde_json::Error::custom(
4080                    "Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
4081                )))
4082            }
4083            ContentType::Unsupported(unknown_type) => {
4084                return Err(Error::from(serde_json::Error::custom(format!(
4085                    "Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
4086                ))))
4087            }
4088        }
4089    } else {
4090        let content = resp.text().await?;
4091        let entity: Option<PropertymappingsProviderScimUpdateError> = serde_json::from_str(&content).ok();
4092        Err(Error::ResponseError(ResponseContent {
4093            status,
4094            content,
4095            entity,
4096        }))
4097    }
4098}
4099
4100/// Get a list of all objects that use this object
4101pub async fn propertymappings_provider_scim_used_by_list(
4102    configuration: &configuration::Configuration,
4103    pm_uuid: &str,
4104) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderScimUsedByListError>> {
4105    // add a prefix to parameters to efficiently prevent name collisions
4106    let p_path_pm_uuid = pm_uuid;
4107
4108    let uri_str = format!(
4109        "{}/propertymappings/provider/scim/{pm_uuid}/used_by/",
4110        configuration.base_path,
4111        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4112    );
4113    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4114
4115    if let Some(ref user_agent) = configuration.user_agent {
4116        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4117    }
4118    if let Some(ref token) = configuration.bearer_access_token {
4119        req_builder = req_builder.bearer_auth(token.to_owned());
4120    };
4121
4122    let req = req_builder.build()?;
4123    let resp = configuration.client.execute(req).await?;
4124
4125    let status = resp.status();
4126    let content_type = resp
4127        .headers()
4128        .get("content-type")
4129        .and_then(|v| v.to_str().ok())
4130        .unwrap_or("application/octet-stream");
4131    let content_type = super::ContentType::from(content_type);
4132
4133    if !status.is_client_error() && !status.is_server_error() {
4134        let content = resp.text().await?;
4135        match content_type {
4136            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4137            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
4138            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
4139        }
4140    } else {
4141        let content = resp.text().await?;
4142        let entity: Option<PropertymappingsProviderScimUsedByListError> = serde_json::from_str(&content).ok();
4143        Err(Error::ResponseError(ResponseContent {
4144            status,
4145            content,
4146            entity,
4147        }))
4148    }
4149}
4150
4151/// ScopeMapping Viewset
4152pub async fn propertymappings_provider_scope_create(
4153    configuration: &configuration::Configuration,
4154    scope_mapping_request: models::ScopeMappingRequest,
4155) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopeCreateError>> {
4156    // add a prefix to parameters to efficiently prevent name collisions
4157    let p_body_scope_mapping_request = scope_mapping_request;
4158
4159    let uri_str = format!("{}/propertymappings/provider/scope/", configuration.base_path);
4160    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4161
4162    if let Some(ref user_agent) = configuration.user_agent {
4163        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4164    }
4165    if let Some(ref token) = configuration.bearer_access_token {
4166        req_builder = req_builder.bearer_auth(token.to_owned());
4167    };
4168    req_builder = req_builder.json(&p_body_scope_mapping_request);
4169
4170    let req = req_builder.build()?;
4171    let resp = configuration.client.execute(req).await?;
4172
4173    let status = resp.status();
4174    let content_type = resp
4175        .headers()
4176        .get("content-type")
4177        .and_then(|v| v.to_str().ok())
4178        .unwrap_or("application/octet-stream");
4179    let content_type = super::ContentType::from(content_type);
4180
4181    if !status.is_client_error() && !status.is_server_error() {
4182        let content = resp.text().await?;
4183        match content_type {
4184            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4185            ContentType::Text => {
4186                return Err(Error::from(serde_json::Error::custom(
4187                    "Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
4188                )))
4189            }
4190            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4191                "Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
4192            )))),
4193        }
4194    } else {
4195        let content = resp.text().await?;
4196        let entity: Option<PropertymappingsProviderScopeCreateError> = serde_json::from_str(&content).ok();
4197        Err(Error::ResponseError(ResponseContent {
4198            status,
4199            content,
4200            entity,
4201        }))
4202    }
4203}
4204
4205/// ScopeMapping Viewset
4206pub async fn propertymappings_provider_scope_destroy(
4207    configuration: &configuration::Configuration,
4208    pm_uuid: &str,
4209) -> Result<(), Error<PropertymappingsProviderScopeDestroyError>> {
4210    // add a prefix to parameters to efficiently prevent name collisions
4211    let p_path_pm_uuid = pm_uuid;
4212
4213    let uri_str = format!(
4214        "{}/propertymappings/provider/scope/{pm_uuid}/",
4215        configuration.base_path,
4216        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4217    );
4218    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4219
4220    if let Some(ref user_agent) = configuration.user_agent {
4221        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4222    }
4223    if let Some(ref token) = configuration.bearer_access_token {
4224        req_builder = req_builder.bearer_auth(token.to_owned());
4225    };
4226
4227    let req = req_builder.build()?;
4228    let resp = configuration.client.execute(req).await?;
4229
4230    let status = resp.status();
4231
4232    if !status.is_client_error() && !status.is_server_error() {
4233        Ok(())
4234    } else {
4235        let content = resp.text().await?;
4236        let entity: Option<PropertymappingsProviderScopeDestroyError> = serde_json::from_str(&content).ok();
4237        Err(Error::ResponseError(ResponseContent {
4238            status,
4239            content,
4240            entity,
4241        }))
4242    }
4243}
4244
4245/// ScopeMapping Viewset
4246pub async fn propertymappings_provider_scope_list(
4247    configuration: &configuration::Configuration,
4248    managed: Option<Vec<String>>,
4249    managed__isnull: Option<bool>,
4250    name: Option<&str>,
4251    ordering: Option<&str>,
4252    page: Option<i32>,
4253    page_size: Option<i32>,
4254    scope_name: Option<&str>,
4255    search: Option<&str>,
4256) -> Result<models::PaginatedScopeMappingList, Error<PropertymappingsProviderScopeListError>> {
4257    // add a prefix to parameters to efficiently prevent name collisions
4258    let p_query_managed = managed;
4259    let p_query_managed__isnull = managed__isnull;
4260    let p_query_name = name;
4261    let p_query_ordering = ordering;
4262    let p_query_page = page;
4263    let p_query_page_size = page_size;
4264    let p_query_scope_name = scope_name;
4265    let p_query_search = search;
4266
4267    let uri_str = format!("{}/propertymappings/provider/scope/", configuration.base_path);
4268    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4269
4270    if let Some(ref param_value) = p_query_managed {
4271        req_builder = match "multi" {
4272            "multi" => req_builder.query(
4273                &param_value
4274                    .into_iter()
4275                    .map(|p| ("managed".to_owned(), p.to_string()))
4276                    .collect::<Vec<(std::string::String, std::string::String)>>(),
4277            ),
4278            _ => req_builder.query(&[(
4279                "managed",
4280                &param_value
4281                    .into_iter()
4282                    .map(|p| p.to_string())
4283                    .collect::<Vec<String>>()
4284                    .join(",")
4285                    .to_string(),
4286            )]),
4287        };
4288    }
4289    if let Some(ref param_value) = p_query_managed__isnull {
4290        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
4291    }
4292    if let Some(ref param_value) = p_query_name {
4293        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
4294    }
4295    if let Some(ref param_value) = p_query_ordering {
4296        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4297    }
4298    if let Some(ref param_value) = p_query_page {
4299        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4300    }
4301    if let Some(ref param_value) = p_query_page_size {
4302        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4303    }
4304    if let Some(ref param_value) = p_query_scope_name {
4305        req_builder = req_builder.query(&[("scope_name", &param_value.to_string())]);
4306    }
4307    if let Some(ref param_value) = p_query_search {
4308        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4309    }
4310    if let Some(ref user_agent) = configuration.user_agent {
4311        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4312    }
4313    if let Some(ref token) = configuration.bearer_access_token {
4314        req_builder = req_builder.bearer_auth(token.to_owned());
4315    };
4316
4317    let req = req_builder.build()?;
4318    let resp = configuration.client.execute(req).await?;
4319
4320    let status = resp.status();
4321    let content_type = resp
4322        .headers()
4323        .get("content-type")
4324        .and_then(|v| v.to_str().ok())
4325        .unwrap_or("application/octet-stream");
4326    let content_type = super::ContentType::from(content_type);
4327
4328    if !status.is_client_error() && !status.is_server_error() {
4329        let content = resp.text().await?;
4330        match content_type {
4331            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4332            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScopeMappingList`"))),
4333            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::PaginatedScopeMappingList`")))),
4334        }
4335    } else {
4336        let content = resp.text().await?;
4337        let entity: Option<PropertymappingsProviderScopeListError> = serde_json::from_str(&content).ok();
4338        Err(Error::ResponseError(ResponseContent {
4339            status,
4340            content,
4341            entity,
4342        }))
4343    }
4344}
4345
4346/// ScopeMapping Viewset
4347pub async fn propertymappings_provider_scope_partial_update(
4348    configuration: &configuration::Configuration,
4349    pm_uuid: &str,
4350    patched_scope_mapping_request: Option<models::PatchedScopeMappingRequest>,
4351) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopePartialUpdateError>> {
4352    // add a prefix to parameters to efficiently prevent name collisions
4353    let p_path_pm_uuid = pm_uuid;
4354    let p_body_patched_scope_mapping_request = patched_scope_mapping_request;
4355
4356    let uri_str = format!(
4357        "{}/propertymappings/provider/scope/{pm_uuid}/",
4358        configuration.base_path,
4359        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4360    );
4361    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4362
4363    if let Some(ref user_agent) = configuration.user_agent {
4364        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4365    }
4366    if let Some(ref token) = configuration.bearer_access_token {
4367        req_builder = req_builder.bearer_auth(token.to_owned());
4368    };
4369    req_builder = req_builder.json(&p_body_patched_scope_mapping_request);
4370
4371    let req = req_builder.build()?;
4372    let resp = configuration.client.execute(req).await?;
4373
4374    let status = resp.status();
4375    let content_type = resp
4376        .headers()
4377        .get("content-type")
4378        .and_then(|v| v.to_str().ok())
4379        .unwrap_or("application/octet-stream");
4380    let content_type = super::ContentType::from(content_type);
4381
4382    if !status.is_client_error() && !status.is_server_error() {
4383        let content = resp.text().await?;
4384        match content_type {
4385            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4386            ContentType::Text => {
4387                return Err(Error::from(serde_json::Error::custom(
4388                    "Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
4389                )))
4390            }
4391            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4392                "Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
4393            )))),
4394        }
4395    } else {
4396        let content = resp.text().await?;
4397        let entity: Option<PropertymappingsProviderScopePartialUpdateError> = serde_json::from_str(&content).ok();
4398        Err(Error::ResponseError(ResponseContent {
4399            status,
4400            content,
4401            entity,
4402        }))
4403    }
4404}
4405
4406/// ScopeMapping Viewset
4407pub async fn propertymappings_provider_scope_retrieve(
4408    configuration: &configuration::Configuration,
4409    pm_uuid: &str,
4410) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopeRetrieveError>> {
4411    // add a prefix to parameters to efficiently prevent name collisions
4412    let p_path_pm_uuid = pm_uuid;
4413
4414    let uri_str = format!(
4415        "{}/propertymappings/provider/scope/{pm_uuid}/",
4416        configuration.base_path,
4417        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4418    );
4419    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4420
4421    if let Some(ref user_agent) = configuration.user_agent {
4422        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4423    }
4424    if let Some(ref token) = configuration.bearer_access_token {
4425        req_builder = req_builder.bearer_auth(token.to_owned());
4426    };
4427
4428    let req = req_builder.build()?;
4429    let resp = configuration.client.execute(req).await?;
4430
4431    let status = resp.status();
4432    let content_type = resp
4433        .headers()
4434        .get("content-type")
4435        .and_then(|v| v.to_str().ok())
4436        .unwrap_or("application/octet-stream");
4437    let content_type = super::ContentType::from(content_type);
4438
4439    if !status.is_client_error() && !status.is_server_error() {
4440        let content = resp.text().await?;
4441        match content_type {
4442            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4443            ContentType::Text => {
4444                return Err(Error::from(serde_json::Error::custom(
4445                    "Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
4446                )))
4447            }
4448            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4449                "Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
4450            )))),
4451        }
4452    } else {
4453        let content = resp.text().await?;
4454        let entity: Option<PropertymappingsProviderScopeRetrieveError> = serde_json::from_str(&content).ok();
4455        Err(Error::ResponseError(ResponseContent {
4456            status,
4457            content,
4458            entity,
4459        }))
4460    }
4461}
4462
4463/// ScopeMapping Viewset
4464pub async fn propertymappings_provider_scope_update(
4465    configuration: &configuration::Configuration,
4466    pm_uuid: &str,
4467    scope_mapping_request: models::ScopeMappingRequest,
4468) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopeUpdateError>> {
4469    // add a prefix to parameters to efficiently prevent name collisions
4470    let p_path_pm_uuid = pm_uuid;
4471    let p_body_scope_mapping_request = scope_mapping_request;
4472
4473    let uri_str = format!(
4474        "{}/propertymappings/provider/scope/{pm_uuid}/",
4475        configuration.base_path,
4476        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4477    );
4478    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4479
4480    if let Some(ref user_agent) = configuration.user_agent {
4481        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4482    }
4483    if let Some(ref token) = configuration.bearer_access_token {
4484        req_builder = req_builder.bearer_auth(token.to_owned());
4485    };
4486    req_builder = req_builder.json(&p_body_scope_mapping_request);
4487
4488    let req = req_builder.build()?;
4489    let resp = configuration.client.execute(req).await?;
4490
4491    let status = resp.status();
4492    let content_type = resp
4493        .headers()
4494        .get("content-type")
4495        .and_then(|v| v.to_str().ok())
4496        .unwrap_or("application/octet-stream");
4497    let content_type = super::ContentType::from(content_type);
4498
4499    if !status.is_client_error() && !status.is_server_error() {
4500        let content = resp.text().await?;
4501        match content_type {
4502            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4503            ContentType::Text => {
4504                return Err(Error::from(serde_json::Error::custom(
4505                    "Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
4506                )))
4507            }
4508            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
4509                "Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
4510            )))),
4511        }
4512    } else {
4513        let content = resp.text().await?;
4514        let entity: Option<PropertymappingsProviderScopeUpdateError> = serde_json::from_str(&content).ok();
4515        Err(Error::ResponseError(ResponseContent {
4516            status,
4517            content,
4518            entity,
4519        }))
4520    }
4521}
4522
4523/// Get a list of all objects that use this object
4524pub async fn propertymappings_provider_scope_used_by_list(
4525    configuration: &configuration::Configuration,
4526    pm_uuid: &str,
4527) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderScopeUsedByListError>> {
4528    // add a prefix to parameters to efficiently prevent name collisions
4529    let p_path_pm_uuid = pm_uuid;
4530
4531    let uri_str = format!(
4532        "{}/propertymappings/provider/scope/{pm_uuid}/used_by/",
4533        configuration.base_path,
4534        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4535    );
4536    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4537
4538    if let Some(ref user_agent) = configuration.user_agent {
4539        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4540    }
4541    if let Some(ref token) = configuration.bearer_access_token {
4542        req_builder = req_builder.bearer_auth(token.to_owned());
4543    };
4544
4545    let req = req_builder.build()?;
4546    let resp = configuration.client.execute(req).await?;
4547
4548    let status = resp.status();
4549    let content_type = resp
4550        .headers()
4551        .get("content-type")
4552        .and_then(|v| v.to_str().ok())
4553        .unwrap_or("application/octet-stream");
4554    let content_type = super::ContentType::from(content_type);
4555
4556    if !status.is_client_error() && !status.is_server_error() {
4557        let content = resp.text().await?;
4558        match content_type {
4559            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4560            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
4561            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
4562        }
4563    } else {
4564        let content = resp.text().await?;
4565        let entity: Option<PropertymappingsProviderScopeUsedByListError> = serde_json::from_str(&content).ok();
4566        Err(Error::ResponseError(ResponseContent {
4567            status,
4568            content,
4569            entity,
4570        }))
4571    }
4572}
4573
4574/// KerberosSource PropertyMapping Viewset
4575pub async fn propertymappings_source_kerberos_create(
4576    configuration: &configuration::Configuration,
4577    kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest,
4578) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosCreateError>> {
4579    // add a prefix to parameters to efficiently prevent name collisions
4580    let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request;
4581
4582    let uri_str = format!("{}/propertymappings/source/kerberos/", configuration.base_path);
4583    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4584
4585    if let Some(ref user_agent) = configuration.user_agent {
4586        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4587    }
4588    if let Some(ref token) = configuration.bearer_access_token {
4589        req_builder = req_builder.bearer_auth(token.to_owned());
4590    };
4591    req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request);
4592
4593    let req = req_builder.build()?;
4594    let resp = configuration.client.execute(req).await?;
4595
4596    let status = resp.status();
4597    let content_type = resp
4598        .headers()
4599        .get("content-type")
4600        .and_then(|v| v.to_str().ok())
4601        .unwrap_or("application/octet-stream");
4602    let content_type = super::ContentType::from(content_type);
4603
4604    if !status.is_client_error() && !status.is_server_error() {
4605        let content = resp.text().await?;
4606        match content_type {
4607            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4608            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
4609            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::KerberosSourcePropertyMapping`")))),
4610        }
4611    } else {
4612        let content = resp.text().await?;
4613        let entity: Option<PropertymappingsSourceKerberosCreateError> = serde_json::from_str(&content).ok();
4614        Err(Error::ResponseError(ResponseContent {
4615            status,
4616            content,
4617            entity,
4618        }))
4619    }
4620}
4621
4622/// KerberosSource PropertyMapping Viewset
4623pub async fn propertymappings_source_kerberos_destroy(
4624    configuration: &configuration::Configuration,
4625    pm_uuid: &str,
4626) -> Result<(), Error<PropertymappingsSourceKerberosDestroyError>> {
4627    // add a prefix to parameters to efficiently prevent name collisions
4628    let p_path_pm_uuid = pm_uuid;
4629
4630    let uri_str = format!(
4631        "{}/propertymappings/source/kerberos/{pm_uuid}/",
4632        configuration.base_path,
4633        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4634    );
4635    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
4636
4637    if let Some(ref user_agent) = configuration.user_agent {
4638        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4639    }
4640    if let Some(ref token) = configuration.bearer_access_token {
4641        req_builder = req_builder.bearer_auth(token.to_owned());
4642    };
4643
4644    let req = req_builder.build()?;
4645    let resp = configuration.client.execute(req).await?;
4646
4647    let status = resp.status();
4648
4649    if !status.is_client_error() && !status.is_server_error() {
4650        Ok(())
4651    } else {
4652        let content = resp.text().await?;
4653        let entity: Option<PropertymappingsSourceKerberosDestroyError> = serde_json::from_str(&content).ok();
4654        Err(Error::ResponseError(ResponseContent {
4655            status,
4656            content,
4657            entity,
4658        }))
4659    }
4660}
4661
4662/// KerberosSource PropertyMapping Viewset
4663pub async fn propertymappings_source_kerberos_list(
4664    configuration: &configuration::Configuration,
4665    managed: Option<Vec<String>>,
4666    managed__isnull: Option<bool>,
4667    name: Option<&str>,
4668    ordering: Option<&str>,
4669    page: Option<i32>,
4670    page_size: Option<i32>,
4671    search: Option<&str>,
4672) -> Result<models::PaginatedKerberosSourcePropertyMappingList, Error<PropertymappingsSourceKerberosListError>> {
4673    // add a prefix to parameters to efficiently prevent name collisions
4674    let p_query_managed = managed;
4675    let p_query_managed__isnull = managed__isnull;
4676    let p_query_name = name;
4677    let p_query_ordering = ordering;
4678    let p_query_page = page;
4679    let p_query_page_size = page_size;
4680    let p_query_search = search;
4681
4682    let uri_str = format!("{}/propertymappings/source/kerberos/", configuration.base_path);
4683    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4684
4685    if let Some(ref param_value) = p_query_managed {
4686        req_builder = match "multi" {
4687            "multi" => req_builder.query(
4688                &param_value
4689                    .into_iter()
4690                    .map(|p| ("managed".to_owned(), p.to_string()))
4691                    .collect::<Vec<(std::string::String, std::string::String)>>(),
4692            ),
4693            _ => req_builder.query(&[(
4694                "managed",
4695                &param_value
4696                    .into_iter()
4697                    .map(|p| p.to_string())
4698                    .collect::<Vec<String>>()
4699                    .join(",")
4700                    .to_string(),
4701            )]),
4702        };
4703    }
4704    if let Some(ref param_value) = p_query_managed__isnull {
4705        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
4706    }
4707    if let Some(ref param_value) = p_query_name {
4708        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
4709    }
4710    if let Some(ref param_value) = p_query_ordering {
4711        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
4712    }
4713    if let Some(ref param_value) = p_query_page {
4714        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
4715    }
4716    if let Some(ref param_value) = p_query_page_size {
4717        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
4718    }
4719    if let Some(ref param_value) = p_query_search {
4720        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
4721    }
4722    if let Some(ref user_agent) = configuration.user_agent {
4723        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4724    }
4725    if let Some(ref token) = configuration.bearer_access_token {
4726        req_builder = req_builder.bearer_auth(token.to_owned());
4727    };
4728
4729    let req = req_builder.build()?;
4730    let resp = configuration.client.execute(req).await?;
4731
4732    let status = resp.status();
4733    let content_type = resp
4734        .headers()
4735        .get("content-type")
4736        .and_then(|v| v.to_str().ok())
4737        .unwrap_or("application/octet-stream");
4738    let content_type = super::ContentType::from(content_type);
4739
4740    if !status.is_client_error() && !status.is_server_error() {
4741        let content = resp.text().await?;
4742        match content_type {
4743            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4744            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedKerberosSourcePropertyMappingList`"))),
4745            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::PaginatedKerberosSourcePropertyMappingList`")))),
4746        }
4747    } else {
4748        let content = resp.text().await?;
4749        let entity: Option<PropertymappingsSourceKerberosListError> = serde_json::from_str(&content).ok();
4750        Err(Error::ResponseError(ResponseContent {
4751            status,
4752            content,
4753            entity,
4754        }))
4755    }
4756}
4757
4758/// KerberosSource PropertyMapping Viewset
4759pub async fn propertymappings_source_kerberos_partial_update(
4760    configuration: &configuration::Configuration,
4761    pm_uuid: &str,
4762    patched_kerberos_source_property_mapping_request: Option<models::PatchedKerberosSourcePropertyMappingRequest>,
4763) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosPartialUpdateError>> {
4764    // add a prefix to parameters to efficiently prevent name collisions
4765    let p_path_pm_uuid = pm_uuid;
4766    let p_body_patched_kerberos_source_property_mapping_request = patched_kerberos_source_property_mapping_request;
4767
4768    let uri_str = format!(
4769        "{}/propertymappings/source/kerberos/{pm_uuid}/",
4770        configuration.base_path,
4771        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4772    );
4773    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
4774
4775    if let Some(ref user_agent) = configuration.user_agent {
4776        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4777    }
4778    if let Some(ref token) = configuration.bearer_access_token {
4779        req_builder = req_builder.bearer_auth(token.to_owned());
4780    };
4781    req_builder = req_builder.json(&p_body_patched_kerberos_source_property_mapping_request);
4782
4783    let req = req_builder.build()?;
4784    let resp = configuration.client.execute(req).await?;
4785
4786    let status = resp.status();
4787    let content_type = resp
4788        .headers()
4789        .get("content-type")
4790        .and_then(|v| v.to_str().ok())
4791        .unwrap_or("application/octet-stream");
4792    let content_type = super::ContentType::from(content_type);
4793
4794    if !status.is_client_error() && !status.is_server_error() {
4795        let content = resp.text().await?;
4796        match content_type {
4797            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4798            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
4799            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::KerberosSourcePropertyMapping`")))),
4800        }
4801    } else {
4802        let content = resp.text().await?;
4803        let entity: Option<PropertymappingsSourceKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
4804        Err(Error::ResponseError(ResponseContent {
4805            status,
4806            content,
4807            entity,
4808        }))
4809    }
4810}
4811
4812/// KerberosSource PropertyMapping Viewset
4813pub async fn propertymappings_source_kerberos_retrieve(
4814    configuration: &configuration::Configuration,
4815    pm_uuid: &str,
4816) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosRetrieveError>> {
4817    // add a prefix to parameters to efficiently prevent name collisions
4818    let p_path_pm_uuid = pm_uuid;
4819
4820    let uri_str = format!(
4821        "{}/propertymappings/source/kerberos/{pm_uuid}/",
4822        configuration.base_path,
4823        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4824    );
4825    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4826
4827    if let Some(ref user_agent) = configuration.user_agent {
4828        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4829    }
4830    if let Some(ref token) = configuration.bearer_access_token {
4831        req_builder = req_builder.bearer_auth(token.to_owned());
4832    };
4833
4834    let req = req_builder.build()?;
4835    let resp = configuration.client.execute(req).await?;
4836
4837    let status = resp.status();
4838    let content_type = resp
4839        .headers()
4840        .get("content-type")
4841        .and_then(|v| v.to_str().ok())
4842        .unwrap_or("application/octet-stream");
4843    let content_type = super::ContentType::from(content_type);
4844
4845    if !status.is_client_error() && !status.is_server_error() {
4846        let content = resp.text().await?;
4847        match content_type {
4848            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4849            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
4850            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::KerberosSourcePropertyMapping`")))),
4851        }
4852    } else {
4853        let content = resp.text().await?;
4854        let entity: Option<PropertymappingsSourceKerberosRetrieveError> = serde_json::from_str(&content).ok();
4855        Err(Error::ResponseError(ResponseContent {
4856            status,
4857            content,
4858            entity,
4859        }))
4860    }
4861}
4862
4863/// KerberosSource PropertyMapping Viewset
4864pub async fn propertymappings_source_kerberos_update(
4865    configuration: &configuration::Configuration,
4866    pm_uuid: &str,
4867    kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest,
4868) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosUpdateError>> {
4869    // add a prefix to parameters to efficiently prevent name collisions
4870    let p_path_pm_uuid = pm_uuid;
4871    let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request;
4872
4873    let uri_str = format!(
4874        "{}/propertymappings/source/kerberos/{pm_uuid}/",
4875        configuration.base_path,
4876        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4877    );
4878    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
4879
4880    if let Some(ref user_agent) = configuration.user_agent {
4881        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4882    }
4883    if let Some(ref token) = configuration.bearer_access_token {
4884        req_builder = req_builder.bearer_auth(token.to_owned());
4885    };
4886    req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request);
4887
4888    let req = req_builder.build()?;
4889    let resp = configuration.client.execute(req).await?;
4890
4891    let status = resp.status();
4892    let content_type = resp
4893        .headers()
4894        .get("content-type")
4895        .and_then(|v| v.to_str().ok())
4896        .unwrap_or("application/octet-stream");
4897    let content_type = super::ContentType::from(content_type);
4898
4899    if !status.is_client_error() && !status.is_server_error() {
4900        let content = resp.text().await?;
4901        match content_type {
4902            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4903            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
4904            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::KerberosSourcePropertyMapping`")))),
4905        }
4906    } else {
4907        let content = resp.text().await?;
4908        let entity: Option<PropertymappingsSourceKerberosUpdateError> = serde_json::from_str(&content).ok();
4909        Err(Error::ResponseError(ResponseContent {
4910            status,
4911            content,
4912            entity,
4913        }))
4914    }
4915}
4916
4917/// Get a list of all objects that use this object
4918pub async fn propertymappings_source_kerberos_used_by_list(
4919    configuration: &configuration::Configuration,
4920    pm_uuid: &str,
4921) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceKerberosUsedByListError>> {
4922    // add a prefix to parameters to efficiently prevent name collisions
4923    let p_path_pm_uuid = pm_uuid;
4924
4925    let uri_str = format!(
4926        "{}/propertymappings/source/kerberos/{pm_uuid}/used_by/",
4927        configuration.base_path,
4928        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
4929    );
4930    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
4931
4932    if let Some(ref user_agent) = configuration.user_agent {
4933        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4934    }
4935    if let Some(ref token) = configuration.bearer_access_token {
4936        req_builder = req_builder.bearer_auth(token.to_owned());
4937    };
4938
4939    let req = req_builder.build()?;
4940    let resp = configuration.client.execute(req).await?;
4941
4942    let status = resp.status();
4943    let content_type = resp
4944        .headers()
4945        .get("content-type")
4946        .and_then(|v| v.to_str().ok())
4947        .unwrap_or("application/octet-stream");
4948    let content_type = super::ContentType::from(content_type);
4949
4950    if !status.is_client_error() && !status.is_server_error() {
4951        let content = resp.text().await?;
4952        match content_type {
4953            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
4954            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
4955            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
4956        }
4957    } else {
4958        let content = resp.text().await?;
4959        let entity: Option<PropertymappingsSourceKerberosUsedByListError> = serde_json::from_str(&content).ok();
4960        Err(Error::ResponseError(ResponseContent {
4961            status,
4962            content,
4963            entity,
4964        }))
4965    }
4966}
4967
4968/// LDAP PropertyMapping Viewset
4969pub async fn propertymappings_source_ldap_create(
4970    configuration: &configuration::Configuration,
4971    ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest,
4972) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapCreateError>> {
4973    // add a prefix to parameters to efficiently prevent name collisions
4974    let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request;
4975
4976    let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path);
4977    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
4978
4979    if let Some(ref user_agent) = configuration.user_agent {
4980        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
4981    }
4982    if let Some(ref token) = configuration.bearer_access_token {
4983        req_builder = req_builder.bearer_auth(token.to_owned());
4984    };
4985    req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request);
4986
4987    let req = req_builder.build()?;
4988    let resp = configuration.client.execute(req).await?;
4989
4990    let status = resp.status();
4991    let content_type = resp
4992        .headers()
4993        .get("content-type")
4994        .and_then(|v| v.to_str().ok())
4995        .unwrap_or("application/octet-stream");
4996    let content_type = super::ContentType::from(content_type);
4997
4998    if !status.is_client_error() && !status.is_server_error() {
4999        let content = resp.text().await?;
5000        match content_type {
5001            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5002            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
5003            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::LdapSourcePropertyMapping`")))),
5004        }
5005    } else {
5006        let content = resp.text().await?;
5007        let entity: Option<PropertymappingsSourceLdapCreateError> = serde_json::from_str(&content).ok();
5008        Err(Error::ResponseError(ResponseContent {
5009            status,
5010            content,
5011            entity,
5012        }))
5013    }
5014}
5015
5016/// LDAP PropertyMapping Viewset
5017pub async fn propertymappings_source_ldap_destroy(
5018    configuration: &configuration::Configuration,
5019    pm_uuid: &str,
5020) -> Result<(), Error<PropertymappingsSourceLdapDestroyError>> {
5021    // add a prefix to parameters to efficiently prevent name collisions
5022    let p_path_pm_uuid = pm_uuid;
5023
5024    let uri_str = format!(
5025        "{}/propertymappings/source/ldap/{pm_uuid}/",
5026        configuration.base_path,
5027        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5028    );
5029    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5030
5031    if let Some(ref user_agent) = configuration.user_agent {
5032        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5033    }
5034    if let Some(ref token) = configuration.bearer_access_token {
5035        req_builder = req_builder.bearer_auth(token.to_owned());
5036    };
5037
5038    let req = req_builder.build()?;
5039    let resp = configuration.client.execute(req).await?;
5040
5041    let status = resp.status();
5042
5043    if !status.is_client_error() && !status.is_server_error() {
5044        Ok(())
5045    } else {
5046        let content = resp.text().await?;
5047        let entity: Option<PropertymappingsSourceLdapDestroyError> = serde_json::from_str(&content).ok();
5048        Err(Error::ResponseError(ResponseContent {
5049            status,
5050            content,
5051            entity,
5052        }))
5053    }
5054}
5055
5056/// LDAP PropertyMapping Viewset
5057pub async fn propertymappings_source_ldap_list(
5058    configuration: &configuration::Configuration,
5059    managed: Option<Vec<String>>,
5060    managed__isnull: Option<bool>,
5061    name: Option<&str>,
5062    ordering: Option<&str>,
5063    page: Option<i32>,
5064    page_size: Option<i32>,
5065    search: Option<&str>,
5066) -> Result<models::PaginatedLdapSourcePropertyMappingList, Error<PropertymappingsSourceLdapListError>> {
5067    // add a prefix to parameters to efficiently prevent name collisions
5068    let p_query_managed = managed;
5069    let p_query_managed__isnull = managed__isnull;
5070    let p_query_name = name;
5071    let p_query_ordering = ordering;
5072    let p_query_page = page;
5073    let p_query_page_size = page_size;
5074    let p_query_search = search;
5075
5076    let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path);
5077    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5078
5079    if let Some(ref param_value) = p_query_managed {
5080        req_builder = match "multi" {
5081            "multi" => req_builder.query(
5082                &param_value
5083                    .into_iter()
5084                    .map(|p| ("managed".to_owned(), p.to_string()))
5085                    .collect::<Vec<(std::string::String, std::string::String)>>(),
5086            ),
5087            _ => req_builder.query(&[(
5088                "managed",
5089                &param_value
5090                    .into_iter()
5091                    .map(|p| p.to_string())
5092                    .collect::<Vec<String>>()
5093                    .join(",")
5094                    .to_string(),
5095            )]),
5096        };
5097    }
5098    if let Some(ref param_value) = p_query_managed__isnull {
5099        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
5100    }
5101    if let Some(ref param_value) = p_query_name {
5102        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5103    }
5104    if let Some(ref param_value) = p_query_ordering {
5105        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5106    }
5107    if let Some(ref param_value) = p_query_page {
5108        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5109    }
5110    if let Some(ref param_value) = p_query_page_size {
5111        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5112    }
5113    if let Some(ref param_value) = p_query_search {
5114        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5115    }
5116    if let Some(ref user_agent) = configuration.user_agent {
5117        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5118    }
5119    if let Some(ref token) = configuration.bearer_access_token {
5120        req_builder = req_builder.bearer_auth(token.to_owned());
5121    };
5122
5123    let req = req_builder.build()?;
5124    let resp = configuration.client.execute(req).await?;
5125
5126    let status = resp.status();
5127    let content_type = resp
5128        .headers()
5129        .get("content-type")
5130        .and_then(|v| v.to_str().ok())
5131        .unwrap_or("application/octet-stream");
5132    let content_type = super::ContentType::from(content_type);
5133
5134    if !status.is_client_error() && !status.is_server_error() {
5135        let content = resp.text().await?;
5136        match content_type {
5137            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5138            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedLdapSourcePropertyMappingList`"))),
5139            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::PaginatedLdapSourcePropertyMappingList`")))),
5140        }
5141    } else {
5142        let content = resp.text().await?;
5143        let entity: Option<PropertymappingsSourceLdapListError> = serde_json::from_str(&content).ok();
5144        Err(Error::ResponseError(ResponseContent {
5145            status,
5146            content,
5147            entity,
5148        }))
5149    }
5150}
5151
5152/// LDAP PropertyMapping Viewset
5153pub async fn propertymappings_source_ldap_partial_update(
5154    configuration: &configuration::Configuration,
5155    pm_uuid: &str,
5156    patched_ldap_source_property_mapping_request: Option<models::PatchedLdapSourcePropertyMappingRequest>,
5157) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapPartialUpdateError>> {
5158    // add a prefix to parameters to efficiently prevent name collisions
5159    let p_path_pm_uuid = pm_uuid;
5160    let p_body_patched_ldap_source_property_mapping_request = patched_ldap_source_property_mapping_request;
5161
5162    let uri_str = format!(
5163        "{}/propertymappings/source/ldap/{pm_uuid}/",
5164        configuration.base_path,
5165        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5166    );
5167    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5168
5169    if let Some(ref user_agent) = configuration.user_agent {
5170        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5171    }
5172    if let Some(ref token) = configuration.bearer_access_token {
5173        req_builder = req_builder.bearer_auth(token.to_owned());
5174    };
5175    req_builder = req_builder.json(&p_body_patched_ldap_source_property_mapping_request);
5176
5177    let req = req_builder.build()?;
5178    let resp = configuration.client.execute(req).await?;
5179
5180    let status = resp.status();
5181    let content_type = resp
5182        .headers()
5183        .get("content-type")
5184        .and_then(|v| v.to_str().ok())
5185        .unwrap_or("application/octet-stream");
5186    let content_type = super::ContentType::from(content_type);
5187
5188    if !status.is_client_error() && !status.is_server_error() {
5189        let content = resp.text().await?;
5190        match content_type {
5191            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5192            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
5193            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::LdapSourcePropertyMapping`")))),
5194        }
5195    } else {
5196        let content = resp.text().await?;
5197        let entity: Option<PropertymappingsSourceLdapPartialUpdateError> = serde_json::from_str(&content).ok();
5198        Err(Error::ResponseError(ResponseContent {
5199            status,
5200            content,
5201            entity,
5202        }))
5203    }
5204}
5205
5206/// LDAP PropertyMapping Viewset
5207pub async fn propertymappings_source_ldap_retrieve(
5208    configuration: &configuration::Configuration,
5209    pm_uuid: &str,
5210) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapRetrieveError>> {
5211    // add a prefix to parameters to efficiently prevent name collisions
5212    let p_path_pm_uuid = pm_uuid;
5213
5214    let uri_str = format!(
5215        "{}/propertymappings/source/ldap/{pm_uuid}/",
5216        configuration.base_path,
5217        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5218    );
5219    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5220
5221    if let Some(ref user_agent) = configuration.user_agent {
5222        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5223    }
5224    if let Some(ref token) = configuration.bearer_access_token {
5225        req_builder = req_builder.bearer_auth(token.to_owned());
5226    };
5227
5228    let req = req_builder.build()?;
5229    let resp = configuration.client.execute(req).await?;
5230
5231    let status = resp.status();
5232    let content_type = resp
5233        .headers()
5234        .get("content-type")
5235        .and_then(|v| v.to_str().ok())
5236        .unwrap_or("application/octet-stream");
5237    let content_type = super::ContentType::from(content_type);
5238
5239    if !status.is_client_error() && !status.is_server_error() {
5240        let content = resp.text().await?;
5241        match content_type {
5242            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5243            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
5244            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::LdapSourcePropertyMapping`")))),
5245        }
5246    } else {
5247        let content = resp.text().await?;
5248        let entity: Option<PropertymappingsSourceLdapRetrieveError> = serde_json::from_str(&content).ok();
5249        Err(Error::ResponseError(ResponseContent {
5250            status,
5251            content,
5252            entity,
5253        }))
5254    }
5255}
5256
5257/// LDAP PropertyMapping Viewset
5258pub async fn propertymappings_source_ldap_update(
5259    configuration: &configuration::Configuration,
5260    pm_uuid: &str,
5261    ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest,
5262) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapUpdateError>> {
5263    // add a prefix to parameters to efficiently prevent name collisions
5264    let p_path_pm_uuid = pm_uuid;
5265    let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request;
5266
5267    let uri_str = format!(
5268        "{}/propertymappings/source/ldap/{pm_uuid}/",
5269        configuration.base_path,
5270        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5271    );
5272    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5273
5274    if let Some(ref user_agent) = configuration.user_agent {
5275        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5276    }
5277    if let Some(ref token) = configuration.bearer_access_token {
5278        req_builder = req_builder.bearer_auth(token.to_owned());
5279    };
5280    req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request);
5281
5282    let req = req_builder.build()?;
5283    let resp = configuration.client.execute(req).await?;
5284
5285    let status = resp.status();
5286    let content_type = resp
5287        .headers()
5288        .get("content-type")
5289        .and_then(|v| v.to_str().ok())
5290        .unwrap_or("application/octet-stream");
5291    let content_type = super::ContentType::from(content_type);
5292
5293    if !status.is_client_error() && !status.is_server_error() {
5294        let content = resp.text().await?;
5295        match content_type {
5296            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5297            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
5298            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::LdapSourcePropertyMapping`")))),
5299        }
5300    } else {
5301        let content = resp.text().await?;
5302        let entity: Option<PropertymappingsSourceLdapUpdateError> = serde_json::from_str(&content).ok();
5303        Err(Error::ResponseError(ResponseContent {
5304            status,
5305            content,
5306            entity,
5307        }))
5308    }
5309}
5310
5311/// Get a list of all objects that use this object
5312pub async fn propertymappings_source_ldap_used_by_list(
5313    configuration: &configuration::Configuration,
5314    pm_uuid: &str,
5315) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceLdapUsedByListError>> {
5316    // add a prefix to parameters to efficiently prevent name collisions
5317    let p_path_pm_uuid = pm_uuid;
5318
5319    let uri_str = format!(
5320        "{}/propertymappings/source/ldap/{pm_uuid}/used_by/",
5321        configuration.base_path,
5322        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5323    );
5324    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5325
5326    if let Some(ref user_agent) = configuration.user_agent {
5327        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5328    }
5329    if let Some(ref token) = configuration.bearer_access_token {
5330        req_builder = req_builder.bearer_auth(token.to_owned());
5331    };
5332
5333    let req = req_builder.build()?;
5334    let resp = configuration.client.execute(req).await?;
5335
5336    let status = resp.status();
5337    let content_type = resp
5338        .headers()
5339        .get("content-type")
5340        .and_then(|v| v.to_str().ok())
5341        .unwrap_or("application/octet-stream");
5342    let content_type = super::ContentType::from(content_type);
5343
5344    if !status.is_client_error() && !status.is_server_error() {
5345        let content = resp.text().await?;
5346        match content_type {
5347            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5348            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
5349            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
5350        }
5351    } else {
5352        let content = resp.text().await?;
5353        let entity: Option<PropertymappingsSourceLdapUsedByListError> = serde_json::from_str(&content).ok();
5354        Err(Error::ResponseError(ResponseContent {
5355            status,
5356            content,
5357            entity,
5358        }))
5359    }
5360}
5361
5362/// OAuthSourcePropertyMapping Viewset
5363pub async fn propertymappings_source_oauth_create(
5364    configuration: &configuration::Configuration,
5365    o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest,
5366) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthCreateError>> {
5367    // add a prefix to parameters to efficiently prevent name collisions
5368    let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request;
5369
5370    let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path);
5371    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5372
5373    if let Some(ref user_agent) = configuration.user_agent {
5374        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5375    }
5376    if let Some(ref token) = configuration.bearer_access_token {
5377        req_builder = req_builder.bearer_auth(token.to_owned());
5378    };
5379    req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request);
5380
5381    let req = req_builder.build()?;
5382    let resp = configuration.client.execute(req).await?;
5383
5384    let status = resp.status();
5385    let content_type = resp
5386        .headers()
5387        .get("content-type")
5388        .and_then(|v| v.to_str().ok())
5389        .unwrap_or("application/octet-stream");
5390    let content_type = super::ContentType::from(content_type);
5391
5392    if !status.is_client_error() && !status.is_server_error() {
5393        let content = resp.text().await?;
5394        match content_type {
5395            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5396            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
5397            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::OAuthSourcePropertyMapping`")))),
5398        }
5399    } else {
5400        let content = resp.text().await?;
5401        let entity: Option<PropertymappingsSourceOauthCreateError> = serde_json::from_str(&content).ok();
5402        Err(Error::ResponseError(ResponseContent {
5403            status,
5404            content,
5405            entity,
5406        }))
5407    }
5408}
5409
5410/// OAuthSourcePropertyMapping Viewset
5411pub async fn propertymappings_source_oauth_destroy(
5412    configuration: &configuration::Configuration,
5413    pm_uuid: &str,
5414) -> Result<(), Error<PropertymappingsSourceOauthDestroyError>> {
5415    // add a prefix to parameters to efficiently prevent name collisions
5416    let p_path_pm_uuid = pm_uuid;
5417
5418    let uri_str = format!(
5419        "{}/propertymappings/source/oauth/{pm_uuid}/",
5420        configuration.base_path,
5421        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5422    );
5423    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5424
5425    if let Some(ref user_agent) = configuration.user_agent {
5426        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5427    }
5428    if let Some(ref token) = configuration.bearer_access_token {
5429        req_builder = req_builder.bearer_auth(token.to_owned());
5430    };
5431
5432    let req = req_builder.build()?;
5433    let resp = configuration.client.execute(req).await?;
5434
5435    let status = resp.status();
5436
5437    if !status.is_client_error() && !status.is_server_error() {
5438        Ok(())
5439    } else {
5440        let content = resp.text().await?;
5441        let entity: Option<PropertymappingsSourceOauthDestroyError> = serde_json::from_str(&content).ok();
5442        Err(Error::ResponseError(ResponseContent {
5443            status,
5444            content,
5445            entity,
5446        }))
5447    }
5448}
5449
5450/// OAuthSourcePropertyMapping Viewset
5451pub async fn propertymappings_source_oauth_list(
5452    configuration: &configuration::Configuration,
5453    managed: Option<Vec<String>>,
5454    managed__isnull: Option<bool>,
5455    name: Option<&str>,
5456    ordering: Option<&str>,
5457    page: Option<i32>,
5458    page_size: Option<i32>,
5459    search: Option<&str>,
5460) -> Result<models::PaginatedOAuthSourcePropertyMappingList, Error<PropertymappingsSourceOauthListError>> {
5461    // add a prefix to parameters to efficiently prevent name collisions
5462    let p_query_managed = managed;
5463    let p_query_managed__isnull = managed__isnull;
5464    let p_query_name = name;
5465    let p_query_ordering = ordering;
5466    let p_query_page = page;
5467    let p_query_page_size = page_size;
5468    let p_query_search = search;
5469
5470    let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path);
5471    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5472
5473    if let Some(ref param_value) = p_query_managed {
5474        req_builder = match "multi" {
5475            "multi" => req_builder.query(
5476                &param_value
5477                    .into_iter()
5478                    .map(|p| ("managed".to_owned(), p.to_string()))
5479                    .collect::<Vec<(std::string::String, std::string::String)>>(),
5480            ),
5481            _ => req_builder.query(&[(
5482                "managed",
5483                &param_value
5484                    .into_iter()
5485                    .map(|p| p.to_string())
5486                    .collect::<Vec<String>>()
5487                    .join(",")
5488                    .to_string(),
5489            )]),
5490        };
5491    }
5492    if let Some(ref param_value) = p_query_managed__isnull {
5493        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
5494    }
5495    if let Some(ref param_value) = p_query_name {
5496        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5497    }
5498    if let Some(ref param_value) = p_query_ordering {
5499        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5500    }
5501    if let Some(ref param_value) = p_query_page {
5502        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5503    }
5504    if let Some(ref param_value) = p_query_page_size {
5505        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5506    }
5507    if let Some(ref param_value) = p_query_search {
5508        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
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    let content_type = resp
5522        .headers()
5523        .get("content-type")
5524        .and_then(|v| v.to_str().ok())
5525        .unwrap_or("application/octet-stream");
5526    let content_type = super::ContentType::from(content_type);
5527
5528    if !status.is_client_error() && !status.is_server_error() {
5529        let content = resp.text().await?;
5530        match content_type {
5531            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5532            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedOAuthSourcePropertyMappingList`"))),
5533            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::PaginatedOAuthSourcePropertyMappingList`")))),
5534        }
5535    } else {
5536        let content = resp.text().await?;
5537        let entity: Option<PropertymappingsSourceOauthListError> = serde_json::from_str(&content).ok();
5538        Err(Error::ResponseError(ResponseContent {
5539            status,
5540            content,
5541            entity,
5542        }))
5543    }
5544}
5545
5546/// OAuthSourcePropertyMapping Viewset
5547pub async fn propertymappings_source_oauth_partial_update(
5548    configuration: &configuration::Configuration,
5549    pm_uuid: &str,
5550    patched_o_auth_source_property_mapping_request: Option<models::PatchedOAuthSourcePropertyMappingRequest>,
5551) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthPartialUpdateError>> {
5552    // add a prefix to parameters to efficiently prevent name collisions
5553    let p_path_pm_uuid = pm_uuid;
5554    let p_body_patched_o_auth_source_property_mapping_request = patched_o_auth_source_property_mapping_request;
5555
5556    let uri_str = format!(
5557        "{}/propertymappings/source/oauth/{pm_uuid}/",
5558        configuration.base_path,
5559        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5560    );
5561    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5562
5563    if let Some(ref user_agent) = configuration.user_agent {
5564        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5565    }
5566    if let Some(ref token) = configuration.bearer_access_token {
5567        req_builder = req_builder.bearer_auth(token.to_owned());
5568    };
5569    req_builder = req_builder.json(&p_body_patched_o_auth_source_property_mapping_request);
5570
5571    let req = req_builder.build()?;
5572    let resp = configuration.client.execute(req).await?;
5573
5574    let status = resp.status();
5575    let content_type = resp
5576        .headers()
5577        .get("content-type")
5578        .and_then(|v| v.to_str().ok())
5579        .unwrap_or("application/octet-stream");
5580    let content_type = super::ContentType::from(content_type);
5581
5582    if !status.is_client_error() && !status.is_server_error() {
5583        let content = resp.text().await?;
5584        match content_type {
5585            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5586            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
5587            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::OAuthSourcePropertyMapping`")))),
5588        }
5589    } else {
5590        let content = resp.text().await?;
5591        let entity: Option<PropertymappingsSourceOauthPartialUpdateError> = serde_json::from_str(&content).ok();
5592        Err(Error::ResponseError(ResponseContent {
5593            status,
5594            content,
5595            entity,
5596        }))
5597    }
5598}
5599
5600/// OAuthSourcePropertyMapping Viewset
5601pub async fn propertymappings_source_oauth_retrieve(
5602    configuration: &configuration::Configuration,
5603    pm_uuid: &str,
5604) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthRetrieveError>> {
5605    // add a prefix to parameters to efficiently prevent name collisions
5606    let p_path_pm_uuid = pm_uuid;
5607
5608    let uri_str = format!(
5609        "{}/propertymappings/source/oauth/{pm_uuid}/",
5610        configuration.base_path,
5611        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5612    );
5613    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5614
5615    if let Some(ref user_agent) = configuration.user_agent {
5616        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5617    }
5618    if let Some(ref token) = configuration.bearer_access_token {
5619        req_builder = req_builder.bearer_auth(token.to_owned());
5620    };
5621
5622    let req = req_builder.build()?;
5623    let resp = configuration.client.execute(req).await?;
5624
5625    let status = resp.status();
5626    let content_type = resp
5627        .headers()
5628        .get("content-type")
5629        .and_then(|v| v.to_str().ok())
5630        .unwrap_or("application/octet-stream");
5631    let content_type = super::ContentType::from(content_type);
5632
5633    if !status.is_client_error() && !status.is_server_error() {
5634        let content = resp.text().await?;
5635        match content_type {
5636            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5637            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
5638            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::OAuthSourcePropertyMapping`")))),
5639        }
5640    } else {
5641        let content = resp.text().await?;
5642        let entity: Option<PropertymappingsSourceOauthRetrieveError> = serde_json::from_str(&content).ok();
5643        Err(Error::ResponseError(ResponseContent {
5644            status,
5645            content,
5646            entity,
5647        }))
5648    }
5649}
5650
5651/// OAuthSourcePropertyMapping Viewset
5652pub async fn propertymappings_source_oauth_update(
5653    configuration: &configuration::Configuration,
5654    pm_uuid: &str,
5655    o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest,
5656) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthUpdateError>> {
5657    // add a prefix to parameters to efficiently prevent name collisions
5658    let p_path_pm_uuid = pm_uuid;
5659    let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request;
5660
5661    let uri_str = format!(
5662        "{}/propertymappings/source/oauth/{pm_uuid}/",
5663        configuration.base_path,
5664        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5665    );
5666    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
5667
5668    if let Some(ref user_agent) = configuration.user_agent {
5669        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5670    }
5671    if let Some(ref token) = configuration.bearer_access_token {
5672        req_builder = req_builder.bearer_auth(token.to_owned());
5673    };
5674    req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request);
5675
5676    let req = req_builder.build()?;
5677    let resp = configuration.client.execute(req).await?;
5678
5679    let status = resp.status();
5680    let content_type = resp
5681        .headers()
5682        .get("content-type")
5683        .and_then(|v| v.to_str().ok())
5684        .unwrap_or("application/octet-stream");
5685    let content_type = super::ContentType::from(content_type);
5686
5687    if !status.is_client_error() && !status.is_server_error() {
5688        let content = resp.text().await?;
5689        match content_type {
5690            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5691            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
5692            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::OAuthSourcePropertyMapping`")))),
5693        }
5694    } else {
5695        let content = resp.text().await?;
5696        let entity: Option<PropertymappingsSourceOauthUpdateError> = serde_json::from_str(&content).ok();
5697        Err(Error::ResponseError(ResponseContent {
5698            status,
5699            content,
5700            entity,
5701        }))
5702    }
5703}
5704
5705/// Get a list of all objects that use this object
5706pub async fn propertymappings_source_oauth_used_by_list(
5707    configuration: &configuration::Configuration,
5708    pm_uuid: &str,
5709) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceOauthUsedByListError>> {
5710    // add a prefix to parameters to efficiently prevent name collisions
5711    let p_path_pm_uuid = pm_uuid;
5712
5713    let uri_str = format!(
5714        "{}/propertymappings/source/oauth/{pm_uuid}/used_by/",
5715        configuration.base_path,
5716        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5717    );
5718    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5719
5720    if let Some(ref user_agent) = configuration.user_agent {
5721        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5722    }
5723    if let Some(ref token) = configuration.bearer_access_token {
5724        req_builder = req_builder.bearer_auth(token.to_owned());
5725    };
5726
5727    let req = req_builder.build()?;
5728    let resp = configuration.client.execute(req).await?;
5729
5730    let status = resp.status();
5731    let content_type = resp
5732        .headers()
5733        .get("content-type")
5734        .and_then(|v| v.to_str().ok())
5735        .unwrap_or("application/octet-stream");
5736    let content_type = super::ContentType::from(content_type);
5737
5738    if !status.is_client_error() && !status.is_server_error() {
5739        let content = resp.text().await?;
5740        match content_type {
5741            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5742            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
5743            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
5744        }
5745    } else {
5746        let content = resp.text().await?;
5747        let entity: Option<PropertymappingsSourceOauthUsedByListError> = serde_json::from_str(&content).ok();
5748        Err(Error::ResponseError(ResponseContent {
5749            status,
5750            content,
5751            entity,
5752        }))
5753    }
5754}
5755
5756/// PlexSourcePropertyMapping Viewset
5757pub async fn propertymappings_source_plex_create(
5758    configuration: &configuration::Configuration,
5759    plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest,
5760) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexCreateError>> {
5761    // add a prefix to parameters to efficiently prevent name collisions
5762    let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request;
5763
5764    let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path);
5765    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
5766
5767    if let Some(ref user_agent) = configuration.user_agent {
5768        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5769    }
5770    if let Some(ref token) = configuration.bearer_access_token {
5771        req_builder = req_builder.bearer_auth(token.to_owned());
5772    };
5773    req_builder = req_builder.json(&p_body_plex_source_property_mapping_request);
5774
5775    let req = req_builder.build()?;
5776    let resp = configuration.client.execute(req).await?;
5777
5778    let status = resp.status();
5779    let content_type = resp
5780        .headers()
5781        .get("content-type")
5782        .and_then(|v| v.to_str().ok())
5783        .unwrap_or("application/octet-stream");
5784    let content_type = super::ContentType::from(content_type);
5785
5786    if !status.is_client_error() && !status.is_server_error() {
5787        let content = resp.text().await?;
5788        match content_type {
5789            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5790            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
5791            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::PlexSourcePropertyMapping`")))),
5792        }
5793    } else {
5794        let content = resp.text().await?;
5795        let entity: Option<PropertymappingsSourcePlexCreateError> = serde_json::from_str(&content).ok();
5796        Err(Error::ResponseError(ResponseContent {
5797            status,
5798            content,
5799            entity,
5800        }))
5801    }
5802}
5803
5804/// PlexSourcePropertyMapping Viewset
5805pub async fn propertymappings_source_plex_destroy(
5806    configuration: &configuration::Configuration,
5807    pm_uuid: &str,
5808) -> Result<(), Error<PropertymappingsSourcePlexDestroyError>> {
5809    // add a prefix to parameters to efficiently prevent name collisions
5810    let p_path_pm_uuid = pm_uuid;
5811
5812    let uri_str = format!(
5813        "{}/propertymappings/source/plex/{pm_uuid}/",
5814        configuration.base_path,
5815        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5816    );
5817    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
5818
5819    if let Some(ref user_agent) = configuration.user_agent {
5820        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5821    }
5822    if let Some(ref token) = configuration.bearer_access_token {
5823        req_builder = req_builder.bearer_auth(token.to_owned());
5824    };
5825
5826    let req = req_builder.build()?;
5827    let resp = configuration.client.execute(req).await?;
5828
5829    let status = resp.status();
5830
5831    if !status.is_client_error() && !status.is_server_error() {
5832        Ok(())
5833    } else {
5834        let content = resp.text().await?;
5835        let entity: Option<PropertymappingsSourcePlexDestroyError> = serde_json::from_str(&content).ok();
5836        Err(Error::ResponseError(ResponseContent {
5837            status,
5838            content,
5839            entity,
5840        }))
5841    }
5842}
5843
5844/// PlexSourcePropertyMapping Viewset
5845pub async fn propertymappings_source_plex_list(
5846    configuration: &configuration::Configuration,
5847    managed: Option<Vec<String>>,
5848    managed__isnull: Option<bool>,
5849    name: Option<&str>,
5850    ordering: Option<&str>,
5851    page: Option<i32>,
5852    page_size: Option<i32>,
5853    search: Option<&str>,
5854) -> Result<models::PaginatedPlexSourcePropertyMappingList, Error<PropertymappingsSourcePlexListError>> {
5855    // add a prefix to parameters to efficiently prevent name collisions
5856    let p_query_managed = managed;
5857    let p_query_managed__isnull = managed__isnull;
5858    let p_query_name = name;
5859    let p_query_ordering = ordering;
5860    let p_query_page = page;
5861    let p_query_page_size = page_size;
5862    let p_query_search = search;
5863
5864    let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path);
5865    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
5866
5867    if let Some(ref param_value) = p_query_managed {
5868        req_builder = match "multi" {
5869            "multi" => req_builder.query(
5870                &param_value
5871                    .into_iter()
5872                    .map(|p| ("managed".to_owned(), p.to_string()))
5873                    .collect::<Vec<(std::string::String, std::string::String)>>(),
5874            ),
5875            _ => req_builder.query(&[(
5876                "managed",
5877                &param_value
5878                    .into_iter()
5879                    .map(|p| p.to_string())
5880                    .collect::<Vec<String>>()
5881                    .join(",")
5882                    .to_string(),
5883            )]),
5884        };
5885    }
5886    if let Some(ref param_value) = p_query_managed__isnull {
5887        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
5888    }
5889    if let Some(ref param_value) = p_query_name {
5890        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
5891    }
5892    if let Some(ref param_value) = p_query_ordering {
5893        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
5894    }
5895    if let Some(ref param_value) = p_query_page {
5896        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
5897    }
5898    if let Some(ref param_value) = p_query_page_size {
5899        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
5900    }
5901    if let Some(ref param_value) = p_query_search {
5902        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
5903    }
5904    if let Some(ref user_agent) = configuration.user_agent {
5905        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5906    }
5907    if let Some(ref token) = configuration.bearer_access_token {
5908        req_builder = req_builder.bearer_auth(token.to_owned());
5909    };
5910
5911    let req = req_builder.build()?;
5912    let resp = configuration.client.execute(req).await?;
5913
5914    let status = resp.status();
5915    let content_type = resp
5916        .headers()
5917        .get("content-type")
5918        .and_then(|v| v.to_str().ok())
5919        .unwrap_or("application/octet-stream");
5920    let content_type = super::ContentType::from(content_type);
5921
5922    if !status.is_client_error() && !status.is_server_error() {
5923        let content = resp.text().await?;
5924        match content_type {
5925            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5926            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPlexSourcePropertyMappingList`"))),
5927            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::PaginatedPlexSourcePropertyMappingList`")))),
5928        }
5929    } else {
5930        let content = resp.text().await?;
5931        let entity: Option<PropertymappingsSourcePlexListError> = serde_json::from_str(&content).ok();
5932        Err(Error::ResponseError(ResponseContent {
5933            status,
5934            content,
5935            entity,
5936        }))
5937    }
5938}
5939
5940/// PlexSourcePropertyMapping Viewset
5941pub async fn propertymappings_source_plex_partial_update(
5942    configuration: &configuration::Configuration,
5943    pm_uuid: &str,
5944    patched_plex_source_property_mapping_request: Option<models::PatchedPlexSourcePropertyMappingRequest>,
5945) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexPartialUpdateError>> {
5946    // add a prefix to parameters to efficiently prevent name collisions
5947    let p_path_pm_uuid = pm_uuid;
5948    let p_body_patched_plex_source_property_mapping_request = patched_plex_source_property_mapping_request;
5949
5950    let uri_str = format!(
5951        "{}/propertymappings/source/plex/{pm_uuid}/",
5952        configuration.base_path,
5953        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
5954    );
5955    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
5956
5957    if let Some(ref user_agent) = configuration.user_agent {
5958        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
5959    }
5960    if let Some(ref token) = configuration.bearer_access_token {
5961        req_builder = req_builder.bearer_auth(token.to_owned());
5962    };
5963    req_builder = req_builder.json(&p_body_patched_plex_source_property_mapping_request);
5964
5965    let req = req_builder.build()?;
5966    let resp = configuration.client.execute(req).await?;
5967
5968    let status = resp.status();
5969    let content_type = resp
5970        .headers()
5971        .get("content-type")
5972        .and_then(|v| v.to_str().ok())
5973        .unwrap_or("application/octet-stream");
5974    let content_type = super::ContentType::from(content_type);
5975
5976    if !status.is_client_error() && !status.is_server_error() {
5977        let content = resp.text().await?;
5978        match content_type {
5979            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
5980            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
5981            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::PlexSourcePropertyMapping`")))),
5982        }
5983    } else {
5984        let content = resp.text().await?;
5985        let entity: Option<PropertymappingsSourcePlexPartialUpdateError> = serde_json::from_str(&content).ok();
5986        Err(Error::ResponseError(ResponseContent {
5987            status,
5988            content,
5989            entity,
5990        }))
5991    }
5992}
5993
5994/// PlexSourcePropertyMapping Viewset
5995pub async fn propertymappings_source_plex_retrieve(
5996    configuration: &configuration::Configuration,
5997    pm_uuid: &str,
5998) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexRetrieveError>> {
5999    // add a prefix to parameters to efficiently prevent name collisions
6000    let p_path_pm_uuid = pm_uuid;
6001
6002    let uri_str = format!(
6003        "{}/propertymappings/source/plex/{pm_uuid}/",
6004        configuration.base_path,
6005        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6006    );
6007    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6008
6009    if let Some(ref user_agent) = configuration.user_agent {
6010        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6011    }
6012    if let Some(ref token) = configuration.bearer_access_token {
6013        req_builder = req_builder.bearer_auth(token.to_owned());
6014    };
6015
6016    let req = req_builder.build()?;
6017    let resp = configuration.client.execute(req).await?;
6018
6019    let status = resp.status();
6020    let content_type = resp
6021        .headers()
6022        .get("content-type")
6023        .and_then(|v| v.to_str().ok())
6024        .unwrap_or("application/octet-stream");
6025    let content_type = super::ContentType::from(content_type);
6026
6027    if !status.is_client_error() && !status.is_server_error() {
6028        let content = resp.text().await?;
6029        match content_type {
6030            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6031            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
6032            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::PlexSourcePropertyMapping`")))),
6033        }
6034    } else {
6035        let content = resp.text().await?;
6036        let entity: Option<PropertymappingsSourcePlexRetrieveError> = serde_json::from_str(&content).ok();
6037        Err(Error::ResponseError(ResponseContent {
6038            status,
6039            content,
6040            entity,
6041        }))
6042    }
6043}
6044
6045/// PlexSourcePropertyMapping Viewset
6046pub async fn propertymappings_source_plex_update(
6047    configuration: &configuration::Configuration,
6048    pm_uuid: &str,
6049    plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest,
6050) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexUpdateError>> {
6051    // add a prefix to parameters to efficiently prevent name collisions
6052    let p_path_pm_uuid = pm_uuid;
6053    let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request;
6054
6055    let uri_str = format!(
6056        "{}/propertymappings/source/plex/{pm_uuid}/",
6057        configuration.base_path,
6058        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6059    );
6060    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6061
6062    if let Some(ref user_agent) = configuration.user_agent {
6063        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6064    }
6065    if let Some(ref token) = configuration.bearer_access_token {
6066        req_builder = req_builder.bearer_auth(token.to_owned());
6067    };
6068    req_builder = req_builder.json(&p_body_plex_source_property_mapping_request);
6069
6070    let req = req_builder.build()?;
6071    let resp = configuration.client.execute(req).await?;
6072
6073    let status = resp.status();
6074    let content_type = resp
6075        .headers()
6076        .get("content-type")
6077        .and_then(|v| v.to_str().ok())
6078        .unwrap_or("application/octet-stream");
6079    let content_type = super::ContentType::from(content_type);
6080
6081    if !status.is_client_error() && !status.is_server_error() {
6082        let content = resp.text().await?;
6083        match content_type {
6084            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6085            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
6086            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::PlexSourcePropertyMapping`")))),
6087        }
6088    } else {
6089        let content = resp.text().await?;
6090        let entity: Option<PropertymappingsSourcePlexUpdateError> = serde_json::from_str(&content).ok();
6091        Err(Error::ResponseError(ResponseContent {
6092            status,
6093            content,
6094            entity,
6095        }))
6096    }
6097}
6098
6099/// Get a list of all objects that use this object
6100pub async fn propertymappings_source_plex_used_by_list(
6101    configuration: &configuration::Configuration,
6102    pm_uuid: &str,
6103) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourcePlexUsedByListError>> {
6104    // add a prefix to parameters to efficiently prevent name collisions
6105    let p_path_pm_uuid = pm_uuid;
6106
6107    let uri_str = format!(
6108        "{}/propertymappings/source/plex/{pm_uuid}/used_by/",
6109        configuration.base_path,
6110        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6111    );
6112    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6113
6114    if let Some(ref user_agent) = configuration.user_agent {
6115        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6116    }
6117    if let Some(ref token) = configuration.bearer_access_token {
6118        req_builder = req_builder.bearer_auth(token.to_owned());
6119    };
6120
6121    let req = req_builder.build()?;
6122    let resp = configuration.client.execute(req).await?;
6123
6124    let status = resp.status();
6125    let content_type = resp
6126        .headers()
6127        .get("content-type")
6128        .and_then(|v| v.to_str().ok())
6129        .unwrap_or("application/octet-stream");
6130    let content_type = super::ContentType::from(content_type);
6131
6132    if !status.is_client_error() && !status.is_server_error() {
6133        let content = resp.text().await?;
6134        match content_type {
6135            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6136            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
6137            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
6138        }
6139    } else {
6140        let content = resp.text().await?;
6141        let entity: Option<PropertymappingsSourcePlexUsedByListError> = serde_json::from_str(&content).ok();
6142        Err(Error::ResponseError(ResponseContent {
6143            status,
6144            content,
6145            entity,
6146        }))
6147    }
6148}
6149
6150/// SAMLSourcePropertyMapping Viewset
6151pub async fn propertymappings_source_saml_create(
6152    configuration: &configuration::Configuration,
6153    saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest,
6154) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlCreateError>> {
6155    // add a prefix to parameters to efficiently prevent name collisions
6156    let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request;
6157
6158    let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path);
6159    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6160
6161    if let Some(ref user_agent) = configuration.user_agent {
6162        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6163    }
6164    if let Some(ref token) = configuration.bearer_access_token {
6165        req_builder = req_builder.bearer_auth(token.to_owned());
6166    };
6167    req_builder = req_builder.json(&p_body_saml_source_property_mapping_request);
6168
6169    let req = req_builder.build()?;
6170    let resp = configuration.client.execute(req).await?;
6171
6172    let status = resp.status();
6173    let content_type = resp
6174        .headers()
6175        .get("content-type")
6176        .and_then(|v| v.to_str().ok())
6177        .unwrap_or("application/octet-stream");
6178    let content_type = super::ContentType::from(content_type);
6179
6180    if !status.is_client_error() && !status.is_server_error() {
6181        let content = resp.text().await?;
6182        match content_type {
6183            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6184            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
6185            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::SamlSourcePropertyMapping`")))),
6186        }
6187    } else {
6188        let content = resp.text().await?;
6189        let entity: Option<PropertymappingsSourceSamlCreateError> = serde_json::from_str(&content).ok();
6190        Err(Error::ResponseError(ResponseContent {
6191            status,
6192            content,
6193            entity,
6194        }))
6195    }
6196}
6197
6198/// SAMLSourcePropertyMapping Viewset
6199pub async fn propertymappings_source_saml_destroy(
6200    configuration: &configuration::Configuration,
6201    pm_uuid: &str,
6202) -> Result<(), Error<PropertymappingsSourceSamlDestroyError>> {
6203    // add a prefix to parameters to efficiently prevent name collisions
6204    let p_path_pm_uuid = pm_uuid;
6205
6206    let uri_str = format!(
6207        "{}/propertymappings/source/saml/{pm_uuid}/",
6208        configuration.base_path,
6209        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6210    );
6211    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6212
6213    if let Some(ref user_agent) = configuration.user_agent {
6214        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6215    }
6216    if let Some(ref token) = configuration.bearer_access_token {
6217        req_builder = req_builder.bearer_auth(token.to_owned());
6218    };
6219
6220    let req = req_builder.build()?;
6221    let resp = configuration.client.execute(req).await?;
6222
6223    let status = resp.status();
6224
6225    if !status.is_client_error() && !status.is_server_error() {
6226        Ok(())
6227    } else {
6228        let content = resp.text().await?;
6229        let entity: Option<PropertymappingsSourceSamlDestroyError> = serde_json::from_str(&content).ok();
6230        Err(Error::ResponseError(ResponseContent {
6231            status,
6232            content,
6233            entity,
6234        }))
6235    }
6236}
6237
6238/// SAMLSourcePropertyMapping Viewset
6239pub async fn propertymappings_source_saml_list(
6240    configuration: &configuration::Configuration,
6241    managed: Option<Vec<String>>,
6242    managed__isnull: Option<bool>,
6243    name: Option<&str>,
6244    ordering: Option<&str>,
6245    page: Option<i32>,
6246    page_size: Option<i32>,
6247    search: Option<&str>,
6248) -> Result<models::PaginatedSamlSourcePropertyMappingList, Error<PropertymappingsSourceSamlListError>> {
6249    // add a prefix to parameters to efficiently prevent name collisions
6250    let p_query_managed = managed;
6251    let p_query_managed__isnull = managed__isnull;
6252    let p_query_name = name;
6253    let p_query_ordering = ordering;
6254    let p_query_page = page;
6255    let p_query_page_size = page_size;
6256    let p_query_search = search;
6257
6258    let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path);
6259    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6260
6261    if let Some(ref param_value) = p_query_managed {
6262        req_builder = match "multi" {
6263            "multi" => req_builder.query(
6264                &param_value
6265                    .into_iter()
6266                    .map(|p| ("managed".to_owned(), p.to_string()))
6267                    .collect::<Vec<(std::string::String, std::string::String)>>(),
6268            ),
6269            _ => req_builder.query(&[(
6270                "managed",
6271                &param_value
6272                    .into_iter()
6273                    .map(|p| p.to_string())
6274                    .collect::<Vec<String>>()
6275                    .join(",")
6276                    .to_string(),
6277            )]),
6278        };
6279    }
6280    if let Some(ref param_value) = p_query_managed__isnull {
6281        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
6282    }
6283    if let Some(ref param_value) = p_query_name {
6284        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
6285    }
6286    if let Some(ref param_value) = p_query_ordering {
6287        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
6288    }
6289    if let Some(ref param_value) = p_query_page {
6290        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
6291    }
6292    if let Some(ref param_value) = p_query_page_size {
6293        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
6294    }
6295    if let Some(ref param_value) = p_query_search {
6296        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
6297    }
6298    if let Some(ref user_agent) = configuration.user_agent {
6299        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6300    }
6301    if let Some(ref token) = configuration.bearer_access_token {
6302        req_builder = req_builder.bearer_auth(token.to_owned());
6303    };
6304
6305    let req = req_builder.build()?;
6306    let resp = configuration.client.execute(req).await?;
6307
6308    let status = resp.status();
6309    let content_type = resp
6310        .headers()
6311        .get("content-type")
6312        .and_then(|v| v.to_str().ok())
6313        .unwrap_or("application/octet-stream");
6314    let content_type = super::ContentType::from(content_type);
6315
6316    if !status.is_client_error() && !status.is_server_error() {
6317        let content = resp.text().await?;
6318        match content_type {
6319            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6320            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlSourcePropertyMappingList`"))),
6321            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::PaginatedSamlSourcePropertyMappingList`")))),
6322        }
6323    } else {
6324        let content = resp.text().await?;
6325        let entity: Option<PropertymappingsSourceSamlListError> = serde_json::from_str(&content).ok();
6326        Err(Error::ResponseError(ResponseContent {
6327            status,
6328            content,
6329            entity,
6330        }))
6331    }
6332}
6333
6334/// SAMLSourcePropertyMapping Viewset
6335pub async fn propertymappings_source_saml_partial_update(
6336    configuration: &configuration::Configuration,
6337    pm_uuid: &str,
6338    patched_saml_source_property_mapping_request: Option<models::PatchedSamlSourcePropertyMappingRequest>,
6339) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlPartialUpdateError>> {
6340    // add a prefix to parameters to efficiently prevent name collisions
6341    let p_path_pm_uuid = pm_uuid;
6342    let p_body_patched_saml_source_property_mapping_request = patched_saml_source_property_mapping_request;
6343
6344    let uri_str = format!(
6345        "{}/propertymappings/source/saml/{pm_uuid}/",
6346        configuration.base_path,
6347        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6348    );
6349    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6350
6351    if let Some(ref user_agent) = configuration.user_agent {
6352        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6353    }
6354    if let Some(ref token) = configuration.bearer_access_token {
6355        req_builder = req_builder.bearer_auth(token.to_owned());
6356    };
6357    req_builder = req_builder.json(&p_body_patched_saml_source_property_mapping_request);
6358
6359    let req = req_builder.build()?;
6360    let resp = configuration.client.execute(req).await?;
6361
6362    let status = resp.status();
6363    let content_type = resp
6364        .headers()
6365        .get("content-type")
6366        .and_then(|v| v.to_str().ok())
6367        .unwrap_or("application/octet-stream");
6368    let content_type = super::ContentType::from(content_type);
6369
6370    if !status.is_client_error() && !status.is_server_error() {
6371        let content = resp.text().await?;
6372        match content_type {
6373            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6374            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
6375            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::SamlSourcePropertyMapping`")))),
6376        }
6377    } else {
6378        let content = resp.text().await?;
6379        let entity: Option<PropertymappingsSourceSamlPartialUpdateError> = serde_json::from_str(&content).ok();
6380        Err(Error::ResponseError(ResponseContent {
6381            status,
6382            content,
6383            entity,
6384        }))
6385    }
6386}
6387
6388/// SAMLSourcePropertyMapping Viewset
6389pub async fn propertymappings_source_saml_retrieve(
6390    configuration: &configuration::Configuration,
6391    pm_uuid: &str,
6392) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlRetrieveError>> {
6393    // add a prefix to parameters to efficiently prevent name collisions
6394    let p_path_pm_uuid = pm_uuid;
6395
6396    let uri_str = format!(
6397        "{}/propertymappings/source/saml/{pm_uuid}/",
6398        configuration.base_path,
6399        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6400    );
6401    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6402
6403    if let Some(ref user_agent) = configuration.user_agent {
6404        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6405    }
6406    if let Some(ref token) = configuration.bearer_access_token {
6407        req_builder = req_builder.bearer_auth(token.to_owned());
6408    };
6409
6410    let req = req_builder.build()?;
6411    let resp = configuration.client.execute(req).await?;
6412
6413    let status = resp.status();
6414    let content_type = resp
6415        .headers()
6416        .get("content-type")
6417        .and_then(|v| v.to_str().ok())
6418        .unwrap_or("application/octet-stream");
6419    let content_type = super::ContentType::from(content_type);
6420
6421    if !status.is_client_error() && !status.is_server_error() {
6422        let content = resp.text().await?;
6423        match content_type {
6424            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6425            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
6426            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::SamlSourcePropertyMapping`")))),
6427        }
6428    } else {
6429        let content = resp.text().await?;
6430        let entity: Option<PropertymappingsSourceSamlRetrieveError> = serde_json::from_str(&content).ok();
6431        Err(Error::ResponseError(ResponseContent {
6432            status,
6433            content,
6434            entity,
6435        }))
6436    }
6437}
6438
6439/// SAMLSourcePropertyMapping Viewset
6440pub async fn propertymappings_source_saml_update(
6441    configuration: &configuration::Configuration,
6442    pm_uuid: &str,
6443    saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest,
6444) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlUpdateError>> {
6445    // add a prefix to parameters to efficiently prevent name collisions
6446    let p_path_pm_uuid = pm_uuid;
6447    let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request;
6448
6449    let uri_str = format!(
6450        "{}/propertymappings/source/saml/{pm_uuid}/",
6451        configuration.base_path,
6452        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6453    );
6454    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6455
6456    if let Some(ref user_agent) = configuration.user_agent {
6457        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6458    }
6459    if let Some(ref token) = configuration.bearer_access_token {
6460        req_builder = req_builder.bearer_auth(token.to_owned());
6461    };
6462    req_builder = req_builder.json(&p_body_saml_source_property_mapping_request);
6463
6464    let req = req_builder.build()?;
6465    let resp = configuration.client.execute(req).await?;
6466
6467    let status = resp.status();
6468    let content_type = resp
6469        .headers()
6470        .get("content-type")
6471        .and_then(|v| v.to_str().ok())
6472        .unwrap_or("application/octet-stream");
6473    let content_type = super::ContentType::from(content_type);
6474
6475    if !status.is_client_error() && !status.is_server_error() {
6476        let content = resp.text().await?;
6477        match content_type {
6478            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6479            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
6480            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::SamlSourcePropertyMapping`")))),
6481        }
6482    } else {
6483        let content = resp.text().await?;
6484        let entity: Option<PropertymappingsSourceSamlUpdateError> = serde_json::from_str(&content).ok();
6485        Err(Error::ResponseError(ResponseContent {
6486            status,
6487            content,
6488            entity,
6489        }))
6490    }
6491}
6492
6493/// Get a list of all objects that use this object
6494pub async fn propertymappings_source_saml_used_by_list(
6495    configuration: &configuration::Configuration,
6496    pm_uuid: &str,
6497) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceSamlUsedByListError>> {
6498    // add a prefix to parameters to efficiently prevent name collisions
6499    let p_path_pm_uuid = pm_uuid;
6500
6501    let uri_str = format!(
6502        "{}/propertymappings/source/saml/{pm_uuid}/used_by/",
6503        configuration.base_path,
6504        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6505    );
6506    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6507
6508    if let Some(ref user_agent) = configuration.user_agent {
6509        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6510    }
6511    if let Some(ref token) = configuration.bearer_access_token {
6512        req_builder = req_builder.bearer_auth(token.to_owned());
6513    };
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 `Vec&lt;models::UsedBy&gt;`"))),
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 `Vec&lt;models::UsedBy&gt;`")))),
6532        }
6533    } else {
6534        let content = resp.text().await?;
6535        let entity: Option<PropertymappingsSourceSamlUsedByListError> = serde_json::from_str(&content).ok();
6536        Err(Error::ResponseError(ResponseContent {
6537            status,
6538            content,
6539            entity,
6540        }))
6541    }
6542}
6543
6544/// SCIMSourcePropertyMapping Viewset
6545pub async fn propertymappings_source_scim_create(
6546    configuration: &configuration::Configuration,
6547    scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest,
6548) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimCreateError>> {
6549    // add a prefix to parameters to efficiently prevent name collisions
6550    let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request;
6551
6552    let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path);
6553    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6554
6555    if let Some(ref user_agent) = configuration.user_agent {
6556        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6557    }
6558    if let Some(ref token) = configuration.bearer_access_token {
6559        req_builder = req_builder.bearer_auth(token.to_owned());
6560    };
6561    req_builder = req_builder.json(&p_body_scim_source_property_mapping_request);
6562
6563    let req = req_builder.build()?;
6564    let resp = configuration.client.execute(req).await?;
6565
6566    let status = resp.status();
6567    let content_type = resp
6568        .headers()
6569        .get("content-type")
6570        .and_then(|v| v.to_str().ok())
6571        .unwrap_or("application/octet-stream");
6572    let content_type = super::ContentType::from(content_type);
6573
6574    if !status.is_client_error() && !status.is_server_error() {
6575        let content = resp.text().await?;
6576        match content_type {
6577            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6578            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
6579            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::ScimSourcePropertyMapping`")))),
6580        }
6581    } else {
6582        let content = resp.text().await?;
6583        let entity: Option<PropertymappingsSourceScimCreateError> = serde_json::from_str(&content).ok();
6584        Err(Error::ResponseError(ResponseContent {
6585            status,
6586            content,
6587            entity,
6588        }))
6589    }
6590}
6591
6592/// SCIMSourcePropertyMapping Viewset
6593pub async fn propertymappings_source_scim_destroy(
6594    configuration: &configuration::Configuration,
6595    pm_uuid: &str,
6596) -> Result<(), Error<PropertymappingsSourceScimDestroyError>> {
6597    // add a prefix to parameters to efficiently prevent name collisions
6598    let p_path_pm_uuid = pm_uuid;
6599
6600    let uri_str = format!(
6601        "{}/propertymappings/source/scim/{pm_uuid}/",
6602        configuration.base_path,
6603        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6604    );
6605    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
6606
6607    if let Some(ref user_agent) = configuration.user_agent {
6608        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6609    }
6610    if let Some(ref token) = configuration.bearer_access_token {
6611        req_builder = req_builder.bearer_auth(token.to_owned());
6612    };
6613
6614    let req = req_builder.build()?;
6615    let resp = configuration.client.execute(req).await?;
6616
6617    let status = resp.status();
6618
6619    if !status.is_client_error() && !status.is_server_error() {
6620        Ok(())
6621    } else {
6622        let content = resp.text().await?;
6623        let entity: Option<PropertymappingsSourceScimDestroyError> = serde_json::from_str(&content).ok();
6624        Err(Error::ResponseError(ResponseContent {
6625            status,
6626            content,
6627            entity,
6628        }))
6629    }
6630}
6631
6632/// SCIMSourcePropertyMapping Viewset
6633pub async fn propertymappings_source_scim_list(
6634    configuration: &configuration::Configuration,
6635    managed: Option<Vec<String>>,
6636    managed__isnull: Option<bool>,
6637    name: Option<&str>,
6638    ordering: Option<&str>,
6639    page: Option<i32>,
6640    page_size: Option<i32>,
6641    search: Option<&str>,
6642) -> Result<models::PaginatedScimSourcePropertyMappingList, Error<PropertymappingsSourceScimListError>> {
6643    // add a prefix to parameters to efficiently prevent name collisions
6644    let p_query_managed = managed;
6645    let p_query_managed__isnull = managed__isnull;
6646    let p_query_name = name;
6647    let p_query_ordering = ordering;
6648    let p_query_page = page;
6649    let p_query_page_size = page_size;
6650    let p_query_search = search;
6651
6652    let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path);
6653    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6654
6655    if let Some(ref param_value) = p_query_managed {
6656        req_builder = match "multi" {
6657            "multi" => req_builder.query(
6658                &param_value
6659                    .into_iter()
6660                    .map(|p| ("managed".to_owned(), p.to_string()))
6661                    .collect::<Vec<(std::string::String, std::string::String)>>(),
6662            ),
6663            _ => req_builder.query(&[(
6664                "managed",
6665                &param_value
6666                    .into_iter()
6667                    .map(|p| p.to_string())
6668                    .collect::<Vec<String>>()
6669                    .join(",")
6670                    .to_string(),
6671            )]),
6672        };
6673    }
6674    if let Some(ref param_value) = p_query_managed__isnull {
6675        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
6676    }
6677    if let Some(ref param_value) = p_query_name {
6678        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
6679    }
6680    if let Some(ref param_value) = p_query_ordering {
6681        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
6682    }
6683    if let Some(ref param_value) = p_query_page {
6684        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
6685    }
6686    if let Some(ref param_value) = p_query_page_size {
6687        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
6688    }
6689    if let Some(ref param_value) = p_query_search {
6690        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
6691    }
6692    if let Some(ref user_agent) = configuration.user_agent {
6693        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6694    }
6695    if let Some(ref token) = configuration.bearer_access_token {
6696        req_builder = req_builder.bearer_auth(token.to_owned());
6697    };
6698
6699    let req = req_builder.build()?;
6700    let resp = configuration.client.execute(req).await?;
6701
6702    let status = resp.status();
6703    let content_type = resp
6704        .headers()
6705        .get("content-type")
6706        .and_then(|v| v.to_str().ok())
6707        .unwrap_or("application/octet-stream");
6708    let content_type = super::ContentType::from(content_type);
6709
6710    if !status.is_client_error() && !status.is_server_error() {
6711        let content = resp.text().await?;
6712        match content_type {
6713            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6714            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourcePropertyMappingList`"))),
6715            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::PaginatedScimSourcePropertyMappingList`")))),
6716        }
6717    } else {
6718        let content = resp.text().await?;
6719        let entity: Option<PropertymappingsSourceScimListError> = serde_json::from_str(&content).ok();
6720        Err(Error::ResponseError(ResponseContent {
6721            status,
6722            content,
6723            entity,
6724        }))
6725    }
6726}
6727
6728/// SCIMSourcePropertyMapping Viewset
6729pub async fn propertymappings_source_scim_partial_update(
6730    configuration: &configuration::Configuration,
6731    pm_uuid: &str,
6732    patched_scim_source_property_mapping_request: Option<models::PatchedScimSourcePropertyMappingRequest>,
6733) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimPartialUpdateError>> {
6734    // add a prefix to parameters to efficiently prevent name collisions
6735    let p_path_pm_uuid = pm_uuid;
6736    let p_body_patched_scim_source_property_mapping_request = patched_scim_source_property_mapping_request;
6737
6738    let uri_str = format!(
6739        "{}/propertymappings/source/scim/{pm_uuid}/",
6740        configuration.base_path,
6741        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6742    );
6743    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
6744
6745    if let Some(ref user_agent) = configuration.user_agent {
6746        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6747    }
6748    if let Some(ref token) = configuration.bearer_access_token {
6749        req_builder = req_builder.bearer_auth(token.to_owned());
6750    };
6751    req_builder = req_builder.json(&p_body_patched_scim_source_property_mapping_request);
6752
6753    let req = req_builder.build()?;
6754    let resp = configuration.client.execute(req).await?;
6755
6756    let status = resp.status();
6757    let content_type = resp
6758        .headers()
6759        .get("content-type")
6760        .and_then(|v| v.to_str().ok())
6761        .unwrap_or("application/octet-stream");
6762    let content_type = super::ContentType::from(content_type);
6763
6764    if !status.is_client_error() && !status.is_server_error() {
6765        let content = resp.text().await?;
6766        match content_type {
6767            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6768            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
6769            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::ScimSourcePropertyMapping`")))),
6770        }
6771    } else {
6772        let content = resp.text().await?;
6773        let entity: Option<PropertymappingsSourceScimPartialUpdateError> = serde_json::from_str(&content).ok();
6774        Err(Error::ResponseError(ResponseContent {
6775            status,
6776            content,
6777            entity,
6778        }))
6779    }
6780}
6781
6782/// SCIMSourcePropertyMapping Viewset
6783pub async fn propertymappings_source_scim_retrieve(
6784    configuration: &configuration::Configuration,
6785    pm_uuid: &str,
6786) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimRetrieveError>> {
6787    // add a prefix to parameters to efficiently prevent name collisions
6788    let p_path_pm_uuid = pm_uuid;
6789
6790    let uri_str = format!(
6791        "{}/propertymappings/source/scim/{pm_uuid}/",
6792        configuration.base_path,
6793        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6794    );
6795    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6796
6797    if let Some(ref user_agent) = configuration.user_agent {
6798        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6799    }
6800    if let Some(ref token) = configuration.bearer_access_token {
6801        req_builder = req_builder.bearer_auth(token.to_owned());
6802    };
6803
6804    let req = req_builder.build()?;
6805    let resp = configuration.client.execute(req).await?;
6806
6807    let status = resp.status();
6808    let content_type = resp
6809        .headers()
6810        .get("content-type")
6811        .and_then(|v| v.to_str().ok())
6812        .unwrap_or("application/octet-stream");
6813    let content_type = super::ContentType::from(content_type);
6814
6815    if !status.is_client_error() && !status.is_server_error() {
6816        let content = resp.text().await?;
6817        match content_type {
6818            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6819            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
6820            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::ScimSourcePropertyMapping`")))),
6821        }
6822    } else {
6823        let content = resp.text().await?;
6824        let entity: Option<PropertymappingsSourceScimRetrieveError> = serde_json::from_str(&content).ok();
6825        Err(Error::ResponseError(ResponseContent {
6826            status,
6827            content,
6828            entity,
6829        }))
6830    }
6831}
6832
6833/// SCIMSourcePropertyMapping Viewset
6834pub async fn propertymappings_source_scim_update(
6835    configuration: &configuration::Configuration,
6836    pm_uuid: &str,
6837    scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest,
6838) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimUpdateError>> {
6839    // add a prefix to parameters to efficiently prevent name collisions
6840    let p_path_pm_uuid = pm_uuid;
6841    let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request;
6842
6843    let uri_str = format!(
6844        "{}/propertymappings/source/scim/{pm_uuid}/",
6845        configuration.base_path,
6846        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6847    );
6848    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
6849
6850    if let Some(ref user_agent) = configuration.user_agent {
6851        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6852    }
6853    if let Some(ref token) = configuration.bearer_access_token {
6854        req_builder = req_builder.bearer_auth(token.to_owned());
6855    };
6856    req_builder = req_builder.json(&p_body_scim_source_property_mapping_request);
6857
6858    let req = req_builder.build()?;
6859    let resp = configuration.client.execute(req).await?;
6860
6861    let status = resp.status();
6862    let content_type = resp
6863        .headers()
6864        .get("content-type")
6865        .and_then(|v| v.to_str().ok())
6866        .unwrap_or("application/octet-stream");
6867    let content_type = super::ContentType::from(content_type);
6868
6869    if !status.is_client_error() && !status.is_server_error() {
6870        let content = resp.text().await?;
6871        match content_type {
6872            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6873            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
6874            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::ScimSourcePropertyMapping`")))),
6875        }
6876    } else {
6877        let content = resp.text().await?;
6878        let entity: Option<PropertymappingsSourceScimUpdateError> = serde_json::from_str(&content).ok();
6879        Err(Error::ResponseError(ResponseContent {
6880            status,
6881            content,
6882            entity,
6883        }))
6884    }
6885}
6886
6887/// Get a list of all objects that use this object
6888pub async fn propertymappings_source_scim_used_by_list(
6889    configuration: &configuration::Configuration,
6890    pm_uuid: &str,
6891) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceScimUsedByListError>> {
6892    // add a prefix to parameters to efficiently prevent name collisions
6893    let p_path_pm_uuid = pm_uuid;
6894
6895    let uri_str = format!(
6896        "{}/propertymappings/source/scim/{pm_uuid}/used_by/",
6897        configuration.base_path,
6898        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6899    );
6900    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
6901
6902    if let Some(ref user_agent) = configuration.user_agent {
6903        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6904    }
6905    if let Some(ref token) = configuration.bearer_access_token {
6906        req_builder = req_builder.bearer_auth(token.to_owned());
6907    };
6908
6909    let req = req_builder.build()?;
6910    let resp = configuration.client.execute(req).await?;
6911
6912    let status = resp.status();
6913    let content_type = resp
6914        .headers()
6915        .get("content-type")
6916        .and_then(|v| v.to_str().ok())
6917        .unwrap_or("application/octet-stream");
6918    let content_type = super::ContentType::from(content_type);
6919
6920    if !status.is_client_error() && !status.is_server_error() {
6921        let content = resp.text().await?;
6922        match content_type {
6923            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6924            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
6925            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
6926        }
6927    } else {
6928        let content = resp.text().await?;
6929        let entity: Option<PropertymappingsSourceScimUsedByListError> = serde_json::from_str(&content).ok();
6930        Err(Error::ResponseError(ResponseContent {
6931            status,
6932            content,
6933            entity,
6934        }))
6935    }
6936}
6937
6938/// TelegramSourcePropertyMapping Viewset
6939pub async fn propertymappings_source_telegram_create(
6940    configuration: &configuration::Configuration,
6941    telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest,
6942) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramCreateError>> {
6943    // add a prefix to parameters to efficiently prevent name collisions
6944    let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request;
6945
6946    let uri_str = format!("{}/propertymappings/source/telegram/", configuration.base_path);
6947    let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
6948
6949    if let Some(ref user_agent) = configuration.user_agent {
6950        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
6951    }
6952    if let Some(ref token) = configuration.bearer_access_token {
6953        req_builder = req_builder.bearer_auth(token.to_owned());
6954    };
6955    req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request);
6956
6957    let req = req_builder.build()?;
6958    let resp = configuration.client.execute(req).await?;
6959
6960    let status = resp.status();
6961    let content_type = resp
6962        .headers()
6963        .get("content-type")
6964        .and_then(|v| v.to_str().ok())
6965        .unwrap_or("application/octet-stream");
6966    let content_type = super::ContentType::from(content_type);
6967
6968    if !status.is_client_error() && !status.is_server_error() {
6969        let content = resp.text().await?;
6970        match content_type {
6971            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
6972            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
6973            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::TelegramSourcePropertyMapping`")))),
6974        }
6975    } else {
6976        let content = resp.text().await?;
6977        let entity: Option<PropertymappingsSourceTelegramCreateError> = serde_json::from_str(&content).ok();
6978        Err(Error::ResponseError(ResponseContent {
6979            status,
6980            content,
6981            entity,
6982        }))
6983    }
6984}
6985
6986/// TelegramSourcePropertyMapping Viewset
6987pub async fn propertymappings_source_telegram_destroy(
6988    configuration: &configuration::Configuration,
6989    pm_uuid: &str,
6990) -> Result<(), Error<PropertymappingsSourceTelegramDestroyError>> {
6991    // add a prefix to parameters to efficiently prevent name collisions
6992    let p_path_pm_uuid = pm_uuid;
6993
6994    let uri_str = format!(
6995        "{}/propertymappings/source/telegram/{pm_uuid}/",
6996        configuration.base_path,
6997        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
6998    );
6999    let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
7000
7001    if let Some(ref user_agent) = configuration.user_agent {
7002        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7003    }
7004    if let Some(ref token) = configuration.bearer_access_token {
7005        req_builder = req_builder.bearer_auth(token.to_owned());
7006    };
7007
7008    let req = req_builder.build()?;
7009    let resp = configuration.client.execute(req).await?;
7010
7011    let status = resp.status();
7012
7013    if !status.is_client_error() && !status.is_server_error() {
7014        Ok(())
7015    } else {
7016        let content = resp.text().await?;
7017        let entity: Option<PropertymappingsSourceTelegramDestroyError> = serde_json::from_str(&content).ok();
7018        Err(Error::ResponseError(ResponseContent {
7019            status,
7020            content,
7021            entity,
7022        }))
7023    }
7024}
7025
7026/// TelegramSourcePropertyMapping Viewset
7027pub async fn propertymappings_source_telegram_list(
7028    configuration: &configuration::Configuration,
7029    managed: Option<Vec<String>>,
7030    managed__isnull: Option<bool>,
7031    name: Option<&str>,
7032    ordering: Option<&str>,
7033    page: Option<i32>,
7034    page_size: Option<i32>,
7035    search: Option<&str>,
7036) -> Result<models::PaginatedTelegramSourcePropertyMappingList, Error<PropertymappingsSourceTelegramListError>> {
7037    // add a prefix to parameters to efficiently prevent name collisions
7038    let p_query_managed = managed;
7039    let p_query_managed__isnull = managed__isnull;
7040    let p_query_name = name;
7041    let p_query_ordering = ordering;
7042    let p_query_page = page;
7043    let p_query_page_size = page_size;
7044    let p_query_search = search;
7045
7046    let uri_str = format!("{}/propertymappings/source/telegram/", configuration.base_path);
7047    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7048
7049    if let Some(ref param_value) = p_query_managed {
7050        req_builder = match "multi" {
7051            "multi" => req_builder.query(
7052                &param_value
7053                    .into_iter()
7054                    .map(|p| ("managed".to_owned(), p.to_string()))
7055                    .collect::<Vec<(std::string::String, std::string::String)>>(),
7056            ),
7057            _ => req_builder.query(&[(
7058                "managed",
7059                &param_value
7060                    .into_iter()
7061                    .map(|p| p.to_string())
7062                    .collect::<Vec<String>>()
7063                    .join(",")
7064                    .to_string(),
7065            )]),
7066        };
7067    }
7068    if let Some(ref param_value) = p_query_managed__isnull {
7069        req_builder = req_builder.query(&[("managed__isnull", &param_value.to_string())]);
7070    }
7071    if let Some(ref param_value) = p_query_name {
7072        req_builder = req_builder.query(&[("name", &param_value.to_string())]);
7073    }
7074    if let Some(ref param_value) = p_query_ordering {
7075        req_builder = req_builder.query(&[("ordering", &param_value.to_string())]);
7076    }
7077    if let Some(ref param_value) = p_query_page {
7078        req_builder = req_builder.query(&[("page", &param_value.to_string())]);
7079    }
7080    if let Some(ref param_value) = p_query_page_size {
7081        req_builder = req_builder.query(&[("page_size", &param_value.to_string())]);
7082    }
7083    if let Some(ref param_value) = p_query_search {
7084        req_builder = req_builder.query(&[("search", &param_value.to_string())]);
7085    }
7086    if let Some(ref user_agent) = configuration.user_agent {
7087        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7088    }
7089    if let Some(ref token) = configuration.bearer_access_token {
7090        req_builder = req_builder.bearer_auth(token.to_owned());
7091    };
7092
7093    let req = req_builder.build()?;
7094    let resp = configuration.client.execute(req).await?;
7095
7096    let status = resp.status();
7097    let content_type = resp
7098        .headers()
7099        .get("content-type")
7100        .and_then(|v| v.to_str().ok())
7101        .unwrap_or("application/octet-stream");
7102    let content_type = super::ContentType::from(content_type);
7103
7104    if !status.is_client_error() && !status.is_server_error() {
7105        let content = resp.text().await?;
7106        match content_type {
7107            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7108            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedTelegramSourcePropertyMappingList`"))),
7109            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::PaginatedTelegramSourcePropertyMappingList`")))),
7110        }
7111    } else {
7112        let content = resp.text().await?;
7113        let entity: Option<PropertymappingsSourceTelegramListError> = serde_json::from_str(&content).ok();
7114        Err(Error::ResponseError(ResponseContent {
7115            status,
7116            content,
7117            entity,
7118        }))
7119    }
7120}
7121
7122/// TelegramSourcePropertyMapping Viewset
7123pub async fn propertymappings_source_telegram_partial_update(
7124    configuration: &configuration::Configuration,
7125    pm_uuid: &str,
7126    patched_telegram_source_property_mapping_request: Option<models::PatchedTelegramSourcePropertyMappingRequest>,
7127) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramPartialUpdateError>> {
7128    // add a prefix to parameters to efficiently prevent name collisions
7129    let p_path_pm_uuid = pm_uuid;
7130    let p_body_patched_telegram_source_property_mapping_request = patched_telegram_source_property_mapping_request;
7131
7132    let uri_str = format!(
7133        "{}/propertymappings/source/telegram/{pm_uuid}/",
7134        configuration.base_path,
7135        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
7136    );
7137    let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
7138
7139    if let Some(ref user_agent) = configuration.user_agent {
7140        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7141    }
7142    if let Some(ref token) = configuration.bearer_access_token {
7143        req_builder = req_builder.bearer_auth(token.to_owned());
7144    };
7145    req_builder = req_builder.json(&p_body_patched_telegram_source_property_mapping_request);
7146
7147    let req = req_builder.build()?;
7148    let resp = configuration.client.execute(req).await?;
7149
7150    let status = resp.status();
7151    let content_type = resp
7152        .headers()
7153        .get("content-type")
7154        .and_then(|v| v.to_str().ok())
7155        .unwrap_or("application/octet-stream");
7156    let content_type = super::ContentType::from(content_type);
7157
7158    if !status.is_client_error() && !status.is_server_error() {
7159        let content = resp.text().await?;
7160        match content_type {
7161            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7162            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
7163            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::TelegramSourcePropertyMapping`")))),
7164        }
7165    } else {
7166        let content = resp.text().await?;
7167        let entity: Option<PropertymappingsSourceTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
7168        Err(Error::ResponseError(ResponseContent {
7169            status,
7170            content,
7171            entity,
7172        }))
7173    }
7174}
7175
7176/// TelegramSourcePropertyMapping Viewset
7177pub async fn propertymappings_source_telegram_retrieve(
7178    configuration: &configuration::Configuration,
7179    pm_uuid: &str,
7180) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramRetrieveError>> {
7181    // add a prefix to parameters to efficiently prevent name collisions
7182    let p_path_pm_uuid = pm_uuid;
7183
7184    let uri_str = format!(
7185        "{}/propertymappings/source/telegram/{pm_uuid}/",
7186        configuration.base_path,
7187        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
7188    );
7189    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7190
7191    if let Some(ref user_agent) = configuration.user_agent {
7192        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7193    }
7194    if let Some(ref token) = configuration.bearer_access_token {
7195        req_builder = req_builder.bearer_auth(token.to_owned());
7196    };
7197
7198    let req = req_builder.build()?;
7199    let resp = configuration.client.execute(req).await?;
7200
7201    let status = resp.status();
7202    let content_type = resp
7203        .headers()
7204        .get("content-type")
7205        .and_then(|v| v.to_str().ok())
7206        .unwrap_or("application/octet-stream");
7207    let content_type = super::ContentType::from(content_type);
7208
7209    if !status.is_client_error() && !status.is_server_error() {
7210        let content = resp.text().await?;
7211        match content_type {
7212            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7213            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
7214            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::TelegramSourcePropertyMapping`")))),
7215        }
7216    } else {
7217        let content = resp.text().await?;
7218        let entity: Option<PropertymappingsSourceTelegramRetrieveError> = serde_json::from_str(&content).ok();
7219        Err(Error::ResponseError(ResponseContent {
7220            status,
7221            content,
7222            entity,
7223        }))
7224    }
7225}
7226
7227/// TelegramSourcePropertyMapping Viewset
7228pub async fn propertymappings_source_telegram_update(
7229    configuration: &configuration::Configuration,
7230    pm_uuid: &str,
7231    telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest,
7232) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramUpdateError>> {
7233    // add a prefix to parameters to efficiently prevent name collisions
7234    let p_path_pm_uuid = pm_uuid;
7235    let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request;
7236
7237    let uri_str = format!(
7238        "{}/propertymappings/source/telegram/{pm_uuid}/",
7239        configuration.base_path,
7240        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
7241    );
7242    let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
7243
7244    if let Some(ref user_agent) = configuration.user_agent {
7245        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7246    }
7247    if let Some(ref token) = configuration.bearer_access_token {
7248        req_builder = req_builder.bearer_auth(token.to_owned());
7249    };
7250    req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request);
7251
7252    let req = req_builder.build()?;
7253    let resp = configuration.client.execute(req).await?;
7254
7255    let status = resp.status();
7256    let content_type = resp
7257        .headers()
7258        .get("content-type")
7259        .and_then(|v| v.to_str().ok())
7260        .unwrap_or("application/octet-stream");
7261    let content_type = super::ContentType::from(content_type);
7262
7263    if !status.is_client_error() && !status.is_server_error() {
7264        let content = resp.text().await?;
7265        match content_type {
7266            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7267            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
7268            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::TelegramSourcePropertyMapping`")))),
7269        }
7270    } else {
7271        let content = resp.text().await?;
7272        let entity: Option<PropertymappingsSourceTelegramUpdateError> = serde_json::from_str(&content).ok();
7273        Err(Error::ResponseError(ResponseContent {
7274            status,
7275            content,
7276            entity,
7277        }))
7278    }
7279}
7280
7281/// Get a list of all objects that use this object
7282pub async fn propertymappings_source_telegram_used_by_list(
7283    configuration: &configuration::Configuration,
7284    pm_uuid: &str,
7285) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceTelegramUsedByListError>> {
7286    // add a prefix to parameters to efficiently prevent name collisions
7287    let p_path_pm_uuid = pm_uuid;
7288
7289    let uri_str = format!(
7290        "{}/propertymappings/source/telegram/{pm_uuid}/used_by/",
7291        configuration.base_path,
7292        pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
7293    );
7294    let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
7295
7296    if let Some(ref user_agent) = configuration.user_agent {
7297        req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
7298    }
7299    if let Some(ref token) = configuration.bearer_access_token {
7300        req_builder = req_builder.bearer_auth(token.to_owned());
7301    };
7302
7303    let req = req_builder.build()?;
7304    let resp = configuration.client.execute(req).await?;
7305
7306    let status = resp.status();
7307    let content_type = resp
7308        .headers()
7309        .get("content-type")
7310        .and_then(|v| v.to_str().ok())
7311        .unwrap_or("application/octet-stream");
7312    let content_type = super::ContentType::from(content_type);
7313
7314    if !status.is_client_error() && !status.is_server_error() {
7315        let content = resp.text().await?;
7316        match content_type {
7317            ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
7318            ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`"))),
7319            ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec&lt;models::UsedBy&gt;`")))),
7320        }
7321    } else {
7322        let content = resp.text().await?;
7323        let entity: Option<PropertymappingsSourceTelegramUsedByListError> = serde_json::from_str(&content).ok();
7324        Err(Error::ResponseError(ResponseContent {
7325            status,
7326            content,
7327            entity,
7328        }))
7329    }
7330}