authentik_rust/apis/
propertymappings_api.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2024.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12use reqwest;
13
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`propertymappings_all_destroy`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum PropertymappingsAllDestroyError {
22    Status400(models::ValidationError),
23    Status403(models::GenericError),
24    UnknownValue(serde_json::Value),
25}
26
27/// struct for typed errors of method [`propertymappings_all_list`]
28#[derive(Debug, Clone, Serialize, Deserialize)]
29#[serde(untagged)]
30pub enum PropertymappingsAllListError {
31    Status400(models::ValidationError),
32    Status403(models::GenericError),
33    UnknownValue(serde_json::Value),
34}
35
36/// struct for typed errors of method [`propertymappings_all_retrieve`]
37#[derive(Debug, Clone, Serialize, Deserialize)]
38#[serde(untagged)]
39pub enum PropertymappingsAllRetrieveError {
40    Status400(models::ValidationError),
41    Status403(models::GenericError),
42    UnknownValue(serde_json::Value),
43}
44
45/// struct for typed errors of method [`propertymappings_all_test_create`]
46#[derive(Debug, Clone, Serialize, Deserialize)]
47#[serde(untagged)]
48pub enum PropertymappingsAllTestCreateError {
49    Status400(),
50    Status403(models::GenericError),
51    UnknownValue(serde_json::Value),
52}
53
54/// struct for typed errors of method [`propertymappings_all_types_list`]
55#[derive(Debug, Clone, Serialize, Deserialize)]
56#[serde(untagged)]
57pub enum PropertymappingsAllTypesListError {
58    Status400(models::ValidationError),
59    Status403(models::GenericError),
60    UnknownValue(serde_json::Value),
61}
62
63/// struct for typed errors of method [`propertymappings_all_used_by_list`]
64#[derive(Debug, Clone, Serialize, Deserialize)]
65#[serde(untagged)]
66pub enum PropertymappingsAllUsedByListError {
67    Status400(models::ValidationError),
68    Status403(models::GenericError),
69    UnknownValue(serde_json::Value),
70}
71
72/// struct for typed errors of method [`propertymappings_ldap_create`]
73#[derive(Debug, Clone, Serialize, Deserialize)]
74#[serde(untagged)]
75pub enum PropertymappingsLdapCreateError {
76    Status400(models::ValidationError),
77    Status403(models::GenericError),
78    UnknownValue(serde_json::Value),
79}
80
81/// struct for typed errors of method [`propertymappings_ldap_destroy`]
82#[derive(Debug, Clone, Serialize, Deserialize)]
83#[serde(untagged)]
84pub enum PropertymappingsLdapDestroyError {
85    Status400(models::ValidationError),
86    Status403(models::GenericError),
87    UnknownValue(serde_json::Value),
88}
89
90/// struct for typed errors of method [`propertymappings_ldap_list`]
91#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum PropertymappingsLdapListError {
94    Status400(models::ValidationError),
95    Status403(models::GenericError),
96    UnknownValue(serde_json::Value),
97}
98
99/// struct for typed errors of method [`propertymappings_ldap_partial_update`]
100#[derive(Debug, Clone, Serialize, Deserialize)]
101#[serde(untagged)]
102pub enum PropertymappingsLdapPartialUpdateError {
103    Status400(models::ValidationError),
104    Status403(models::GenericError),
105    UnknownValue(serde_json::Value),
106}
107
108/// struct for typed errors of method [`propertymappings_ldap_retrieve`]
109#[derive(Debug, Clone, Serialize, Deserialize)]
110#[serde(untagged)]
111pub enum PropertymappingsLdapRetrieveError {
112    Status400(models::ValidationError),
113    Status403(models::GenericError),
114    UnknownValue(serde_json::Value),
115}
116
117/// struct for typed errors of method [`propertymappings_ldap_update`]
118#[derive(Debug, Clone, Serialize, Deserialize)]
119#[serde(untagged)]
120pub enum PropertymappingsLdapUpdateError {
121    Status400(models::ValidationError),
122    Status403(models::GenericError),
123    UnknownValue(serde_json::Value),
124}
125
126/// struct for typed errors of method [`propertymappings_ldap_used_by_list`]
127#[derive(Debug, Clone, Serialize, Deserialize)]
128#[serde(untagged)]
129pub enum PropertymappingsLdapUsedByListError {
130    Status400(models::ValidationError),
131    Status403(models::GenericError),
132    UnknownValue(serde_json::Value),
133}
134
135/// struct for typed errors of method [`propertymappings_notification_create`]
136#[derive(Debug, Clone, Serialize, Deserialize)]
137#[serde(untagged)]
138pub enum PropertymappingsNotificationCreateError {
139    Status400(models::ValidationError),
140    Status403(models::GenericError),
141    UnknownValue(serde_json::Value),
142}
143
144/// struct for typed errors of method [`propertymappings_notification_destroy`]
145#[derive(Debug, Clone, Serialize, Deserialize)]
146#[serde(untagged)]
147pub enum PropertymappingsNotificationDestroyError {
148    Status400(models::ValidationError),
149    Status403(models::GenericError),
150    UnknownValue(serde_json::Value),
151}
152
153/// struct for typed errors of method [`propertymappings_notification_list`]
154#[derive(Debug, Clone, Serialize, Deserialize)]
155#[serde(untagged)]
156pub enum PropertymappingsNotificationListError {
157    Status400(models::ValidationError),
158    Status403(models::GenericError),
159    UnknownValue(serde_json::Value),
160}
161
162/// struct for typed errors of method [`propertymappings_notification_partial_update`]
163#[derive(Debug, Clone, Serialize, Deserialize)]
164#[serde(untagged)]
165pub enum PropertymappingsNotificationPartialUpdateError {
166    Status400(models::ValidationError),
167    Status403(models::GenericError),
168    UnknownValue(serde_json::Value),
169}
170
171/// struct for typed errors of method [`propertymappings_notification_retrieve`]
172#[derive(Debug, Clone, Serialize, Deserialize)]
173#[serde(untagged)]
174pub enum PropertymappingsNotificationRetrieveError {
175    Status400(models::ValidationError),
176    Status403(models::GenericError),
177    UnknownValue(serde_json::Value),
178}
179
180/// struct for typed errors of method [`propertymappings_notification_update`]
181#[derive(Debug, Clone, Serialize, Deserialize)]
182#[serde(untagged)]
183pub enum PropertymappingsNotificationUpdateError {
184    Status400(models::ValidationError),
185    Status403(models::GenericError),
186    UnknownValue(serde_json::Value),
187}
188
189/// struct for typed errors of method [`propertymappings_notification_used_by_list`]
190#[derive(Debug, Clone, Serialize, Deserialize)]
191#[serde(untagged)]
192pub enum PropertymappingsNotificationUsedByListError {
193    Status400(models::ValidationError),
194    Status403(models::GenericError),
195    UnknownValue(serde_json::Value),
196}
197
198/// struct for typed errors of method [`propertymappings_rac_create`]
199#[derive(Debug, Clone, Serialize, Deserialize)]
200#[serde(untagged)]
201pub enum PropertymappingsRacCreateError {
202    Status400(models::ValidationError),
203    Status403(models::GenericError),
204    UnknownValue(serde_json::Value),
205}
206
207/// struct for typed errors of method [`propertymappings_rac_destroy`]
208#[derive(Debug, Clone, Serialize, Deserialize)]
209#[serde(untagged)]
210pub enum PropertymappingsRacDestroyError {
211    Status400(models::ValidationError),
212    Status403(models::GenericError),
213    UnknownValue(serde_json::Value),
214}
215
216/// struct for typed errors of method [`propertymappings_rac_list`]
217#[derive(Debug, Clone, Serialize, Deserialize)]
218#[serde(untagged)]
219pub enum PropertymappingsRacListError {
220    Status400(models::ValidationError),
221    Status403(models::GenericError),
222    UnknownValue(serde_json::Value),
223}
224
225/// struct for typed errors of method [`propertymappings_rac_partial_update`]
226#[derive(Debug, Clone, Serialize, Deserialize)]
227#[serde(untagged)]
228pub enum PropertymappingsRacPartialUpdateError {
229    Status400(models::ValidationError),
230    Status403(models::GenericError),
231    UnknownValue(serde_json::Value),
232}
233
234/// struct for typed errors of method [`propertymappings_rac_retrieve`]
235#[derive(Debug, Clone, Serialize, Deserialize)]
236#[serde(untagged)]
237pub enum PropertymappingsRacRetrieveError {
238    Status400(models::ValidationError),
239    Status403(models::GenericError),
240    UnknownValue(serde_json::Value),
241}
242
243/// struct for typed errors of method [`propertymappings_rac_update`]
244#[derive(Debug, Clone, Serialize, Deserialize)]
245#[serde(untagged)]
246pub enum PropertymappingsRacUpdateError {
247    Status400(models::ValidationError),
248    Status403(models::GenericError),
249    UnknownValue(serde_json::Value),
250}
251
252/// struct for typed errors of method [`propertymappings_rac_used_by_list`]
253#[derive(Debug, Clone, Serialize, Deserialize)]
254#[serde(untagged)]
255pub enum PropertymappingsRacUsedByListError {
256    Status400(models::ValidationError),
257    Status403(models::GenericError),
258    UnknownValue(serde_json::Value),
259}
260
261/// struct for typed errors of method [`propertymappings_saml_create`]
262#[derive(Debug, Clone, Serialize, Deserialize)]
263#[serde(untagged)]
264pub enum PropertymappingsSamlCreateError {
265    Status400(models::ValidationError),
266    Status403(models::GenericError),
267    UnknownValue(serde_json::Value),
268}
269
270/// struct for typed errors of method [`propertymappings_saml_destroy`]
271#[derive(Debug, Clone, Serialize, Deserialize)]
272#[serde(untagged)]
273pub enum PropertymappingsSamlDestroyError {
274    Status400(models::ValidationError),
275    Status403(models::GenericError),
276    UnknownValue(serde_json::Value),
277}
278
279/// struct for typed errors of method [`propertymappings_saml_list`]
280#[derive(Debug, Clone, Serialize, Deserialize)]
281#[serde(untagged)]
282pub enum PropertymappingsSamlListError {
283    Status400(models::ValidationError),
284    Status403(models::GenericError),
285    UnknownValue(serde_json::Value),
286}
287
288/// struct for typed errors of method [`propertymappings_saml_partial_update`]
289#[derive(Debug, Clone, Serialize, Deserialize)]
290#[serde(untagged)]
291pub enum PropertymappingsSamlPartialUpdateError {
292    Status400(models::ValidationError),
293    Status403(models::GenericError),
294    UnknownValue(serde_json::Value),
295}
296
297/// struct for typed errors of method [`propertymappings_saml_retrieve`]
298#[derive(Debug, Clone, Serialize, Deserialize)]
299#[serde(untagged)]
300pub enum PropertymappingsSamlRetrieveError {
301    Status400(models::ValidationError),
302    Status403(models::GenericError),
303    UnknownValue(serde_json::Value),
304}
305
306/// struct for typed errors of method [`propertymappings_saml_update`]
307#[derive(Debug, Clone, Serialize, Deserialize)]
308#[serde(untagged)]
309pub enum PropertymappingsSamlUpdateError {
310    Status400(models::ValidationError),
311    Status403(models::GenericError),
312    UnknownValue(serde_json::Value),
313}
314
315/// struct for typed errors of method [`propertymappings_saml_used_by_list`]
316#[derive(Debug, Clone, Serialize, Deserialize)]
317#[serde(untagged)]
318pub enum PropertymappingsSamlUsedByListError {
319    Status400(models::ValidationError),
320    Status403(models::GenericError),
321    UnknownValue(serde_json::Value),
322}
323
324/// struct for typed errors of method [`propertymappings_scim_create`]
325#[derive(Debug, Clone, Serialize, Deserialize)]
326#[serde(untagged)]
327pub enum PropertymappingsScimCreateError {
328    Status400(models::ValidationError),
329    Status403(models::GenericError),
330    UnknownValue(serde_json::Value),
331}
332
333/// struct for typed errors of method [`propertymappings_scim_destroy`]
334#[derive(Debug, Clone, Serialize, Deserialize)]
335#[serde(untagged)]
336pub enum PropertymappingsScimDestroyError {
337    Status400(models::ValidationError),
338    Status403(models::GenericError),
339    UnknownValue(serde_json::Value),
340}
341
342/// struct for typed errors of method [`propertymappings_scim_list`]
343#[derive(Debug, Clone, Serialize, Deserialize)]
344#[serde(untagged)]
345pub enum PropertymappingsScimListError {
346    Status400(models::ValidationError),
347    Status403(models::GenericError),
348    UnknownValue(serde_json::Value),
349}
350
351/// struct for typed errors of method [`propertymappings_scim_partial_update`]
352#[derive(Debug, Clone, Serialize, Deserialize)]
353#[serde(untagged)]
354pub enum PropertymappingsScimPartialUpdateError {
355    Status400(models::ValidationError),
356    Status403(models::GenericError),
357    UnknownValue(serde_json::Value),
358}
359
360/// struct for typed errors of method [`propertymappings_scim_retrieve`]
361#[derive(Debug, Clone, Serialize, Deserialize)]
362#[serde(untagged)]
363pub enum PropertymappingsScimRetrieveError {
364    Status400(models::ValidationError),
365    Status403(models::GenericError),
366    UnknownValue(serde_json::Value),
367}
368
369/// struct for typed errors of method [`propertymappings_scim_update`]
370#[derive(Debug, Clone, Serialize, Deserialize)]
371#[serde(untagged)]
372pub enum PropertymappingsScimUpdateError {
373    Status400(models::ValidationError),
374    Status403(models::GenericError),
375    UnknownValue(serde_json::Value),
376}
377
378/// struct for typed errors of method [`propertymappings_scim_used_by_list`]
379#[derive(Debug, Clone, Serialize, Deserialize)]
380#[serde(untagged)]
381pub enum PropertymappingsScimUsedByListError {
382    Status400(models::ValidationError),
383    Status403(models::GenericError),
384    UnknownValue(serde_json::Value),
385}
386
387/// struct for typed errors of method [`propertymappings_scope_create`]
388#[derive(Debug, Clone, Serialize, Deserialize)]
389#[serde(untagged)]
390pub enum PropertymappingsScopeCreateError {
391    Status400(models::ValidationError),
392    Status403(models::GenericError),
393    UnknownValue(serde_json::Value),
394}
395
396/// struct for typed errors of method [`propertymappings_scope_destroy`]
397#[derive(Debug, Clone, Serialize, Deserialize)]
398#[serde(untagged)]
399pub enum PropertymappingsScopeDestroyError {
400    Status400(models::ValidationError),
401    Status403(models::GenericError),
402    UnknownValue(serde_json::Value),
403}
404
405/// struct for typed errors of method [`propertymappings_scope_list`]
406#[derive(Debug, Clone, Serialize, Deserialize)]
407#[serde(untagged)]
408pub enum PropertymappingsScopeListError {
409    Status400(models::ValidationError),
410    Status403(models::GenericError),
411    UnknownValue(serde_json::Value),
412}
413
414/// struct for typed errors of method [`propertymappings_scope_partial_update`]
415#[derive(Debug, Clone, Serialize, Deserialize)]
416#[serde(untagged)]
417pub enum PropertymappingsScopePartialUpdateError {
418    Status400(models::ValidationError),
419    Status403(models::GenericError),
420    UnknownValue(serde_json::Value),
421}
422
423/// struct for typed errors of method [`propertymappings_scope_retrieve`]
424#[derive(Debug, Clone, Serialize, Deserialize)]
425#[serde(untagged)]
426pub enum PropertymappingsScopeRetrieveError {
427    Status400(models::ValidationError),
428    Status403(models::GenericError),
429    UnknownValue(serde_json::Value),
430}
431
432/// struct for typed errors of method [`propertymappings_scope_update`]
433#[derive(Debug, Clone, Serialize, Deserialize)]
434#[serde(untagged)]
435pub enum PropertymappingsScopeUpdateError {
436    Status400(models::ValidationError),
437    Status403(models::GenericError),
438    UnknownValue(serde_json::Value),
439}
440
441/// struct for typed errors of method [`propertymappings_scope_used_by_list`]
442#[derive(Debug, Clone, Serialize, Deserialize)]
443#[serde(untagged)]
444pub enum PropertymappingsScopeUsedByListError {
445    Status400(models::ValidationError),
446    Status403(models::GenericError),
447    UnknownValue(serde_json::Value),
448}
449
450
451/// PropertyMapping Viewset
452pub async fn propertymappings_all_destroy(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<(), Error<PropertymappingsAllDestroyError>> {
453    let local_var_configuration = configuration;
454
455    let local_var_client = &local_var_configuration.client;
456
457    let local_var_uri_str = format!("{}/propertymappings/all/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
458    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
459
460    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
461        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
462    }
463    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
464        let local_var_key = local_var_apikey.key.clone();
465        let local_var_value = match local_var_apikey.prefix {
466            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
467            None => local_var_key,
468        };
469        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
470    };
471
472    let local_var_req = local_var_req_builder.build()?;
473    let local_var_resp = local_var_client.execute(local_var_req).await?;
474
475    let local_var_status = local_var_resp.status();
476    let local_var_content = local_var_resp.text().await?;
477
478    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
479        Ok(())
480    } else {
481        let local_var_entity: Option<PropertymappingsAllDestroyError> = serde_json::from_str(&local_var_content).ok();
482        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
483        Err(Error::ResponseError(local_var_error))
484    }
485}
486
487/// PropertyMapping Viewset
488pub async fn propertymappings_all_list(configuration: &configuration::Configuration, managed__isnull: Option<bool>, ordering: Option<&str>, page: Option<i32>, page_size: Option<i32>, search: Option<&str>) -> Result<models::PaginatedPropertyMappingList, Error<PropertymappingsAllListError>> {
489    let local_var_configuration = configuration;
490
491    let local_var_client = &local_var_configuration.client;
492
493    let local_var_uri_str = format!("{}/propertymappings/all/", local_var_configuration.base_path);
494    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
495
496    if let Some(ref local_var_str) = managed__isnull {
497        local_var_req_builder = local_var_req_builder.query(&[("managed__isnull", &local_var_str.to_string())]);
498    }
499    if let Some(ref local_var_str) = ordering {
500        local_var_req_builder = local_var_req_builder.query(&[("ordering", &local_var_str.to_string())]);
501    }
502    if let Some(ref local_var_str) = page {
503        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
504    }
505    if let Some(ref local_var_str) = page_size {
506        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
507    }
508    if let Some(ref local_var_str) = search {
509        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
510    }
511    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
512        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
513    }
514    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
515        let local_var_key = local_var_apikey.key.clone();
516        let local_var_value = match local_var_apikey.prefix {
517            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
518            None => local_var_key,
519        };
520        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
521    };
522
523    let local_var_req = local_var_req_builder.build()?;
524    let local_var_resp = local_var_client.execute(local_var_req).await?;
525
526    let local_var_status = local_var_resp.status();
527    let local_var_content = local_var_resp.text().await?;
528
529    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
530        serde_json::from_str(&local_var_content).map_err(Error::from)
531    } else {
532        let local_var_entity: Option<PropertymappingsAllListError> = serde_json::from_str(&local_var_content).ok();
533        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
534        Err(Error::ResponseError(local_var_error))
535    }
536}
537
538/// PropertyMapping Viewset
539pub async fn propertymappings_all_retrieve(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<models::PropertyMapping, Error<PropertymappingsAllRetrieveError>> {
540    let local_var_configuration = configuration;
541
542    let local_var_client = &local_var_configuration.client;
543
544    let local_var_uri_str = format!("{}/propertymappings/all/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
545    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
546
547    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
548        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
549    }
550    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
551        let local_var_key = local_var_apikey.key.clone();
552        let local_var_value = match local_var_apikey.prefix {
553            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
554            None => local_var_key,
555        };
556        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
557    };
558
559    let local_var_req = local_var_req_builder.build()?;
560    let local_var_resp = local_var_client.execute(local_var_req).await?;
561
562    let local_var_status = local_var_resp.status();
563    let local_var_content = local_var_resp.text().await?;
564
565    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
566        serde_json::from_str(&local_var_content).map_err(Error::from)
567    } else {
568        let local_var_entity: Option<PropertymappingsAllRetrieveError> = serde_json::from_str(&local_var_content).ok();
569        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
570        Err(Error::ResponseError(local_var_error))
571    }
572}
573
574/// Test Property Mapping
575pub async fn propertymappings_all_test_create(configuration: &configuration::Configuration, pm_uuid: &str, policy_test_request: models::PolicyTestRequest, format_result: Option<bool>) -> Result<models::PropertyMappingTestResult, Error<PropertymappingsAllTestCreateError>> {
576    let local_var_configuration = configuration;
577
578    let local_var_client = &local_var_configuration.client;
579
580    let local_var_uri_str = format!("{}/propertymappings/all/{pm_uuid}/test/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
581    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
582
583    if let Some(ref local_var_str) = format_result {
584        local_var_req_builder = local_var_req_builder.query(&[("format_result", &local_var_str.to_string())]);
585    }
586    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
587        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
588    }
589    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
590        let local_var_key = local_var_apikey.key.clone();
591        let local_var_value = match local_var_apikey.prefix {
592            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
593            None => local_var_key,
594        };
595        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
596    };
597    local_var_req_builder = local_var_req_builder.json(&policy_test_request);
598
599    let local_var_req = local_var_req_builder.build()?;
600    let local_var_resp = local_var_client.execute(local_var_req).await?;
601
602    let local_var_status = local_var_resp.status();
603    let local_var_content = local_var_resp.text().await?;
604
605    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
606        serde_json::from_str(&local_var_content).map_err(Error::from)
607    } else {
608        let local_var_entity: Option<PropertymappingsAllTestCreateError> = serde_json::from_str(&local_var_content).ok();
609        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
610        Err(Error::ResponseError(local_var_error))
611    }
612}
613
614/// Get all creatable property-mapping types
615pub async fn propertymappings_all_types_list(configuration: &configuration::Configuration, ) -> Result<Vec<models::TypeCreate>, Error<PropertymappingsAllTypesListError>> {
616    let local_var_configuration = configuration;
617
618    let local_var_client = &local_var_configuration.client;
619
620    let local_var_uri_str = format!("{}/propertymappings/all/types/", local_var_configuration.base_path);
621    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
622
623    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
624        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
625    }
626    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
627        let local_var_key = local_var_apikey.key.clone();
628        let local_var_value = match local_var_apikey.prefix {
629            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
630            None => local_var_key,
631        };
632        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
633    };
634
635    let local_var_req = local_var_req_builder.build()?;
636    let local_var_resp = local_var_client.execute(local_var_req).await?;
637
638    let local_var_status = local_var_resp.status();
639    let local_var_content = local_var_resp.text().await?;
640
641    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
642        serde_json::from_str(&local_var_content).map_err(Error::from)
643    } else {
644        let local_var_entity: Option<PropertymappingsAllTypesListError> = serde_json::from_str(&local_var_content).ok();
645        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
646        Err(Error::ResponseError(local_var_error))
647    }
648}
649
650/// Get a list of all objects that use this object
651pub async fn propertymappings_all_used_by_list(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<Vec<models::UsedBy>, Error<PropertymappingsAllUsedByListError>> {
652    let local_var_configuration = configuration;
653
654    let local_var_client = &local_var_configuration.client;
655
656    let local_var_uri_str = format!("{}/propertymappings/all/{pm_uuid}/used_by/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
657    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
658
659    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
660        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
661    }
662    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
663        let local_var_key = local_var_apikey.key.clone();
664        let local_var_value = match local_var_apikey.prefix {
665            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
666            None => local_var_key,
667        };
668        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
669    };
670
671    let local_var_req = local_var_req_builder.build()?;
672    let local_var_resp = local_var_client.execute(local_var_req).await?;
673
674    let local_var_status = local_var_resp.status();
675    let local_var_content = local_var_resp.text().await?;
676
677    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
678        serde_json::from_str(&local_var_content).map_err(Error::from)
679    } else {
680        let local_var_entity: Option<PropertymappingsAllUsedByListError> = serde_json::from_str(&local_var_content).ok();
681        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
682        Err(Error::ResponseError(local_var_error))
683    }
684}
685
686/// LDAP PropertyMapping Viewset
687pub async fn propertymappings_ldap_create(configuration: &configuration::Configuration, ldap_property_mapping_request: models::LdapPropertyMappingRequest) -> Result<models::LdapPropertyMapping, Error<PropertymappingsLdapCreateError>> {
688    let local_var_configuration = configuration;
689
690    let local_var_client = &local_var_configuration.client;
691
692    let local_var_uri_str = format!("{}/propertymappings/ldap/", local_var_configuration.base_path);
693    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
694
695    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
696        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
697    }
698    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
699        let local_var_key = local_var_apikey.key.clone();
700        let local_var_value = match local_var_apikey.prefix {
701            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
702            None => local_var_key,
703        };
704        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
705    };
706    local_var_req_builder = local_var_req_builder.json(&ldap_property_mapping_request);
707
708    let local_var_req = local_var_req_builder.build()?;
709    let local_var_resp = local_var_client.execute(local_var_req).await?;
710
711    let local_var_status = local_var_resp.status();
712    let local_var_content = local_var_resp.text().await?;
713
714    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
715        serde_json::from_str(&local_var_content).map_err(Error::from)
716    } else {
717        let local_var_entity: Option<PropertymappingsLdapCreateError> = serde_json::from_str(&local_var_content).ok();
718        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
719        Err(Error::ResponseError(local_var_error))
720    }
721}
722
723/// LDAP PropertyMapping Viewset
724pub async fn propertymappings_ldap_destroy(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<(), Error<PropertymappingsLdapDestroyError>> {
725    let local_var_configuration = configuration;
726
727    let local_var_client = &local_var_configuration.client;
728
729    let local_var_uri_str = format!("{}/propertymappings/ldap/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
730    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
731
732    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
733        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
734    }
735    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
736        let local_var_key = local_var_apikey.key.clone();
737        let local_var_value = match local_var_apikey.prefix {
738            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
739            None => local_var_key,
740        };
741        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
742    };
743
744    let local_var_req = local_var_req_builder.build()?;
745    let local_var_resp = local_var_client.execute(local_var_req).await?;
746
747    let local_var_status = local_var_resp.status();
748    let local_var_content = local_var_resp.text().await?;
749
750    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
751        Ok(())
752    } else {
753        let local_var_entity: Option<PropertymappingsLdapDestroyError> = serde_json::from_str(&local_var_content).ok();
754        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
755        Err(Error::ResponseError(local_var_error))
756    }
757}
758
759/// LDAP PropertyMapping Viewset
760pub async fn propertymappings_ldap_list(configuration: &configuration::Configuration, expression: Option<&str>, managed: Option<Vec<String>>, name: Option<&str>, object_field: Option<&str>, ordering: Option<&str>, page: Option<i32>, page_size: Option<i32>, pm_uuid: Option<&str>, search: Option<&str>) -> Result<models::PaginatedLdapPropertyMappingList, Error<PropertymappingsLdapListError>> {
761    let local_var_configuration = configuration;
762
763    let local_var_client = &local_var_configuration.client;
764
765    let local_var_uri_str = format!("{}/propertymappings/ldap/", local_var_configuration.base_path);
766    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
767
768    if let Some(ref local_var_str) = expression {
769        local_var_req_builder = local_var_req_builder.query(&[("expression", &local_var_str.to_string())]);
770    }
771    if let Some(ref local_var_str) = managed {
772        local_var_req_builder = match "multi" {
773            "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("managed".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
774            _ => local_var_req_builder.query(&[("managed", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
775        };
776    }
777    if let Some(ref local_var_str) = name {
778        local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
779    }
780    if let Some(ref local_var_str) = object_field {
781        local_var_req_builder = local_var_req_builder.query(&[("object_field", &local_var_str.to_string())]);
782    }
783    if let Some(ref local_var_str) = ordering {
784        local_var_req_builder = local_var_req_builder.query(&[("ordering", &local_var_str.to_string())]);
785    }
786    if let Some(ref local_var_str) = page {
787        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
788    }
789    if let Some(ref local_var_str) = page_size {
790        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
791    }
792    if let Some(ref local_var_str) = pm_uuid {
793        local_var_req_builder = local_var_req_builder.query(&[("pm_uuid", &local_var_str.to_string())]);
794    }
795    if let Some(ref local_var_str) = search {
796        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
797    }
798    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
799        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
800    }
801    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
802        let local_var_key = local_var_apikey.key.clone();
803        let local_var_value = match local_var_apikey.prefix {
804            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
805            None => local_var_key,
806        };
807        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
808    };
809
810    let local_var_req = local_var_req_builder.build()?;
811    let local_var_resp = local_var_client.execute(local_var_req).await?;
812
813    let local_var_status = local_var_resp.status();
814    let local_var_content = local_var_resp.text().await?;
815
816    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
817        serde_json::from_str(&local_var_content).map_err(Error::from)
818    } else {
819        let local_var_entity: Option<PropertymappingsLdapListError> = serde_json::from_str(&local_var_content).ok();
820        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
821        Err(Error::ResponseError(local_var_error))
822    }
823}
824
825/// LDAP PropertyMapping Viewset
826pub async fn propertymappings_ldap_partial_update(configuration: &configuration::Configuration, pm_uuid: &str, patched_ldap_property_mapping_request: Option<models::PatchedLdapPropertyMappingRequest>) -> Result<models::LdapPropertyMapping, Error<PropertymappingsLdapPartialUpdateError>> {
827    let local_var_configuration = configuration;
828
829    let local_var_client = &local_var_configuration.client;
830
831    let local_var_uri_str = format!("{}/propertymappings/ldap/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
832    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
833
834    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
835        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
836    }
837    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
838        let local_var_key = local_var_apikey.key.clone();
839        let local_var_value = match local_var_apikey.prefix {
840            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
841            None => local_var_key,
842        };
843        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
844    };
845    local_var_req_builder = local_var_req_builder.json(&patched_ldap_property_mapping_request);
846
847    let local_var_req = local_var_req_builder.build()?;
848    let local_var_resp = local_var_client.execute(local_var_req).await?;
849
850    let local_var_status = local_var_resp.status();
851    let local_var_content = local_var_resp.text().await?;
852
853    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
854        serde_json::from_str(&local_var_content).map_err(Error::from)
855    } else {
856        let local_var_entity: Option<PropertymappingsLdapPartialUpdateError> = serde_json::from_str(&local_var_content).ok();
857        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
858        Err(Error::ResponseError(local_var_error))
859    }
860}
861
862/// LDAP PropertyMapping Viewset
863pub async fn propertymappings_ldap_retrieve(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<models::LdapPropertyMapping, Error<PropertymappingsLdapRetrieveError>> {
864    let local_var_configuration = configuration;
865
866    let local_var_client = &local_var_configuration.client;
867
868    let local_var_uri_str = format!("{}/propertymappings/ldap/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
869    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
870
871    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
872        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
873    }
874    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
875        let local_var_key = local_var_apikey.key.clone();
876        let local_var_value = match local_var_apikey.prefix {
877            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
878            None => local_var_key,
879        };
880        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
881    };
882
883    let local_var_req = local_var_req_builder.build()?;
884    let local_var_resp = local_var_client.execute(local_var_req).await?;
885
886    let local_var_status = local_var_resp.status();
887    let local_var_content = local_var_resp.text().await?;
888
889    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
890        serde_json::from_str(&local_var_content).map_err(Error::from)
891    } else {
892        let local_var_entity: Option<PropertymappingsLdapRetrieveError> = serde_json::from_str(&local_var_content).ok();
893        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
894        Err(Error::ResponseError(local_var_error))
895    }
896}
897
898/// LDAP PropertyMapping Viewset
899pub async fn propertymappings_ldap_update(configuration: &configuration::Configuration, pm_uuid: &str, ldap_property_mapping_request: models::LdapPropertyMappingRequest) -> Result<models::LdapPropertyMapping, Error<PropertymappingsLdapUpdateError>> {
900    let local_var_configuration = configuration;
901
902    let local_var_client = &local_var_configuration.client;
903
904    let local_var_uri_str = format!("{}/propertymappings/ldap/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
905    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
906
907    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
908        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
909    }
910    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
911        let local_var_key = local_var_apikey.key.clone();
912        let local_var_value = match local_var_apikey.prefix {
913            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
914            None => local_var_key,
915        };
916        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
917    };
918    local_var_req_builder = local_var_req_builder.json(&ldap_property_mapping_request);
919
920    let local_var_req = local_var_req_builder.build()?;
921    let local_var_resp = local_var_client.execute(local_var_req).await?;
922
923    let local_var_status = local_var_resp.status();
924    let local_var_content = local_var_resp.text().await?;
925
926    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
927        serde_json::from_str(&local_var_content).map_err(Error::from)
928    } else {
929        let local_var_entity: Option<PropertymappingsLdapUpdateError> = serde_json::from_str(&local_var_content).ok();
930        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
931        Err(Error::ResponseError(local_var_error))
932    }
933}
934
935/// Get a list of all objects that use this object
936pub async fn propertymappings_ldap_used_by_list(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<Vec<models::UsedBy>, Error<PropertymappingsLdapUsedByListError>> {
937    let local_var_configuration = configuration;
938
939    let local_var_client = &local_var_configuration.client;
940
941    let local_var_uri_str = format!("{}/propertymappings/ldap/{pm_uuid}/used_by/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
942    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
943
944    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
945        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
946    }
947    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
948        let local_var_key = local_var_apikey.key.clone();
949        let local_var_value = match local_var_apikey.prefix {
950            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
951            None => local_var_key,
952        };
953        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
954    };
955
956    let local_var_req = local_var_req_builder.build()?;
957    let local_var_resp = local_var_client.execute(local_var_req).await?;
958
959    let local_var_status = local_var_resp.status();
960    let local_var_content = local_var_resp.text().await?;
961
962    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
963        serde_json::from_str(&local_var_content).map_err(Error::from)
964    } else {
965        let local_var_entity: Option<PropertymappingsLdapUsedByListError> = serde_json::from_str(&local_var_content).ok();
966        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
967        Err(Error::ResponseError(local_var_error))
968    }
969}
970
971/// NotificationWebhookMapping Viewset
972pub async fn propertymappings_notification_create(configuration: &configuration::Configuration, notification_webhook_mapping_request: models::NotificationWebhookMappingRequest) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationCreateError>> {
973    let local_var_configuration = configuration;
974
975    let local_var_client = &local_var_configuration.client;
976
977    let local_var_uri_str = format!("{}/propertymappings/notification/", local_var_configuration.base_path);
978    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
979
980    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
981        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
982    }
983    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
984        let local_var_key = local_var_apikey.key.clone();
985        let local_var_value = match local_var_apikey.prefix {
986            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
987            None => local_var_key,
988        };
989        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
990    };
991    local_var_req_builder = local_var_req_builder.json(&notification_webhook_mapping_request);
992
993    let local_var_req = local_var_req_builder.build()?;
994    let local_var_resp = local_var_client.execute(local_var_req).await?;
995
996    let local_var_status = local_var_resp.status();
997    let local_var_content = local_var_resp.text().await?;
998
999    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1000        serde_json::from_str(&local_var_content).map_err(Error::from)
1001    } else {
1002        let local_var_entity: Option<PropertymappingsNotificationCreateError> = serde_json::from_str(&local_var_content).ok();
1003        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1004        Err(Error::ResponseError(local_var_error))
1005    }
1006}
1007
1008/// NotificationWebhookMapping Viewset
1009pub async fn propertymappings_notification_destroy(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<(), Error<PropertymappingsNotificationDestroyError>> {
1010    let local_var_configuration = configuration;
1011
1012    let local_var_client = &local_var_configuration.client;
1013
1014    let local_var_uri_str = format!("{}/propertymappings/notification/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1015    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1016
1017    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1018        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1019    }
1020    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1021        let local_var_key = local_var_apikey.key.clone();
1022        let local_var_value = match local_var_apikey.prefix {
1023            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1024            None => local_var_key,
1025        };
1026        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1027    };
1028
1029    let local_var_req = local_var_req_builder.build()?;
1030    let local_var_resp = local_var_client.execute(local_var_req).await?;
1031
1032    let local_var_status = local_var_resp.status();
1033    let local_var_content = local_var_resp.text().await?;
1034
1035    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1036        Ok(())
1037    } else {
1038        let local_var_entity: Option<PropertymappingsNotificationDestroyError> = serde_json::from_str(&local_var_content).ok();
1039        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1040        Err(Error::ResponseError(local_var_error))
1041    }
1042}
1043
1044/// NotificationWebhookMapping Viewset
1045pub async fn propertymappings_notification_list(configuration: &configuration::Configuration, name: Option<&str>, ordering: Option<&str>, page: Option<i32>, page_size: Option<i32>, search: Option<&str>) -> Result<models::PaginatedNotificationWebhookMappingList, Error<PropertymappingsNotificationListError>> {
1046    let local_var_configuration = configuration;
1047
1048    let local_var_client = &local_var_configuration.client;
1049
1050    let local_var_uri_str = format!("{}/propertymappings/notification/", local_var_configuration.base_path);
1051    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1052
1053    if let Some(ref local_var_str) = name {
1054        local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
1055    }
1056    if let Some(ref local_var_str) = ordering {
1057        local_var_req_builder = local_var_req_builder.query(&[("ordering", &local_var_str.to_string())]);
1058    }
1059    if let Some(ref local_var_str) = page {
1060        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1061    }
1062    if let Some(ref local_var_str) = page_size {
1063        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
1064    }
1065    if let Some(ref local_var_str) = search {
1066        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
1067    }
1068    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1069        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1070    }
1071    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1072        let local_var_key = local_var_apikey.key.clone();
1073        let local_var_value = match local_var_apikey.prefix {
1074            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1075            None => local_var_key,
1076        };
1077        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1078    };
1079
1080    let local_var_req = local_var_req_builder.build()?;
1081    let local_var_resp = local_var_client.execute(local_var_req).await?;
1082
1083    let local_var_status = local_var_resp.status();
1084    let local_var_content = local_var_resp.text().await?;
1085
1086    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1087        serde_json::from_str(&local_var_content).map_err(Error::from)
1088    } else {
1089        let local_var_entity: Option<PropertymappingsNotificationListError> = serde_json::from_str(&local_var_content).ok();
1090        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1091        Err(Error::ResponseError(local_var_error))
1092    }
1093}
1094
1095/// NotificationWebhookMapping Viewset
1096pub async fn propertymappings_notification_partial_update(configuration: &configuration::Configuration, pm_uuid: &str, patched_notification_webhook_mapping_request: Option<models::PatchedNotificationWebhookMappingRequest>) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationPartialUpdateError>> {
1097    let local_var_configuration = configuration;
1098
1099    let local_var_client = &local_var_configuration.client;
1100
1101    let local_var_uri_str = format!("{}/propertymappings/notification/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1102    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1103
1104    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1105        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1106    }
1107    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1108        let local_var_key = local_var_apikey.key.clone();
1109        let local_var_value = match local_var_apikey.prefix {
1110            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1111            None => local_var_key,
1112        };
1113        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1114    };
1115    local_var_req_builder = local_var_req_builder.json(&patched_notification_webhook_mapping_request);
1116
1117    let local_var_req = local_var_req_builder.build()?;
1118    let local_var_resp = local_var_client.execute(local_var_req).await?;
1119
1120    let local_var_status = local_var_resp.status();
1121    let local_var_content = local_var_resp.text().await?;
1122
1123    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1124        serde_json::from_str(&local_var_content).map_err(Error::from)
1125    } else {
1126        let local_var_entity: Option<PropertymappingsNotificationPartialUpdateError> = serde_json::from_str(&local_var_content).ok();
1127        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1128        Err(Error::ResponseError(local_var_error))
1129    }
1130}
1131
1132/// NotificationWebhookMapping Viewset
1133pub async fn propertymappings_notification_retrieve(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationRetrieveError>> {
1134    let local_var_configuration = configuration;
1135
1136    let local_var_client = &local_var_configuration.client;
1137
1138    let local_var_uri_str = format!("{}/propertymappings/notification/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1139    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1140
1141    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1142        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1143    }
1144    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1145        let local_var_key = local_var_apikey.key.clone();
1146        let local_var_value = match local_var_apikey.prefix {
1147            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1148            None => local_var_key,
1149        };
1150        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1151    };
1152
1153    let local_var_req = local_var_req_builder.build()?;
1154    let local_var_resp = local_var_client.execute(local_var_req).await?;
1155
1156    let local_var_status = local_var_resp.status();
1157    let local_var_content = local_var_resp.text().await?;
1158
1159    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1160        serde_json::from_str(&local_var_content).map_err(Error::from)
1161    } else {
1162        let local_var_entity: Option<PropertymappingsNotificationRetrieveError> = serde_json::from_str(&local_var_content).ok();
1163        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1164        Err(Error::ResponseError(local_var_error))
1165    }
1166}
1167
1168/// NotificationWebhookMapping Viewset
1169pub async fn propertymappings_notification_update(configuration: &configuration::Configuration, pm_uuid: &str, notification_webhook_mapping_request: models::NotificationWebhookMappingRequest) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationUpdateError>> {
1170    let local_var_configuration = configuration;
1171
1172    let local_var_client = &local_var_configuration.client;
1173
1174    let local_var_uri_str = format!("{}/propertymappings/notification/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1175    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1176
1177    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1178        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1179    }
1180    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1181        let local_var_key = local_var_apikey.key.clone();
1182        let local_var_value = match local_var_apikey.prefix {
1183            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1184            None => local_var_key,
1185        };
1186        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1187    };
1188    local_var_req_builder = local_var_req_builder.json(&notification_webhook_mapping_request);
1189
1190    let local_var_req = local_var_req_builder.build()?;
1191    let local_var_resp = local_var_client.execute(local_var_req).await?;
1192
1193    let local_var_status = local_var_resp.status();
1194    let local_var_content = local_var_resp.text().await?;
1195
1196    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1197        serde_json::from_str(&local_var_content).map_err(Error::from)
1198    } else {
1199        let local_var_entity: Option<PropertymappingsNotificationUpdateError> = serde_json::from_str(&local_var_content).ok();
1200        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1201        Err(Error::ResponseError(local_var_error))
1202    }
1203}
1204
1205/// Get a list of all objects that use this object
1206pub async fn propertymappings_notification_used_by_list(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<Vec<models::UsedBy>, Error<PropertymappingsNotificationUsedByListError>> {
1207    let local_var_configuration = configuration;
1208
1209    let local_var_client = &local_var_configuration.client;
1210
1211    let local_var_uri_str = format!("{}/propertymappings/notification/{pm_uuid}/used_by/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1212    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1213
1214    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1215        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1216    }
1217    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1218        let local_var_key = local_var_apikey.key.clone();
1219        let local_var_value = match local_var_apikey.prefix {
1220            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1221            None => local_var_key,
1222        };
1223        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1224    };
1225
1226    let local_var_req = local_var_req_builder.build()?;
1227    let local_var_resp = local_var_client.execute(local_var_req).await?;
1228
1229    let local_var_status = local_var_resp.status();
1230    let local_var_content = local_var_resp.text().await?;
1231
1232    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1233        serde_json::from_str(&local_var_content).map_err(Error::from)
1234    } else {
1235        let local_var_entity: Option<PropertymappingsNotificationUsedByListError> = serde_json::from_str(&local_var_content).ok();
1236        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1237        Err(Error::ResponseError(local_var_error))
1238    }
1239}
1240
1241/// RACPropertyMapping Viewset
1242pub async fn propertymappings_rac_create(configuration: &configuration::Configuration, rac_property_mapping_request: models::RacPropertyMappingRequest) -> Result<models::RacPropertyMapping, Error<PropertymappingsRacCreateError>> {
1243    let local_var_configuration = configuration;
1244
1245    let local_var_client = &local_var_configuration.client;
1246
1247    let local_var_uri_str = format!("{}/propertymappings/rac/", local_var_configuration.base_path);
1248    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1249
1250    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1251        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1252    }
1253    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1254        let local_var_key = local_var_apikey.key.clone();
1255        let local_var_value = match local_var_apikey.prefix {
1256            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1257            None => local_var_key,
1258        };
1259        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1260    };
1261    local_var_req_builder = local_var_req_builder.json(&rac_property_mapping_request);
1262
1263    let local_var_req = local_var_req_builder.build()?;
1264    let local_var_resp = local_var_client.execute(local_var_req).await?;
1265
1266    let local_var_status = local_var_resp.status();
1267    let local_var_content = local_var_resp.text().await?;
1268
1269    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1270        serde_json::from_str(&local_var_content).map_err(Error::from)
1271    } else {
1272        let local_var_entity: Option<PropertymappingsRacCreateError> = serde_json::from_str(&local_var_content).ok();
1273        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1274        Err(Error::ResponseError(local_var_error))
1275    }
1276}
1277
1278/// RACPropertyMapping Viewset
1279pub async fn propertymappings_rac_destroy(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<(), Error<PropertymappingsRacDestroyError>> {
1280    let local_var_configuration = configuration;
1281
1282    let local_var_client = &local_var_configuration.client;
1283
1284    let local_var_uri_str = format!("{}/propertymappings/rac/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1285    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1286
1287    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1288        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1289    }
1290    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1291        let local_var_key = local_var_apikey.key.clone();
1292        let local_var_value = match local_var_apikey.prefix {
1293            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1294            None => local_var_key,
1295        };
1296        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1297    };
1298
1299    let local_var_req = local_var_req_builder.build()?;
1300    let local_var_resp = local_var_client.execute(local_var_req).await?;
1301
1302    let local_var_status = local_var_resp.status();
1303    let local_var_content = local_var_resp.text().await?;
1304
1305    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1306        Ok(())
1307    } else {
1308        let local_var_entity: Option<PropertymappingsRacDestroyError> = serde_json::from_str(&local_var_content).ok();
1309        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1310        Err(Error::ResponseError(local_var_error))
1311    }
1312}
1313
1314/// RACPropertyMapping Viewset
1315pub async fn propertymappings_rac_list(configuration: &configuration::Configuration, managed: Option<Vec<String>>, name: Option<&str>, ordering: Option<&str>, page: Option<i32>, page_size: Option<i32>, search: Option<&str>) -> Result<models::PaginatedRacPropertyMappingList, Error<PropertymappingsRacListError>> {
1316    let local_var_configuration = configuration;
1317
1318    let local_var_client = &local_var_configuration.client;
1319
1320    let local_var_uri_str = format!("{}/propertymappings/rac/", local_var_configuration.base_path);
1321    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1322
1323    if let Some(ref local_var_str) = managed {
1324        local_var_req_builder = match "multi" {
1325            "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("managed".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
1326            _ => local_var_req_builder.query(&[("managed", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
1327        };
1328    }
1329    if let Some(ref local_var_str) = name {
1330        local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
1331    }
1332    if let Some(ref local_var_str) = ordering {
1333        local_var_req_builder = local_var_req_builder.query(&[("ordering", &local_var_str.to_string())]);
1334    }
1335    if let Some(ref local_var_str) = page {
1336        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1337    }
1338    if let Some(ref local_var_str) = page_size {
1339        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
1340    }
1341    if let Some(ref local_var_str) = search {
1342        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
1343    }
1344    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1345        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1346    }
1347    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1348        let local_var_key = local_var_apikey.key.clone();
1349        let local_var_value = match local_var_apikey.prefix {
1350            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1351            None => local_var_key,
1352        };
1353        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1354    };
1355
1356    let local_var_req = local_var_req_builder.build()?;
1357    let local_var_resp = local_var_client.execute(local_var_req).await?;
1358
1359    let local_var_status = local_var_resp.status();
1360    let local_var_content = local_var_resp.text().await?;
1361
1362    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1363        serde_json::from_str(&local_var_content).map_err(Error::from)
1364    } else {
1365        let local_var_entity: Option<PropertymappingsRacListError> = serde_json::from_str(&local_var_content).ok();
1366        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1367        Err(Error::ResponseError(local_var_error))
1368    }
1369}
1370
1371/// RACPropertyMapping Viewset
1372pub async fn propertymappings_rac_partial_update(configuration: &configuration::Configuration, pm_uuid: &str, patched_rac_property_mapping_request: Option<models::PatchedRacPropertyMappingRequest>) -> Result<models::RacPropertyMapping, Error<PropertymappingsRacPartialUpdateError>> {
1373    let local_var_configuration = configuration;
1374
1375    let local_var_client = &local_var_configuration.client;
1376
1377    let local_var_uri_str = format!("{}/propertymappings/rac/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1378    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1379
1380    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1381        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1382    }
1383    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1384        let local_var_key = local_var_apikey.key.clone();
1385        let local_var_value = match local_var_apikey.prefix {
1386            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1387            None => local_var_key,
1388        };
1389        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1390    };
1391    local_var_req_builder = local_var_req_builder.json(&patched_rac_property_mapping_request);
1392
1393    let local_var_req = local_var_req_builder.build()?;
1394    let local_var_resp = local_var_client.execute(local_var_req).await?;
1395
1396    let local_var_status = local_var_resp.status();
1397    let local_var_content = local_var_resp.text().await?;
1398
1399    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1400        serde_json::from_str(&local_var_content).map_err(Error::from)
1401    } else {
1402        let local_var_entity: Option<PropertymappingsRacPartialUpdateError> = serde_json::from_str(&local_var_content).ok();
1403        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1404        Err(Error::ResponseError(local_var_error))
1405    }
1406}
1407
1408/// RACPropertyMapping Viewset
1409pub async fn propertymappings_rac_retrieve(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<models::RacPropertyMapping, Error<PropertymappingsRacRetrieveError>> {
1410    let local_var_configuration = configuration;
1411
1412    let local_var_client = &local_var_configuration.client;
1413
1414    let local_var_uri_str = format!("{}/propertymappings/rac/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1415    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1416
1417    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1418        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1419    }
1420    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1421        let local_var_key = local_var_apikey.key.clone();
1422        let local_var_value = match local_var_apikey.prefix {
1423            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1424            None => local_var_key,
1425        };
1426        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1427    };
1428
1429    let local_var_req = local_var_req_builder.build()?;
1430    let local_var_resp = local_var_client.execute(local_var_req).await?;
1431
1432    let local_var_status = local_var_resp.status();
1433    let local_var_content = local_var_resp.text().await?;
1434
1435    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1436        serde_json::from_str(&local_var_content).map_err(Error::from)
1437    } else {
1438        let local_var_entity: Option<PropertymappingsRacRetrieveError> = serde_json::from_str(&local_var_content).ok();
1439        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1440        Err(Error::ResponseError(local_var_error))
1441    }
1442}
1443
1444/// RACPropertyMapping Viewset
1445pub async fn propertymappings_rac_update(configuration: &configuration::Configuration, pm_uuid: &str, rac_property_mapping_request: models::RacPropertyMappingRequest) -> Result<models::RacPropertyMapping, Error<PropertymappingsRacUpdateError>> {
1446    let local_var_configuration = configuration;
1447
1448    let local_var_client = &local_var_configuration.client;
1449
1450    let local_var_uri_str = format!("{}/propertymappings/rac/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1451    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1452
1453    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1454        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1455    }
1456    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1457        let local_var_key = local_var_apikey.key.clone();
1458        let local_var_value = match local_var_apikey.prefix {
1459            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1460            None => local_var_key,
1461        };
1462        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1463    };
1464    local_var_req_builder = local_var_req_builder.json(&rac_property_mapping_request);
1465
1466    let local_var_req = local_var_req_builder.build()?;
1467    let local_var_resp = local_var_client.execute(local_var_req).await?;
1468
1469    let local_var_status = local_var_resp.status();
1470    let local_var_content = local_var_resp.text().await?;
1471
1472    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1473        serde_json::from_str(&local_var_content).map_err(Error::from)
1474    } else {
1475        let local_var_entity: Option<PropertymappingsRacUpdateError> = serde_json::from_str(&local_var_content).ok();
1476        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1477        Err(Error::ResponseError(local_var_error))
1478    }
1479}
1480
1481/// Get a list of all objects that use this object
1482pub async fn propertymappings_rac_used_by_list(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<Vec<models::UsedBy>, Error<PropertymappingsRacUsedByListError>> {
1483    let local_var_configuration = configuration;
1484
1485    let local_var_client = &local_var_configuration.client;
1486
1487    let local_var_uri_str = format!("{}/propertymappings/rac/{pm_uuid}/used_by/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1488    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1489
1490    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1491        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1492    }
1493    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1494        let local_var_key = local_var_apikey.key.clone();
1495        let local_var_value = match local_var_apikey.prefix {
1496            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1497            None => local_var_key,
1498        };
1499        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1500    };
1501
1502    let local_var_req = local_var_req_builder.build()?;
1503    let local_var_resp = local_var_client.execute(local_var_req).await?;
1504
1505    let local_var_status = local_var_resp.status();
1506    let local_var_content = local_var_resp.text().await?;
1507
1508    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1509        serde_json::from_str(&local_var_content).map_err(Error::from)
1510    } else {
1511        let local_var_entity: Option<PropertymappingsRacUsedByListError> = serde_json::from_str(&local_var_content).ok();
1512        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1513        Err(Error::ResponseError(local_var_error))
1514    }
1515}
1516
1517/// SAMLPropertyMapping Viewset
1518pub async fn propertymappings_saml_create(configuration: &configuration::Configuration, saml_property_mapping_request: models::SamlPropertyMappingRequest) -> Result<models::SamlPropertyMapping, Error<PropertymappingsSamlCreateError>> {
1519    let local_var_configuration = configuration;
1520
1521    let local_var_client = &local_var_configuration.client;
1522
1523    let local_var_uri_str = format!("{}/propertymappings/saml/", local_var_configuration.base_path);
1524    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1525
1526    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1527        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1528    }
1529    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1530        let local_var_key = local_var_apikey.key.clone();
1531        let local_var_value = match local_var_apikey.prefix {
1532            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1533            None => local_var_key,
1534        };
1535        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1536    };
1537    local_var_req_builder = local_var_req_builder.json(&saml_property_mapping_request);
1538
1539    let local_var_req = local_var_req_builder.build()?;
1540    let local_var_resp = local_var_client.execute(local_var_req).await?;
1541
1542    let local_var_status = local_var_resp.status();
1543    let local_var_content = local_var_resp.text().await?;
1544
1545    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1546        serde_json::from_str(&local_var_content).map_err(Error::from)
1547    } else {
1548        let local_var_entity: Option<PropertymappingsSamlCreateError> = serde_json::from_str(&local_var_content).ok();
1549        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1550        Err(Error::ResponseError(local_var_error))
1551    }
1552}
1553
1554/// SAMLPropertyMapping Viewset
1555pub async fn propertymappings_saml_destroy(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<(), Error<PropertymappingsSamlDestroyError>> {
1556    let local_var_configuration = configuration;
1557
1558    let local_var_client = &local_var_configuration.client;
1559
1560    let local_var_uri_str = format!("{}/propertymappings/saml/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1561    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1562
1563    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1564        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1565    }
1566    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1567        let local_var_key = local_var_apikey.key.clone();
1568        let local_var_value = match local_var_apikey.prefix {
1569            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1570            None => local_var_key,
1571        };
1572        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1573    };
1574
1575    let local_var_req = local_var_req_builder.build()?;
1576    let local_var_resp = local_var_client.execute(local_var_req).await?;
1577
1578    let local_var_status = local_var_resp.status();
1579    let local_var_content = local_var_resp.text().await?;
1580
1581    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1582        Ok(())
1583    } else {
1584        let local_var_entity: Option<PropertymappingsSamlDestroyError> = serde_json::from_str(&local_var_content).ok();
1585        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1586        Err(Error::ResponseError(local_var_error))
1587    }
1588}
1589
1590/// SAMLPropertyMapping Viewset
1591pub async fn propertymappings_saml_list(configuration: &configuration::Configuration, expression: Option<&str>, friendly_name: Option<&str>, managed: Option<Vec<String>>, name: Option<&str>, ordering: Option<&str>, page: Option<i32>, page_size: Option<i32>, pm_uuid: Option<&str>, saml_name: Option<&str>, search: Option<&str>) -> Result<models::PaginatedSamlPropertyMappingList, Error<PropertymappingsSamlListError>> {
1592    let local_var_configuration = configuration;
1593
1594    let local_var_client = &local_var_configuration.client;
1595
1596    let local_var_uri_str = format!("{}/propertymappings/saml/", local_var_configuration.base_path);
1597    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1598
1599    if let Some(ref local_var_str) = expression {
1600        local_var_req_builder = local_var_req_builder.query(&[("expression", &local_var_str.to_string())]);
1601    }
1602    if let Some(ref local_var_str) = friendly_name {
1603        local_var_req_builder = local_var_req_builder.query(&[("friendly_name", &local_var_str.to_string())]);
1604    }
1605    if let Some(ref local_var_str) = managed {
1606        local_var_req_builder = match "multi" {
1607            "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("managed".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
1608            _ => local_var_req_builder.query(&[("managed", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
1609        };
1610    }
1611    if let Some(ref local_var_str) = name {
1612        local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
1613    }
1614    if let Some(ref local_var_str) = ordering {
1615        local_var_req_builder = local_var_req_builder.query(&[("ordering", &local_var_str.to_string())]);
1616    }
1617    if let Some(ref local_var_str) = page {
1618        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1619    }
1620    if let Some(ref local_var_str) = page_size {
1621        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
1622    }
1623    if let Some(ref local_var_str) = pm_uuid {
1624        local_var_req_builder = local_var_req_builder.query(&[("pm_uuid", &local_var_str.to_string())]);
1625    }
1626    if let Some(ref local_var_str) = saml_name {
1627        local_var_req_builder = local_var_req_builder.query(&[("saml_name", &local_var_str.to_string())]);
1628    }
1629    if let Some(ref local_var_str) = search {
1630        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
1631    }
1632    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1633        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1634    }
1635    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1636        let local_var_key = local_var_apikey.key.clone();
1637        let local_var_value = match local_var_apikey.prefix {
1638            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1639            None => local_var_key,
1640        };
1641        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1642    };
1643
1644    let local_var_req = local_var_req_builder.build()?;
1645    let local_var_resp = local_var_client.execute(local_var_req).await?;
1646
1647    let local_var_status = local_var_resp.status();
1648    let local_var_content = local_var_resp.text().await?;
1649
1650    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1651        serde_json::from_str(&local_var_content).map_err(Error::from)
1652    } else {
1653        let local_var_entity: Option<PropertymappingsSamlListError> = serde_json::from_str(&local_var_content).ok();
1654        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1655        Err(Error::ResponseError(local_var_error))
1656    }
1657}
1658
1659/// SAMLPropertyMapping Viewset
1660pub async fn propertymappings_saml_partial_update(configuration: &configuration::Configuration, pm_uuid: &str, patched_saml_property_mapping_request: Option<models::PatchedSamlPropertyMappingRequest>) -> Result<models::SamlPropertyMapping, Error<PropertymappingsSamlPartialUpdateError>> {
1661    let local_var_configuration = configuration;
1662
1663    let local_var_client = &local_var_configuration.client;
1664
1665    let local_var_uri_str = format!("{}/propertymappings/saml/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1666    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1667
1668    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1669        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1670    }
1671    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1672        let local_var_key = local_var_apikey.key.clone();
1673        let local_var_value = match local_var_apikey.prefix {
1674            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1675            None => local_var_key,
1676        };
1677        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1678    };
1679    local_var_req_builder = local_var_req_builder.json(&patched_saml_property_mapping_request);
1680
1681    let local_var_req = local_var_req_builder.build()?;
1682    let local_var_resp = local_var_client.execute(local_var_req).await?;
1683
1684    let local_var_status = local_var_resp.status();
1685    let local_var_content = local_var_resp.text().await?;
1686
1687    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1688        serde_json::from_str(&local_var_content).map_err(Error::from)
1689    } else {
1690        let local_var_entity: Option<PropertymappingsSamlPartialUpdateError> = serde_json::from_str(&local_var_content).ok();
1691        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1692        Err(Error::ResponseError(local_var_error))
1693    }
1694}
1695
1696/// SAMLPropertyMapping Viewset
1697pub async fn propertymappings_saml_retrieve(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<models::SamlPropertyMapping, Error<PropertymappingsSamlRetrieveError>> {
1698    let local_var_configuration = configuration;
1699
1700    let local_var_client = &local_var_configuration.client;
1701
1702    let local_var_uri_str = format!("{}/propertymappings/saml/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1703    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1704
1705    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1706        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1707    }
1708    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1709        let local_var_key = local_var_apikey.key.clone();
1710        let local_var_value = match local_var_apikey.prefix {
1711            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1712            None => local_var_key,
1713        };
1714        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1715    };
1716
1717    let local_var_req = local_var_req_builder.build()?;
1718    let local_var_resp = local_var_client.execute(local_var_req).await?;
1719
1720    let local_var_status = local_var_resp.status();
1721    let local_var_content = local_var_resp.text().await?;
1722
1723    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1724        serde_json::from_str(&local_var_content).map_err(Error::from)
1725    } else {
1726        let local_var_entity: Option<PropertymappingsSamlRetrieveError> = serde_json::from_str(&local_var_content).ok();
1727        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1728        Err(Error::ResponseError(local_var_error))
1729    }
1730}
1731
1732/// SAMLPropertyMapping Viewset
1733pub async fn propertymappings_saml_update(configuration: &configuration::Configuration, pm_uuid: &str, saml_property_mapping_request: models::SamlPropertyMappingRequest) -> Result<models::SamlPropertyMapping, Error<PropertymappingsSamlUpdateError>> {
1734    let local_var_configuration = configuration;
1735
1736    let local_var_client = &local_var_configuration.client;
1737
1738    let local_var_uri_str = format!("{}/propertymappings/saml/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1739    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
1740
1741    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1742        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1743    }
1744    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1745        let local_var_key = local_var_apikey.key.clone();
1746        let local_var_value = match local_var_apikey.prefix {
1747            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1748            None => local_var_key,
1749        };
1750        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1751    };
1752    local_var_req_builder = local_var_req_builder.json(&saml_property_mapping_request);
1753
1754    let local_var_req = local_var_req_builder.build()?;
1755    let local_var_resp = local_var_client.execute(local_var_req).await?;
1756
1757    let local_var_status = local_var_resp.status();
1758    let local_var_content = local_var_resp.text().await?;
1759
1760    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1761        serde_json::from_str(&local_var_content).map_err(Error::from)
1762    } else {
1763        let local_var_entity: Option<PropertymappingsSamlUpdateError> = serde_json::from_str(&local_var_content).ok();
1764        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1765        Err(Error::ResponseError(local_var_error))
1766    }
1767}
1768
1769/// Get a list of all objects that use this object
1770pub async fn propertymappings_saml_used_by_list(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSamlUsedByListError>> {
1771    let local_var_configuration = configuration;
1772
1773    let local_var_client = &local_var_configuration.client;
1774
1775    let local_var_uri_str = format!("{}/propertymappings/saml/{pm_uuid}/used_by/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1776    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1777
1778    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1779        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1780    }
1781    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1782        let local_var_key = local_var_apikey.key.clone();
1783        let local_var_value = match local_var_apikey.prefix {
1784            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1785            None => local_var_key,
1786        };
1787        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1788    };
1789
1790    let local_var_req = local_var_req_builder.build()?;
1791    let local_var_resp = local_var_client.execute(local_var_req).await?;
1792
1793    let local_var_status = local_var_resp.status();
1794    let local_var_content = local_var_resp.text().await?;
1795
1796    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1797        serde_json::from_str(&local_var_content).map_err(Error::from)
1798    } else {
1799        let local_var_entity: Option<PropertymappingsSamlUsedByListError> = serde_json::from_str(&local_var_content).ok();
1800        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1801        Err(Error::ResponseError(local_var_error))
1802    }
1803}
1804
1805/// SCIMMapping Viewset
1806pub async fn propertymappings_scim_create(configuration: &configuration::Configuration, scim_mapping_request: models::ScimMappingRequest) -> Result<models::ScimMapping, Error<PropertymappingsScimCreateError>> {
1807    let local_var_configuration = configuration;
1808
1809    let local_var_client = &local_var_configuration.client;
1810
1811    let local_var_uri_str = format!("{}/propertymappings/scim/", local_var_configuration.base_path);
1812    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
1813
1814    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1815        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1816    }
1817    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1818        let local_var_key = local_var_apikey.key.clone();
1819        let local_var_value = match local_var_apikey.prefix {
1820            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1821            None => local_var_key,
1822        };
1823        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1824    };
1825    local_var_req_builder = local_var_req_builder.json(&scim_mapping_request);
1826
1827    let local_var_req = local_var_req_builder.build()?;
1828    let local_var_resp = local_var_client.execute(local_var_req).await?;
1829
1830    let local_var_status = local_var_resp.status();
1831    let local_var_content = local_var_resp.text().await?;
1832
1833    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1834        serde_json::from_str(&local_var_content).map_err(Error::from)
1835    } else {
1836        let local_var_entity: Option<PropertymappingsScimCreateError> = serde_json::from_str(&local_var_content).ok();
1837        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1838        Err(Error::ResponseError(local_var_error))
1839    }
1840}
1841
1842/// SCIMMapping Viewset
1843pub async fn propertymappings_scim_destroy(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<(), Error<PropertymappingsScimDestroyError>> {
1844    let local_var_configuration = configuration;
1845
1846    let local_var_client = &local_var_configuration.client;
1847
1848    let local_var_uri_str = format!("{}/propertymappings/scim/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1849    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
1850
1851    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1852        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1853    }
1854    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1855        let local_var_key = local_var_apikey.key.clone();
1856        let local_var_value = match local_var_apikey.prefix {
1857            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1858            None => local_var_key,
1859        };
1860        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1861    };
1862
1863    let local_var_req = local_var_req_builder.build()?;
1864    let local_var_resp = local_var_client.execute(local_var_req).await?;
1865
1866    let local_var_status = local_var_resp.status();
1867    let local_var_content = local_var_resp.text().await?;
1868
1869    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1870        Ok(())
1871    } else {
1872        let local_var_entity: Option<PropertymappingsScimDestroyError> = serde_json::from_str(&local_var_content).ok();
1873        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1874        Err(Error::ResponseError(local_var_error))
1875    }
1876}
1877
1878/// SCIMMapping Viewset
1879pub async fn propertymappings_scim_list(configuration: &configuration::Configuration, expression: Option<&str>, managed: Option<Vec<String>>, name: Option<&str>, ordering: Option<&str>, page: Option<i32>, page_size: Option<i32>, pm_uuid: Option<&str>, search: Option<&str>) -> Result<models::PaginatedScimMappingList, Error<PropertymappingsScimListError>> {
1880    let local_var_configuration = configuration;
1881
1882    let local_var_client = &local_var_configuration.client;
1883
1884    let local_var_uri_str = format!("{}/propertymappings/scim/", local_var_configuration.base_path);
1885    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1886
1887    if let Some(ref local_var_str) = expression {
1888        local_var_req_builder = local_var_req_builder.query(&[("expression", &local_var_str.to_string())]);
1889    }
1890    if let Some(ref local_var_str) = managed {
1891        local_var_req_builder = match "multi" {
1892            "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("managed".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
1893            _ => local_var_req_builder.query(&[("managed", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
1894        };
1895    }
1896    if let Some(ref local_var_str) = name {
1897        local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
1898    }
1899    if let Some(ref local_var_str) = ordering {
1900        local_var_req_builder = local_var_req_builder.query(&[("ordering", &local_var_str.to_string())]);
1901    }
1902    if let Some(ref local_var_str) = page {
1903        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
1904    }
1905    if let Some(ref local_var_str) = page_size {
1906        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
1907    }
1908    if let Some(ref local_var_str) = pm_uuid {
1909        local_var_req_builder = local_var_req_builder.query(&[("pm_uuid", &local_var_str.to_string())]);
1910    }
1911    if let Some(ref local_var_str) = search {
1912        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
1913    }
1914    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1915        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1916    }
1917    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1918        let local_var_key = local_var_apikey.key.clone();
1919        let local_var_value = match local_var_apikey.prefix {
1920            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1921            None => local_var_key,
1922        };
1923        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1924    };
1925
1926    let local_var_req = local_var_req_builder.build()?;
1927    let local_var_resp = local_var_client.execute(local_var_req).await?;
1928
1929    let local_var_status = local_var_resp.status();
1930    let local_var_content = local_var_resp.text().await?;
1931
1932    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1933        serde_json::from_str(&local_var_content).map_err(Error::from)
1934    } else {
1935        let local_var_entity: Option<PropertymappingsScimListError> = serde_json::from_str(&local_var_content).ok();
1936        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1937        Err(Error::ResponseError(local_var_error))
1938    }
1939}
1940
1941/// SCIMMapping Viewset
1942pub async fn propertymappings_scim_partial_update(configuration: &configuration::Configuration, pm_uuid: &str, patched_scim_mapping_request: Option<models::PatchedScimMappingRequest>) -> Result<models::ScimMapping, Error<PropertymappingsScimPartialUpdateError>> {
1943    let local_var_configuration = configuration;
1944
1945    let local_var_client = &local_var_configuration.client;
1946
1947    let local_var_uri_str = format!("{}/propertymappings/scim/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1948    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
1949
1950    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1951        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1952    }
1953    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1954        let local_var_key = local_var_apikey.key.clone();
1955        let local_var_value = match local_var_apikey.prefix {
1956            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1957            None => local_var_key,
1958        };
1959        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1960    };
1961    local_var_req_builder = local_var_req_builder.json(&patched_scim_mapping_request);
1962
1963    let local_var_req = local_var_req_builder.build()?;
1964    let local_var_resp = local_var_client.execute(local_var_req).await?;
1965
1966    let local_var_status = local_var_resp.status();
1967    let local_var_content = local_var_resp.text().await?;
1968
1969    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
1970        serde_json::from_str(&local_var_content).map_err(Error::from)
1971    } else {
1972        let local_var_entity: Option<PropertymappingsScimPartialUpdateError> = serde_json::from_str(&local_var_content).ok();
1973        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
1974        Err(Error::ResponseError(local_var_error))
1975    }
1976}
1977
1978/// SCIMMapping Viewset
1979pub async fn propertymappings_scim_retrieve(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<models::ScimMapping, Error<PropertymappingsScimRetrieveError>> {
1980    let local_var_configuration = configuration;
1981
1982    let local_var_client = &local_var_configuration.client;
1983
1984    let local_var_uri_str = format!("{}/propertymappings/scim/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
1985    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
1986
1987    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
1988        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
1989    }
1990    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
1991        let local_var_key = local_var_apikey.key.clone();
1992        let local_var_value = match local_var_apikey.prefix {
1993            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
1994            None => local_var_key,
1995        };
1996        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
1997    };
1998
1999    let local_var_req = local_var_req_builder.build()?;
2000    let local_var_resp = local_var_client.execute(local_var_req).await?;
2001
2002    let local_var_status = local_var_resp.status();
2003    let local_var_content = local_var_resp.text().await?;
2004
2005    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2006        serde_json::from_str(&local_var_content).map_err(Error::from)
2007    } else {
2008        let local_var_entity: Option<PropertymappingsScimRetrieveError> = serde_json::from_str(&local_var_content).ok();
2009        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2010        Err(Error::ResponseError(local_var_error))
2011    }
2012}
2013
2014/// SCIMMapping Viewset
2015pub async fn propertymappings_scim_update(configuration: &configuration::Configuration, pm_uuid: &str, scim_mapping_request: models::ScimMappingRequest) -> Result<models::ScimMapping, Error<PropertymappingsScimUpdateError>> {
2016    let local_var_configuration = configuration;
2017
2018    let local_var_client = &local_var_configuration.client;
2019
2020    let local_var_uri_str = format!("{}/propertymappings/scim/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
2021    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2022
2023    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2024        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2025    }
2026    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2027        let local_var_key = local_var_apikey.key.clone();
2028        let local_var_value = match local_var_apikey.prefix {
2029            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2030            None => local_var_key,
2031        };
2032        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2033    };
2034    local_var_req_builder = local_var_req_builder.json(&scim_mapping_request);
2035
2036    let local_var_req = local_var_req_builder.build()?;
2037    let local_var_resp = local_var_client.execute(local_var_req).await?;
2038
2039    let local_var_status = local_var_resp.status();
2040    let local_var_content = local_var_resp.text().await?;
2041
2042    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2043        serde_json::from_str(&local_var_content).map_err(Error::from)
2044    } else {
2045        let local_var_entity: Option<PropertymappingsScimUpdateError> = serde_json::from_str(&local_var_content).ok();
2046        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2047        Err(Error::ResponseError(local_var_error))
2048    }
2049}
2050
2051/// Get a list of all objects that use this object
2052pub async fn propertymappings_scim_used_by_list(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<Vec<models::UsedBy>, Error<PropertymappingsScimUsedByListError>> {
2053    let local_var_configuration = configuration;
2054
2055    let local_var_client = &local_var_configuration.client;
2056
2057    let local_var_uri_str = format!("{}/propertymappings/scim/{pm_uuid}/used_by/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
2058    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2059
2060    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2061        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2062    }
2063    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2064        let local_var_key = local_var_apikey.key.clone();
2065        let local_var_value = match local_var_apikey.prefix {
2066            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2067            None => local_var_key,
2068        };
2069        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2070    };
2071
2072    let local_var_req = local_var_req_builder.build()?;
2073    let local_var_resp = local_var_client.execute(local_var_req).await?;
2074
2075    let local_var_status = local_var_resp.status();
2076    let local_var_content = local_var_resp.text().await?;
2077
2078    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2079        serde_json::from_str(&local_var_content).map_err(Error::from)
2080    } else {
2081        let local_var_entity: Option<PropertymappingsScimUsedByListError> = serde_json::from_str(&local_var_content).ok();
2082        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2083        Err(Error::ResponseError(local_var_error))
2084    }
2085}
2086
2087/// ScopeMapping Viewset
2088pub async fn propertymappings_scope_create(configuration: &configuration::Configuration, scope_mapping_request: models::ScopeMappingRequest) -> Result<models::ScopeMapping, Error<PropertymappingsScopeCreateError>> {
2089    let local_var_configuration = configuration;
2090
2091    let local_var_client = &local_var_configuration.client;
2092
2093    let local_var_uri_str = format!("{}/propertymappings/scope/", local_var_configuration.base_path);
2094    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
2095
2096    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2097        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2098    }
2099    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2100        let local_var_key = local_var_apikey.key.clone();
2101        let local_var_value = match local_var_apikey.prefix {
2102            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2103            None => local_var_key,
2104        };
2105        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2106    };
2107    local_var_req_builder = local_var_req_builder.json(&scope_mapping_request);
2108
2109    let local_var_req = local_var_req_builder.build()?;
2110    let local_var_resp = local_var_client.execute(local_var_req).await?;
2111
2112    let local_var_status = local_var_resp.status();
2113    let local_var_content = local_var_resp.text().await?;
2114
2115    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2116        serde_json::from_str(&local_var_content).map_err(Error::from)
2117    } else {
2118        let local_var_entity: Option<PropertymappingsScopeCreateError> = serde_json::from_str(&local_var_content).ok();
2119        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2120        Err(Error::ResponseError(local_var_error))
2121    }
2122}
2123
2124/// ScopeMapping Viewset
2125pub async fn propertymappings_scope_destroy(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<(), Error<PropertymappingsScopeDestroyError>> {
2126    let local_var_configuration = configuration;
2127
2128    let local_var_client = &local_var_configuration.client;
2129
2130    let local_var_uri_str = format!("{}/propertymappings/scope/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
2131    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
2132
2133    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2134        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2135    }
2136    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2137        let local_var_key = local_var_apikey.key.clone();
2138        let local_var_value = match local_var_apikey.prefix {
2139            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2140            None => local_var_key,
2141        };
2142        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2143    };
2144
2145    let local_var_req = local_var_req_builder.build()?;
2146    let local_var_resp = local_var_client.execute(local_var_req).await?;
2147
2148    let local_var_status = local_var_resp.status();
2149    let local_var_content = local_var_resp.text().await?;
2150
2151    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2152        Ok(())
2153    } else {
2154        let local_var_entity: Option<PropertymappingsScopeDestroyError> = serde_json::from_str(&local_var_content).ok();
2155        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2156        Err(Error::ResponseError(local_var_error))
2157    }
2158}
2159
2160/// ScopeMapping Viewset
2161pub async fn propertymappings_scope_list(configuration: &configuration::Configuration, managed: Option<Vec<String>>, name: Option<&str>, ordering: Option<&str>, page: Option<i32>, page_size: Option<i32>, scope_name: Option<&str>, search: Option<&str>) -> Result<models::PaginatedScopeMappingList, Error<PropertymappingsScopeListError>> {
2162    let local_var_configuration = configuration;
2163
2164    let local_var_client = &local_var_configuration.client;
2165
2166    let local_var_uri_str = format!("{}/propertymappings/scope/", local_var_configuration.base_path);
2167    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2168
2169    if let Some(ref local_var_str) = managed {
2170        local_var_req_builder = match "multi" {
2171            "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("managed".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
2172            _ => local_var_req_builder.query(&[("managed", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
2173        };
2174    }
2175    if let Some(ref local_var_str) = name {
2176        local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
2177    }
2178    if let Some(ref local_var_str) = ordering {
2179        local_var_req_builder = local_var_req_builder.query(&[("ordering", &local_var_str.to_string())]);
2180    }
2181    if let Some(ref local_var_str) = page {
2182        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
2183    }
2184    if let Some(ref local_var_str) = page_size {
2185        local_var_req_builder = local_var_req_builder.query(&[("page_size", &local_var_str.to_string())]);
2186    }
2187    if let Some(ref local_var_str) = scope_name {
2188        local_var_req_builder = local_var_req_builder.query(&[("scope_name", &local_var_str.to_string())]);
2189    }
2190    if let Some(ref local_var_str) = search {
2191        local_var_req_builder = local_var_req_builder.query(&[("search", &local_var_str.to_string())]);
2192    }
2193    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2194        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2195    }
2196    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2197        let local_var_key = local_var_apikey.key.clone();
2198        let local_var_value = match local_var_apikey.prefix {
2199            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2200            None => local_var_key,
2201        };
2202        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2203    };
2204
2205    let local_var_req = local_var_req_builder.build()?;
2206    let local_var_resp = local_var_client.execute(local_var_req).await?;
2207
2208    let local_var_status = local_var_resp.status();
2209    let local_var_content = local_var_resp.text().await?;
2210
2211    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2212        serde_json::from_str(&local_var_content).map_err(Error::from)
2213    } else {
2214        let local_var_entity: Option<PropertymappingsScopeListError> = serde_json::from_str(&local_var_content).ok();
2215        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2216        Err(Error::ResponseError(local_var_error))
2217    }
2218}
2219
2220/// ScopeMapping Viewset
2221pub async fn propertymappings_scope_partial_update(configuration: &configuration::Configuration, pm_uuid: &str, patched_scope_mapping_request: Option<models::PatchedScopeMappingRequest>) -> Result<models::ScopeMapping, Error<PropertymappingsScopePartialUpdateError>> {
2222    let local_var_configuration = configuration;
2223
2224    let local_var_client = &local_var_configuration.client;
2225
2226    let local_var_uri_str = format!("{}/propertymappings/scope/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
2227    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
2228
2229    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2230        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2231    }
2232    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2233        let local_var_key = local_var_apikey.key.clone();
2234        let local_var_value = match local_var_apikey.prefix {
2235            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2236            None => local_var_key,
2237        };
2238        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2239    };
2240    local_var_req_builder = local_var_req_builder.json(&patched_scope_mapping_request);
2241
2242    let local_var_req = local_var_req_builder.build()?;
2243    let local_var_resp = local_var_client.execute(local_var_req).await?;
2244
2245    let local_var_status = local_var_resp.status();
2246    let local_var_content = local_var_resp.text().await?;
2247
2248    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2249        serde_json::from_str(&local_var_content).map_err(Error::from)
2250    } else {
2251        let local_var_entity: Option<PropertymappingsScopePartialUpdateError> = serde_json::from_str(&local_var_content).ok();
2252        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2253        Err(Error::ResponseError(local_var_error))
2254    }
2255}
2256
2257/// ScopeMapping Viewset
2258pub async fn propertymappings_scope_retrieve(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<models::ScopeMapping, Error<PropertymappingsScopeRetrieveError>> {
2259    let local_var_configuration = configuration;
2260
2261    let local_var_client = &local_var_configuration.client;
2262
2263    let local_var_uri_str = format!("{}/propertymappings/scope/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
2264    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2265
2266    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2267        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2268    }
2269    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2270        let local_var_key = local_var_apikey.key.clone();
2271        let local_var_value = match local_var_apikey.prefix {
2272            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2273            None => local_var_key,
2274        };
2275        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2276    };
2277
2278    let local_var_req = local_var_req_builder.build()?;
2279    let local_var_resp = local_var_client.execute(local_var_req).await?;
2280
2281    let local_var_status = local_var_resp.status();
2282    let local_var_content = local_var_resp.text().await?;
2283
2284    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2285        serde_json::from_str(&local_var_content).map_err(Error::from)
2286    } else {
2287        let local_var_entity: Option<PropertymappingsScopeRetrieveError> = serde_json::from_str(&local_var_content).ok();
2288        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2289        Err(Error::ResponseError(local_var_error))
2290    }
2291}
2292
2293/// ScopeMapping Viewset
2294pub async fn propertymappings_scope_update(configuration: &configuration::Configuration, pm_uuid: &str, scope_mapping_request: models::ScopeMappingRequest) -> Result<models::ScopeMapping, Error<PropertymappingsScopeUpdateError>> {
2295    let local_var_configuration = configuration;
2296
2297    let local_var_client = &local_var_configuration.client;
2298
2299    let local_var_uri_str = format!("{}/propertymappings/scope/{pm_uuid}/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
2300    let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
2301
2302    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2303        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2304    }
2305    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2306        let local_var_key = local_var_apikey.key.clone();
2307        let local_var_value = match local_var_apikey.prefix {
2308            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2309            None => local_var_key,
2310        };
2311        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2312    };
2313    local_var_req_builder = local_var_req_builder.json(&scope_mapping_request);
2314
2315    let local_var_req = local_var_req_builder.build()?;
2316    let local_var_resp = local_var_client.execute(local_var_req).await?;
2317
2318    let local_var_status = local_var_resp.status();
2319    let local_var_content = local_var_resp.text().await?;
2320
2321    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2322        serde_json::from_str(&local_var_content).map_err(Error::from)
2323    } else {
2324        let local_var_entity: Option<PropertymappingsScopeUpdateError> = serde_json::from_str(&local_var_content).ok();
2325        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2326        Err(Error::ResponseError(local_var_error))
2327    }
2328}
2329
2330/// Get a list of all objects that use this object
2331pub async fn propertymappings_scope_used_by_list(configuration: &configuration::Configuration, pm_uuid: &str) -> Result<Vec<models::UsedBy>, Error<PropertymappingsScopeUsedByListError>> {
2332    let local_var_configuration = configuration;
2333
2334    let local_var_client = &local_var_configuration.client;
2335
2336    let local_var_uri_str = format!("{}/propertymappings/scope/{pm_uuid}/used_by/", local_var_configuration.base_path, pm_uuid=crate::apis::urlencode(pm_uuid));
2337    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
2338
2339    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
2340        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
2341    }
2342    if let Some(ref local_var_apikey) = local_var_configuration.api_key {
2343        let local_var_key = local_var_apikey.key.clone();
2344        let local_var_value = match local_var_apikey.prefix {
2345            Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
2346            None => local_var_key,
2347        };
2348        local_var_req_builder = local_var_req_builder.header("Authorization", local_var_value);
2349    };
2350
2351    let local_var_req = local_var_req_builder.build()?;
2352    let local_var_resp = local_var_client.execute(local_var_req).await?;
2353
2354    let local_var_status = local_var_resp.status();
2355    let local_var_content = local_var_resp.text().await?;
2356
2357    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
2358        serde_json::from_str(&local_var_content).map_err(Error::from)
2359    } else {
2360        let local_var_entity: Option<PropertymappingsScopeUsedByListError> = serde_json::from_str(&local_var_content).ok();
2361        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
2362        Err(Error::ResponseError(local_var_error))
2363    }
2364}
2365