use super::{configuration, ContentType, Error};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{de::Error as _, Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsAllDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsAllListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsAllRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsAllTestCreateError {
Status400(),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsAllTypesListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsAllUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsNotificationCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsNotificationDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsNotificationListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsNotificationPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsNotificationRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsNotificationUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsNotificationUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderGoogleWorkspaceCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderGoogleWorkspaceDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderGoogleWorkspaceListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderGoogleWorkspacePartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderGoogleWorkspaceRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderGoogleWorkspaceUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderGoogleWorkspaceUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderMicrosoftEntraCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderMicrosoftEntraDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderMicrosoftEntraListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderMicrosoftEntraPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderMicrosoftEntraRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderMicrosoftEntraUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderMicrosoftEntraUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRacCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRacDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRacListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRacPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRacRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRacUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRacUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRadiusCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRadiusDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRadiusListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRadiusPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRadiusRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRadiusUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderRadiusUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderSamlCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderSamlDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderSamlListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderSamlPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderSamlRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderSamlUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderSamlUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScimCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScimDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScimListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScimPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScimRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScimUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScimUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScopeCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScopeDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScopeListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScopePartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScopeRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScopeUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsProviderScopeUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceKerberosCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceKerberosDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceKerberosListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceKerberosPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceKerberosRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceKerberosUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceKerberosUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceLdapCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceLdapDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceLdapListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceLdapPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceLdapRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceLdapUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceLdapUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceOauthCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceOauthDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceOauthListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceOauthPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceOauthRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceOauthUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceOauthUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourcePlexCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourcePlexDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourcePlexListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourcePlexPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourcePlexRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourcePlexUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourcePlexUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceSamlCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceSamlDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceSamlListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceSamlPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceSamlRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceSamlUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceSamlUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceScimCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceScimDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceScimListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceScimPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceScimRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceScimUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceScimUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceTelegramCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceTelegramDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceTelegramListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceTelegramPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceTelegramRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceTelegramUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PropertymappingsSourceTelegramUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
pub async fn propertymappings_all_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsAllDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/all/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsAllDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_all_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedPropertyMappingList, Error<PropertymappingsAllListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/all/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedPropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsAllListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_all_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::PropertyMapping, Error<PropertymappingsAllRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/all/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::PropertyMapping`",
)))
}
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::PropertyMapping`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsAllRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_all_test_create(
configuration: &configuration::Configuration,
pm_uuid: &str,
format_result: Option<bool>,
property_mapping_test_request: Option<models::PropertyMappingTestRequest>,
) -> Result<models::PropertyMappingTestResult, Error<PropertymappingsAllTestCreateError>> {
let p_path_pm_uuid = pm_uuid;
let p_query_format_result = format_result;
let p_body_property_mapping_test_request = property_mapping_test_request;
let uri_str = format!(
"{}/propertymappings/all/{pm_uuid}/test/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref param_value) = p_query_format_result {
req_builder = req_builder.query(&[("format_result", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_property_mapping_test_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PropertyMappingTestResult`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PropertyMappingTestResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsAllTestCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_all_types_list(
configuration: &configuration::Configuration,
) -> Result<Vec<models::TypeCreate>, Error<PropertymappingsAllTypesListError>> {
let uri_str = format!("{}/propertymappings/all/types/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::TypeCreate>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::TypeCreate>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsAllTypesListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_all_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsAllUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/all/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsAllUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_notification_create(
configuration: &configuration::Configuration,
notification_webhook_mapping_request: models::NotificationWebhookMappingRequest,
) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationCreateError>> {
let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request;
let uri_str = format!("{}/propertymappings/notification/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_notification_webhook_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NotificationWebhookMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsNotificationCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_notification_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsNotificationDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/notification/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsNotificationDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub 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>> {
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/notification/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedNotificationWebhookMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedNotificationWebhookMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsNotificationListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub 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>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_notification_webhook_mapping_request = patched_notification_webhook_mapping_request;
let uri_str = format!(
"{}/propertymappings/notification/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_notification_webhook_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NotificationWebhookMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsNotificationPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_notification_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/notification/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NotificationWebhookMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsNotificationRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_notification_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
notification_webhook_mapping_request: models::NotificationWebhookMappingRequest,
) -> Result<models::NotificationWebhookMapping, Error<PropertymappingsNotificationUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request;
let uri_str = format!(
"{}/propertymappings/notification/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_notification_webhook_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::NotificationWebhookMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::NotificationWebhookMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsNotificationUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_notification_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsNotificationUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/notification/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsNotificationUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_google_workspace_create(
configuration: &configuration::Configuration,
google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest,
) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspaceCreateError>> {
let p_body_google_workspace_provider_mapping_request = google_workspace_provider_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/google_workspace/",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderGoogleWorkspaceCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_google_workspace_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsProviderGoogleWorkspaceDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/google_workspace/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderGoogleWorkspaceDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_google_workspace_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::PaginatedGoogleWorkspaceProviderMappingList, Error<PropertymappingsProviderGoogleWorkspaceListError>>
{
let p_query_expression = expression;
let p_query_managed = managed;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_pm_uuid = pm_uuid;
let p_query_search = search;
let uri_str = format!(
"{}/propertymappings/provider/google_workspace/",
configuration.base_path
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_expression {
req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_pm_uuid {
req_builder = req_builder.query(&[("pm_uuid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedGoogleWorkspaceProviderMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderGoogleWorkspaceListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_google_workspace_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_google_workspace_provider_mapping_request: Option<models::PatchedGoogleWorkspaceProviderMappingRequest>,
) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspacePartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_google_workspace_provider_mapping_request = patched_google_workspace_provider_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/google_workspace/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_google_workspace_provider_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderGoogleWorkspacePartialUpdateError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_google_workspace_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspaceRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/google_workspace/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderGoogleWorkspaceRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_google_workspace_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest,
) -> Result<models::GoogleWorkspaceProviderMapping, Error<PropertymappingsProviderGoogleWorkspaceUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_google_workspace_provider_mapping_request = google_workspace_provider_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/google_workspace/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GoogleWorkspaceProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderGoogleWorkspaceUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_google_workspace_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderGoogleWorkspaceUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/google_workspace/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderGoogleWorkspaceUsedByListError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_microsoft_entra_create(
configuration: &configuration::Configuration,
microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest,
) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraCreateError>> {
let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request;
let uri_str = format!("{}/propertymappings/provider/microsoft_entra/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderMicrosoftEntraCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_microsoft_entra_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsProviderMicrosoftEntraDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderMicrosoftEntraDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_microsoft_entra_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::PaginatedMicrosoftEntraProviderMappingList, Error<PropertymappingsProviderMicrosoftEntraListError>>
{
let p_query_expression = expression;
let p_query_managed = managed;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_pm_uuid = pm_uuid;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/provider/microsoft_entra/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_expression {
req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_pm_uuid {
req_builder = req_builder.query(&[("pm_uuid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedMicrosoftEntraProviderMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderMicrosoftEntraListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_microsoft_entra_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_microsoft_entra_provider_mapping_request: Option<models::PatchedMicrosoftEntraProviderMappingRequest>,
) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_microsoft_entra_provider_mapping_request = patched_microsoft_entra_provider_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_microsoft_entra_provider_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderMicrosoftEntraPartialUpdateError> =
serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_microsoft_entra_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderMicrosoftEntraRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_microsoft_entra_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest,
) -> Result<models::MicrosoftEntraProviderMapping, Error<PropertymappingsProviderMicrosoftEntraUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/microsoft_entra/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::MicrosoftEntraProviderMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderMicrosoftEntraUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_microsoft_entra_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderMicrosoftEntraUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/microsoft_entra/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderMicrosoftEntraUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_rac_create(
configuration: &configuration::Configuration,
rac_property_mapping_request: models::RacPropertyMappingRequest,
) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacCreateError>> {
let p_body_rac_property_mapping_request = rac_property_mapping_request;
let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_rac_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RacPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRacCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_rac_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsProviderRacDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/rac/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRacDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_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<PropertymappingsProviderRacListError>> {
let p_query_managed = managed;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRacPropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedRacPropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRacListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_rac_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_rac_property_mapping_request: Option<models::PatchedRacPropertyMappingRequest>,
) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_rac_property_mapping_request = patched_rac_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/rac/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_rac_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RacPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRacPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_rac_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/rac/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RacPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRacRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_rac_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
rac_property_mapping_request: models::RacPropertyMappingRequest,
) -> Result<models::RacPropertyMapping, Error<PropertymappingsProviderRacUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_rac_property_mapping_request = rac_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/rac/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_rac_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RacPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RacPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRacUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_rac_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderRacUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/rac/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRacUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_radius_create(
configuration: &configuration::Configuration,
radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest,
) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusCreateError>> {
let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request;
let uri_str = format!("{}/propertymappings/provider/radius/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRadiusCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_radius_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsProviderRadiusDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/radius/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRadiusDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_radius_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedRadiusProviderPropertyMappingList, Error<PropertymappingsProviderRadiusListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/provider/radius/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedRadiusProviderPropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedRadiusProviderPropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRadiusListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_radius_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_radius_provider_property_mapping_request: Option<models::PatchedRadiusProviderPropertyMappingRequest>,
) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_radius_provider_property_mapping_request = patched_radius_provider_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/radius/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_radius_provider_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRadiusPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_radius_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/radius/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRadiusRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_radius_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest,
) -> Result<models::RadiusProviderPropertyMapping, Error<PropertymappingsProviderRadiusUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/radius/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::RadiusProviderPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRadiusUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_radius_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderRadiusUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/radius/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderRadiusUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_saml_create(
configuration: &configuration::Configuration,
saml_property_mapping_request: models::SamlPropertyMappingRequest,
) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlCreateError>> {
let p_body_saml_property_mapping_request = saml_property_mapping_request;
let uri_str = format!("{}/propertymappings/provider/saml/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_saml_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderSamlCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_saml_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsProviderSamlDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderSamlDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_saml_list(
configuration: &configuration::Configuration,
friendly_name: Option<&str>,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
saml_name: Option<&str>,
search: Option<&str>,
) -> Result<models::PaginatedSamlPropertyMappingList, Error<PropertymappingsProviderSamlListError>> {
let p_query_friendly_name = friendly_name;
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_saml_name = saml_name;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/provider/saml/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_friendly_name {
req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_saml_name {
req_builder = req_builder.query(&[("saml_name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlPropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSamlPropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderSamlListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_saml_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_saml_property_mapping_request: Option<models::PatchedSamlPropertyMappingRequest>,
) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_saml_property_mapping_request = patched_saml_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_saml_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderSamlPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_saml_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderSamlRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_saml_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
saml_property_mapping_request: models::SamlPropertyMappingRequest,
) -> Result<models::SamlPropertyMapping, Error<PropertymappingsProviderSamlUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_saml_property_mapping_request = saml_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_saml_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlPropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlPropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderSamlUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_saml_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderSamlUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/saml/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderSamlUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scim_create(
configuration: &configuration::Configuration,
scim_mapping_request: models::ScimMappingRequest,
) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimCreateError>> {
let p_body_scim_mapping_request = scim_mapping_request;
let uri_str = format!("{}/propertymappings/provider/scim/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_scim_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
)))
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScimCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scim_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsProviderScimDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScimDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scim_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedScimMappingList, Error<PropertymappingsProviderScimListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/provider/scim/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScimListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scim_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_scim_mapping_request: Option<models::PatchedScimMappingRequest>,
) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_scim_mapping_request = patched_scim_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_scim_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
)))
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScimPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scim_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
)))
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScimRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scim_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
scim_mapping_request: models::ScimMappingRequest,
) -> Result<models::ScimMapping, Error<PropertymappingsProviderScimUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_scim_mapping_request = scim_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_scim_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScimMapping`",
)))
}
ContentType::Unsupported(unknown_type) => {
return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScimMapping`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScimUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scim_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderScimUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/scim/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScimUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scope_create(
configuration: &configuration::Configuration,
scope_mapping_request: models::ScopeMappingRequest,
) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopeCreateError>> {
let p_body_scope_mapping_request = scope_mapping_request;
let uri_str = format!("{}/propertymappings/provider/scope/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_scope_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
)))
}
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScopeCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scope_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsProviderScopeDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/scope/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScopeDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scope_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
scope_name: Option<&str>,
search: Option<&str>,
) -> Result<models::PaginatedScopeMappingList, Error<PropertymappingsProviderScopeListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_scope_name = scope_name;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/provider/scope/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_scope_name {
req_builder = req_builder.query(&[("scope_name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScopeMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScopeMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScopeListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scope_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_scope_mapping_request: Option<models::PatchedScopeMappingRequest>,
) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopePartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_scope_mapping_request = patched_scope_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/scope/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_scope_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
)))
}
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScopePartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scope_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopeRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/scope/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
)))
}
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScopeRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scope_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
scope_mapping_request: models::ScopeMappingRequest,
) -> Result<models::ScopeMapping, Error<PropertymappingsProviderScopeUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_scope_mapping_request = scope_mapping_request;
let uri_str = format!(
"{}/propertymappings/provider/scope/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_scope_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => {
return Err(Error::from(serde_json::Error::custom(
"Received `text/plain` content type response that cannot be converted to `models::ScopeMapping`",
)))
}
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!(
"Received `{unknown_type}` content type response that cannot be converted to `models::ScopeMapping`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScopeUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_provider_scope_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsProviderScopeUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/provider/scope/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsProviderScopeUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_kerberos_create(
configuration: &configuration::Configuration,
kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest,
) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosCreateError>> {
let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request;
let uri_str = format!("{}/propertymappings/source/kerberos/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceKerberosCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_kerberos_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsSourceKerberosDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/kerberos/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceKerberosDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_kerberos_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedKerberosSourcePropertyMappingList, Error<PropertymappingsSourceKerberosListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/source/kerberos/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedKerberosSourcePropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedKerberosSourcePropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceKerberosListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_kerberos_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_kerberos_source_property_mapping_request: Option<models::PatchedKerberosSourcePropertyMappingRequest>,
) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_kerberos_source_property_mapping_request = patched_kerberos_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/kerberos/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_kerberos_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceKerberosPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_kerberos_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/kerberos/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceKerberosRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_kerberos_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest,
) -> Result<models::KerberosSourcePropertyMapping, Error<PropertymappingsSourceKerberosUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/kerberos/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::KerberosSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceKerberosUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_kerberos_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceKerberosUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/kerberos/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceKerberosUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_ldap_create(
configuration: &configuration::Configuration,
ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest,
) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapCreateError>> {
let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request;
let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LdapSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceLdapCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_ldap_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsSourceLdapDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/ldap/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceLdapDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_ldap_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedLdapSourcePropertyMappingList, Error<PropertymappingsSourceLdapListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedLdapSourcePropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedLdapSourcePropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceLdapListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_ldap_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_ldap_source_property_mapping_request: Option<models::PatchedLdapSourcePropertyMappingRequest>,
) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_ldap_source_property_mapping_request = patched_ldap_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/ldap/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_ldap_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LdapSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceLdapPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_ldap_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/ldap/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LdapSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceLdapRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_ldap_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest,
) -> Result<models::LdapSourcePropertyMapping, Error<PropertymappingsSourceLdapUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/ldap/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::LdapSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::LdapSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceLdapUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_ldap_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceLdapUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/ldap/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceLdapUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_oauth_create(
configuration: &configuration::Configuration,
o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest,
) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthCreateError>> {
let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request;
let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceOauthCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_oauth_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsSourceOauthDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/oauth/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceOauthDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_oauth_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedOAuthSourcePropertyMappingList, Error<PropertymappingsSourceOauthListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedOAuthSourcePropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedOAuthSourcePropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceOauthListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_oauth_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_o_auth_source_property_mapping_request: Option<models::PatchedOAuthSourcePropertyMappingRequest>,
) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_o_auth_source_property_mapping_request = patched_o_auth_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/oauth/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_o_auth_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceOauthPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_oauth_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/oauth/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceOauthRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_oauth_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest,
) -> Result<models::OAuthSourcePropertyMapping, Error<PropertymappingsSourceOauthUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/oauth/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::OAuthSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceOauthUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_oauth_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceOauthUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/oauth/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceOauthUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_plex_create(
configuration: &configuration::Configuration,
plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest,
) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexCreateError>> {
let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request;
let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_plex_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PlexSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourcePlexCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_plex_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsSourcePlexDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/plex/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourcePlexDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_plex_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedPlexSourcePropertyMappingList, Error<PropertymappingsSourcePlexListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedPlexSourcePropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedPlexSourcePropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourcePlexListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_plex_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_plex_source_property_mapping_request: Option<models::PatchedPlexSourcePropertyMappingRequest>,
) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_plex_source_property_mapping_request = patched_plex_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/plex/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_plex_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PlexSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourcePlexPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_plex_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/plex/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PlexSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourcePlexRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_plex_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest,
) -> Result<models::PlexSourcePropertyMapping, Error<PropertymappingsSourcePlexUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/plex/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_plex_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PlexSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PlexSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourcePlexUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_plex_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourcePlexUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/plex/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourcePlexUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_saml_create(
configuration: &configuration::Configuration,
saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest,
) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlCreateError>> {
let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request;
let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_saml_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceSamlCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_saml_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsSourceSamlDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceSamlDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_saml_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedSamlSourcePropertyMappingList, Error<PropertymappingsSourceSamlListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedSamlSourcePropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedSamlSourcePropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceSamlListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_saml_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_saml_source_property_mapping_request: Option<models::PatchedSamlSourcePropertyMappingRequest>,
) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_saml_source_property_mapping_request = patched_saml_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_saml_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceSamlPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_saml_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceSamlRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_saml_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest,
) -> Result<models::SamlSourcePropertyMapping, Error<PropertymappingsSourceSamlUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/saml/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_saml_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::SamlSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::SamlSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceSamlUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_saml_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceSamlUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/saml/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceSamlUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_scim_create(
configuration: &configuration::Configuration,
scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest,
) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimCreateError>> {
let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request;
let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_scim_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceScimCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_scim_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsSourceScimDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceScimDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_scim_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedScimSourcePropertyMappingList, Error<PropertymappingsSourceScimListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedScimSourcePropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedScimSourcePropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceScimListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_scim_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_scim_source_property_mapping_request: Option<models::PatchedScimSourcePropertyMappingRequest>,
) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_scim_source_property_mapping_request = patched_scim_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_scim_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceScimPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_scim_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceScimRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_scim_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest,
) -> Result<models::ScimSourcePropertyMapping, Error<PropertymappingsSourceScimUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/scim/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_scim_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::ScimSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::ScimSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceScimUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_scim_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceScimUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/scim/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceScimUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_telegram_create(
configuration: &configuration::Configuration,
telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest,
) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramCreateError>> {
let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request;
let uri_str = format!("{}/propertymappings/source/telegram/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::POST, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceTelegramCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_telegram_destroy(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<(), Error<PropertymappingsSourceTelegramDestroyError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/telegram/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::DELETE, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
if !status.is_client_error() && !status.is_server_error() {
Ok(())
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceTelegramDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_telegram_list(
configuration: &configuration::Configuration,
managed: Option<Vec<String>>,
managed__isnull: Option<bool>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedTelegramSourcePropertyMappingList, Error<PropertymappingsSourceTelegramListError>> {
let p_query_managed = managed;
let p_query_managed__isnull = managed__isnull;
let p_query_name = name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let uri_str = format!("{}/propertymappings/source/telegram/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_managed {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("managed".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"managed",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_managed__isnull {
req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name {
req_builder = req_builder.query(&[("name", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_ordering {
req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page {
req_builder = req_builder.query(&[("page", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_page_size {
req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_search {
req_builder = req_builder.query(&[("search", ¶m_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::PaginatedTelegramSourcePropertyMappingList`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::PaginatedTelegramSourcePropertyMappingList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceTelegramListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_telegram_partial_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
patched_telegram_source_property_mapping_request: Option<models::PatchedTelegramSourcePropertyMappingRequest>,
) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramPartialUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_patched_telegram_source_property_mapping_request = patched_telegram_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/telegram/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_patched_telegram_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceTelegramPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_telegram_retrieve(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramRetrieveError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/telegram/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceTelegramRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_telegram_update(
configuration: &configuration::Configuration,
pm_uuid: &str,
telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest,
) -> Result<models::TelegramSourcePropertyMapping, Error<PropertymappingsSourceTelegramUpdateError>> {
let p_path_pm_uuid = pm_uuid;
let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request;
let uri_str = format!(
"{}/propertymappings/source/telegram/{pm_uuid}/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request);
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::TelegramSourcePropertyMapping`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceTelegramUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn propertymappings_source_telegram_used_by_list(
configuration: &configuration::Configuration,
pm_uuid: &str,
) -> Result<Vec<models::UsedBy>, Error<PropertymappingsSourceTelegramUsedByListError>> {
let p_path_pm_uuid = pm_uuid;
let uri_str = format!(
"{}/propertymappings/source/telegram/{pm_uuid}/used_by/",
configuration.base_path,
pm_uuid = crate::apis::urlencode(p_path_pm_uuid)
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};
let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;
let status = resp.status();
let content_type = resp
.headers()
.get("content-type")
.and_then(|v| v.to_str().ok())
.unwrap_or("application/octet-stream");
let content_type = super::ContentType::from(content_type);
if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
match content_type {
ContentType::Json => serde_json::from_str(&content).map_err(Error::from),
ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `Vec<models::UsedBy>`"))),
ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::UsedBy>`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<PropertymappingsSourceTelegramUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}