use super::{configuration, ContentType, Error};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{de::Error as _, Deserialize, Serialize};
use tokio::fs::File as TokioFile;
use tokio_util::codec::{BytesCodec, FramedRead};
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersAllDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersAllListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersAllRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersAllTypesListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersAllUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceGroupsCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceGroupsDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceGroupsListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceGroupsRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceGroupsUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspacePartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceSyncObjectCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceSyncStatusRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceUsersCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceUsersDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceUsersListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceUsersRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersGoogleWorkspaceUsersUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersLdapCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersLdapDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersLdapListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersLdapPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersLdapRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersLdapUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersLdapUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraGroupsCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraGroupsDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraGroupsListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraGroupsRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraGroupsUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraSyncObjectCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraSyncStatusRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraUsersCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraUsersDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraUsersListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraUsersRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersMicrosoftEntraUsersUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2CreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2DestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2ListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2PartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2PreviewUserRetrieveError {
Status400(),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2RetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2SetupUrlsRetrieveError {
Status404(),
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2UpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersOauth2UsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersProxyCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersProxyDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersProxyListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersProxyPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersProxyRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersProxyUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersProxyUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRacCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRacDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRacListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRacPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRacRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRacUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRacUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRadiusCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRadiusDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRadiusListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRadiusPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRadiusRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRadiusUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersRadiusUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlImportMetadataCreateError {
Status400(),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlMetadataRetrieveError {
Status404(),
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlPreviewUserRetrieveError {
Status400(),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSamlUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimGroupsCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimGroupsDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimGroupsListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimGroupsRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimGroupsUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimSyncObjectCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimSyncStatusRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimUsersCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimUsersDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimUsersListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimUsersRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersScimUsersUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSsfCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSsfDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSsfListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSsfPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSsfRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSsfUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersSsfUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedCreateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedDestroyError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedMetadataRetrieveError {
Status404(),
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedPartialUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedPreviewUserRetrieveError {
Status400(),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedRetrieveError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedUpdateError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ProvidersWsfedUsedByListError {
Status400(models::ValidationError),
Status403(models::GenericError),
UnknownValue(serde_json::Value),
}
pub async fn providers_all_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersAllDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/all/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersAllDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_all_list(
configuration: &configuration::Configuration,
application__isnull: Option<bool>,
backchannel: Option<bool>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedProviderList, Error<ProvidersAllListError>> {
let p_query_application__isnull = application__isnull;
let p_query_backchannel = backchannel;
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!("{}/providers/all/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_application__isnull {
req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_backchannel {
req_builder = req_builder.query(&[("backchannel", ¶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::PaginatedProviderList`"))),
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::PaginatedProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersAllListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_all_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::Provider, Error<ProvidersAllRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/all/{id}/", configuration.base_path, id = p_path_id);
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::Provider`",
)))
}
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::Provider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersAllRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_all_types_list(
configuration: &configuration::Configuration,
) -> Result<Vec<models::TypeCreate>, Error<ProvidersAllTypesListError>> {
let uri_str = format!("{}/providers/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<ProvidersAllTypesListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_all_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersAllUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/all/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersAllUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_create(
configuration: &configuration::Configuration,
google_workspace_provider_request: models::GoogleWorkspaceProviderRequest,
) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspaceCreateError>> {
let p_body_google_workspace_provider_request = google_workspace_provider_request;
let uri_str = format!("{}/providers/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_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::GoogleWorkspaceProvider`"))),
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::GoogleWorkspaceProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersGoogleWorkspaceDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace/{id}/",
configuration.base_path,
id = p_path_id
);
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<ProvidersGoogleWorkspaceDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_groups_create(
configuration: &configuration::Configuration,
google_workspace_provider_group_request: models::GoogleWorkspaceProviderGroupRequest,
) -> Result<models::GoogleWorkspaceProviderGroup, Error<ProvidersGoogleWorkspaceGroupsCreateError>> {
let p_body_google_workspace_provider_group_request = google_workspace_provider_group_request;
let uri_str = format!("{}/providers/google_workspace_groups/", 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_group_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::GoogleWorkspaceProviderGroup`"))),
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::GoogleWorkspaceProviderGroup`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceGroupsCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_groups_destroy(
configuration: &configuration::Configuration,
id: &str,
) -> Result<(), Error<ProvidersGoogleWorkspaceGroupsDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace_groups/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersGoogleWorkspaceGroupsDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_groups_list(
configuration: &configuration::Configuration,
group__group_uuid: Option<&str>,
group__name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
provider__id: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedGoogleWorkspaceProviderGroupList, Error<ProvidersGoogleWorkspaceGroupsListError>> {
let p_query_group__group_uuid = group__group_uuid;
let p_query_group__name = group__name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_provider__id = provider__id;
let p_query_search = search;
let uri_str = format!("{}/providers/google_workspace_groups/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_group__group_uuid {
req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_group__name {
req_builder = req_builder.query(&[("group__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_provider__id {
req_builder = req_builder.query(&[("provider__id", ¶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::PaginatedGoogleWorkspaceProviderGroupList`"))),
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::PaginatedGoogleWorkspaceProviderGroupList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceGroupsListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_groups_retrieve(
configuration: &configuration::Configuration,
id: &str,
) -> Result<models::GoogleWorkspaceProviderGroup, Error<ProvidersGoogleWorkspaceGroupsRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace_groups/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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::GoogleWorkspaceProviderGroup`"))),
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::GoogleWorkspaceProviderGroup`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceGroupsRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_groups_used_by_list(
configuration: &configuration::Configuration,
id: &str,
) -> Result<Vec<models::UsedBy>, Error<ProvidersGoogleWorkspaceGroupsUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace_groups/{id}/used_by/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersGoogleWorkspaceGroupsUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_list(
configuration: &configuration::Configuration,
delegated_subject: Option<&str>,
exclude_users_service_account: Option<bool>,
filter_group: Option<&str>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedGoogleWorkspaceProviderList, Error<ProvidersGoogleWorkspaceListError>> {
let p_query_delegated_subject = delegated_subject;
let p_query_exclude_users_service_account = exclude_users_service_account;
let p_query_filter_group = filter_group;
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!("{}/providers/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_delegated_subject {
req_builder = req_builder.query(&[("delegated_subject", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_exclude_users_service_account {
req_builder = req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_filter_group {
req_builder = req_builder.query(&[("filter_group", ¶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::PaginatedGoogleWorkspaceProviderList`"))),
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::PaginatedGoogleWorkspaceProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_google_workspace_provider_request: Option<models::PatchedGoogleWorkspaceProviderRequest>,
) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspacePartialUpdateError>> {
let p_path_id = id;
let p_body_patched_google_workspace_provider_request = patched_google_workspace_provider_request;
let uri_str = format!(
"{}/providers/google_workspace/{id}/",
configuration.base_path,
id = p_path_id
);
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_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::GoogleWorkspaceProvider`"))),
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::GoogleWorkspaceProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspacePartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspaceRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace/{id}/",
configuration.base_path,
id = p_path_id
);
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::GoogleWorkspaceProvider`"))),
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::GoogleWorkspaceProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_sync_object_create(
configuration: &configuration::Configuration,
id: i32,
sync_object_request: models::SyncObjectRequest,
) -> Result<models::SyncObjectResult, Error<ProvidersGoogleWorkspaceSyncObjectCreateError>> {
let p_path_id = id;
let p_body_sync_object_request = sync_object_request;
let uri_str = format!(
"{}/providers/google_workspace/{id}/sync/object/",
configuration.base_path,
id = p_path_id
);
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_sync_object_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::SyncObjectResult`"))),
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::SyncObjectResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceSyncObjectCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_sync_status_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::SyncStatus, Error<ProvidersGoogleWorkspaceSyncStatusRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace/{id}/sync/status/",
configuration.base_path,
id = p_path_id
);
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::SyncStatus`",
)))
}
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::SyncStatus`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_update(
configuration: &configuration::Configuration,
id: i32,
google_workspace_provider_request: models::GoogleWorkspaceProviderRequest,
) -> Result<models::GoogleWorkspaceProvider, Error<ProvidersGoogleWorkspaceUpdateError>> {
let p_path_id = id;
let p_body_google_workspace_provider_request = google_workspace_provider_request;
let uri_str = format!(
"{}/providers/google_workspace/{id}/",
configuration.base_path,
id = p_path_id
);
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_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::GoogleWorkspaceProvider`"))),
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::GoogleWorkspaceProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersGoogleWorkspaceUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersGoogleWorkspaceUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_users_create(
configuration: &configuration::Configuration,
google_workspace_provider_user_request: models::GoogleWorkspaceProviderUserRequest,
) -> Result<models::GoogleWorkspaceProviderUser, Error<ProvidersGoogleWorkspaceUsersCreateError>> {
let p_body_google_workspace_provider_user_request = google_workspace_provider_user_request;
let uri_str = format!("{}/providers/google_workspace_users/", 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_user_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::GoogleWorkspaceProviderUser`"))),
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::GoogleWorkspaceProviderUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceUsersCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_users_destroy(
configuration: &configuration::Configuration,
id: &str,
) -> Result<(), Error<ProvidersGoogleWorkspaceUsersDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace_users/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersGoogleWorkspaceUsersDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_users_list(
configuration: &configuration::Configuration,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
provider__id: Option<i32>,
search: Option<&str>,
user__id: Option<i32>,
user__username: Option<&str>,
) -> Result<models::PaginatedGoogleWorkspaceProviderUserList, Error<ProvidersGoogleWorkspaceUsersListError>> {
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_provider__id = provider__id;
let p_query_search = search;
let p_query_user__id = user__id;
let p_query_user__username = user__username;
let uri_str = format!("{}/providers/google_workspace_users/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
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_provider__id {
req_builder = req_builder.query(&[("provider__id", ¶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 param_value) = p_query_user__id {
req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_user__username {
req_builder = req_builder.query(&[("user__username", ¶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::PaginatedGoogleWorkspaceProviderUserList`"))),
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::PaginatedGoogleWorkspaceProviderUserList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceUsersListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_users_retrieve(
configuration: &configuration::Configuration,
id: &str,
) -> Result<models::GoogleWorkspaceProviderUser, Error<ProvidersGoogleWorkspaceUsersRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace_users/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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::GoogleWorkspaceProviderUser`"))),
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::GoogleWorkspaceProviderUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersGoogleWorkspaceUsersRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_google_workspace_users_used_by_list(
configuration: &configuration::Configuration,
id: &str,
) -> Result<Vec<models::UsedBy>, Error<ProvidersGoogleWorkspaceUsersUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/google_workspace_users/{id}/used_by/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersGoogleWorkspaceUsersUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ldap_create(
configuration: &configuration::Configuration,
ldap_provider_request: models::LdapProviderRequest,
) -> Result<models::LdapProvider, Error<ProvidersLdapCreateError>> {
let p_body_ldap_provider_request = ldap_provider_request;
let uri_str = format!("{}/providers/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_provider_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::LdapProvider`",
)))
}
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::LdapProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersLdapCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ldap_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersLdapDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersLdapDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ldap_list(
configuration: &configuration::Configuration,
application__isnull: Option<bool>,
authorization_flow__slug__iexact: Option<&str>,
base_dn__iexact: Option<&str>,
certificate__kp_uuid__iexact: Option<&str>,
certificate__name__iexact: Option<&str>,
gid_start_number__iexact: Option<i32>,
name__iexact: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
tls_server_name__iexact: Option<&str>,
uid_start_number__iexact: Option<i32>,
) -> Result<models::PaginatedLdapProviderList, Error<ProvidersLdapListError>> {
let p_query_application__isnull = application__isnull;
let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact;
let p_query_base_dn__iexact = base_dn__iexact;
let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact;
let p_query_certificate__name__iexact = certificate__name__iexact;
let p_query_gid_start_number__iexact = gid_start_number__iexact;
let p_query_name__iexact = name__iexact;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_search = search;
let p_query_tls_server_name__iexact = tls_server_name__iexact;
let p_query_uid_start_number__iexact = uid_start_number__iexact;
let uri_str = format!("{}/providers/ldap/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_application__isnull {
req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authorization_flow__slug__iexact {
req_builder = req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_base_dn__iexact {
req_builder = req_builder.query(&[("base_dn__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact {
req_builder = req_builder.query(&[("certificate__kp_uuid__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_certificate__name__iexact {
req_builder = req_builder.query(&[("certificate__name__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_gid_start_number__iexact {
req_builder = req_builder.query(&[("gid_start_number__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name__iexact {
req_builder = req_builder.query(&[("name__iexact", ¶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 param_value) = p_query_tls_server_name__iexact {
req_builder = req_builder.query(&[("tls_server_name__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_uid_start_number__iexact {
req_builder = req_builder.query(&[("uid_start_number__iexact", ¶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::PaginatedLdapProviderList`"))),
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::PaginatedLdapProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersLdapListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ldap_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_ldap_provider_request: Option<models::PatchedLdapProviderRequest>,
) -> Result<models::LdapProvider, Error<ProvidersLdapPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_ldap_provider_request = patched_ldap_provider_request;
let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::LdapProvider`",
)))
}
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::LdapProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersLdapPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ldap_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::LdapProvider, Error<ProvidersLdapRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
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::LdapProvider`",
)))
}
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::LdapProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersLdapRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ldap_update(
configuration: &configuration::Configuration,
id: i32,
ldap_provider_request: models::LdapProviderRequest,
) -> Result<models::LdapProvider, Error<ProvidersLdapUpdateError>> {
let p_path_id = id;
let p_body_ldap_provider_request = ldap_provider_request;
let uri_str = format!("{}/providers/ldap/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::LdapProvider`",
)))
}
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::LdapProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersLdapUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ldap_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersLdapUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/ldap/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersLdapUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_create(
configuration: &configuration::Configuration,
microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest,
) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraCreateError>> {
let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request;
let uri_str = format!("{}/providers/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_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::MicrosoftEntraProvider`"))),
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::MicrosoftEntraProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersMicrosoftEntraDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra/{id}/",
configuration.base_path,
id = p_path_id
);
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<ProvidersMicrosoftEntraDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_groups_create(
configuration: &configuration::Configuration,
microsoft_entra_provider_group_request: models::MicrosoftEntraProviderGroupRequest,
) -> Result<models::MicrosoftEntraProviderGroup, Error<ProvidersMicrosoftEntraGroupsCreateError>> {
let p_body_microsoft_entra_provider_group_request = microsoft_entra_provider_group_request;
let uri_str = format!("{}/providers/microsoft_entra_groups/", 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_group_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::MicrosoftEntraProviderGroup`"))),
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::MicrosoftEntraProviderGroup`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraGroupsCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_groups_destroy(
configuration: &configuration::Configuration,
id: &str,
) -> Result<(), Error<ProvidersMicrosoftEntraGroupsDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra_groups/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersMicrosoftEntraGroupsDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_groups_list(
configuration: &configuration::Configuration,
group__group_uuid: Option<&str>,
group__name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
provider__id: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedMicrosoftEntraProviderGroupList, Error<ProvidersMicrosoftEntraGroupsListError>> {
let p_query_group__group_uuid = group__group_uuid;
let p_query_group__name = group__name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_provider__id = provider__id;
let p_query_search = search;
let uri_str = format!("{}/providers/microsoft_entra_groups/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_group__group_uuid {
req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_group__name {
req_builder = req_builder.query(&[("group__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_provider__id {
req_builder = req_builder.query(&[("provider__id", ¶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::PaginatedMicrosoftEntraProviderGroupList`"))),
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::PaginatedMicrosoftEntraProviderGroupList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraGroupsListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_groups_retrieve(
configuration: &configuration::Configuration,
id: &str,
) -> Result<models::MicrosoftEntraProviderGroup, Error<ProvidersMicrosoftEntraGroupsRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra_groups/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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::MicrosoftEntraProviderGroup`"))),
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::MicrosoftEntraProviderGroup`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraGroupsRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_groups_used_by_list(
configuration: &configuration::Configuration,
id: &str,
) -> Result<Vec<models::UsedBy>, Error<ProvidersMicrosoftEntraGroupsUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra_groups/{id}/used_by/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersMicrosoftEntraGroupsUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_list(
configuration: &configuration::Configuration,
exclude_users_service_account: Option<bool>,
filter_group: Option<&str>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedMicrosoftEntraProviderList, Error<ProvidersMicrosoftEntraListError>> {
let p_query_exclude_users_service_account = exclude_users_service_account;
let p_query_filter_group = filter_group;
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!("{}/providers/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_exclude_users_service_account {
req_builder = req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_filter_group {
req_builder = req_builder.query(&[("filter_group", ¶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::PaginatedMicrosoftEntraProviderList`"))),
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::PaginatedMicrosoftEntraProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_microsoft_entra_provider_request: Option<models::PatchedMicrosoftEntraProviderRequest>,
) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_microsoft_entra_provider_request = patched_microsoft_entra_provider_request;
let uri_str = format!(
"{}/providers/microsoft_entra/{id}/",
configuration.base_path,
id = p_path_id
);
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_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::MicrosoftEntraProvider`"))),
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::MicrosoftEntraProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra/{id}/",
configuration.base_path,
id = p_path_id
);
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::MicrosoftEntraProvider`"))),
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::MicrosoftEntraProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_sync_object_create(
configuration: &configuration::Configuration,
id: i32,
sync_object_request: models::SyncObjectRequest,
) -> Result<models::SyncObjectResult, Error<ProvidersMicrosoftEntraSyncObjectCreateError>> {
let p_path_id = id;
let p_body_sync_object_request = sync_object_request;
let uri_str = format!(
"{}/providers/microsoft_entra/{id}/sync/object/",
configuration.base_path,
id = p_path_id
);
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_sync_object_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::SyncObjectResult`"))),
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::SyncObjectResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraSyncObjectCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_sync_status_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::SyncStatus, Error<ProvidersMicrosoftEntraSyncStatusRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra/{id}/sync/status/",
configuration.base_path,
id = p_path_id
);
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::SyncStatus`",
)))
}
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::SyncStatus`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_update(
configuration: &configuration::Configuration,
id: i32,
microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest,
) -> Result<models::MicrosoftEntraProvider, Error<ProvidersMicrosoftEntraUpdateError>> {
let p_path_id = id;
let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request;
let uri_str = format!(
"{}/providers/microsoft_entra/{id}/",
configuration.base_path,
id = p_path_id
);
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_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::MicrosoftEntraProvider`"))),
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::MicrosoftEntraProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersMicrosoftEntraUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersMicrosoftEntraUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_users_create(
configuration: &configuration::Configuration,
microsoft_entra_provider_user_request: models::MicrosoftEntraProviderUserRequest,
) -> Result<models::MicrosoftEntraProviderUser, Error<ProvidersMicrosoftEntraUsersCreateError>> {
let p_body_microsoft_entra_provider_user_request = microsoft_entra_provider_user_request;
let uri_str = format!("{}/providers/microsoft_entra_users/", 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_user_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::MicrosoftEntraProviderUser`"))),
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::MicrosoftEntraProviderUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraUsersCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_users_destroy(
configuration: &configuration::Configuration,
id: &str,
) -> Result<(), Error<ProvidersMicrosoftEntraUsersDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra_users/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersMicrosoftEntraUsersDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_users_list(
configuration: &configuration::Configuration,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
provider__id: Option<i32>,
search: Option<&str>,
user__id: Option<i32>,
user__username: Option<&str>,
) -> Result<models::PaginatedMicrosoftEntraProviderUserList, Error<ProvidersMicrosoftEntraUsersListError>> {
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_provider__id = provider__id;
let p_query_search = search;
let p_query_user__id = user__id;
let p_query_user__username = user__username;
let uri_str = format!("{}/providers/microsoft_entra_users/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
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_provider__id {
req_builder = req_builder.query(&[("provider__id", ¶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 param_value) = p_query_user__id {
req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_user__username {
req_builder = req_builder.query(&[("user__username", ¶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::PaginatedMicrosoftEntraProviderUserList`"))),
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::PaginatedMicrosoftEntraProviderUserList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraUsersListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_users_retrieve(
configuration: &configuration::Configuration,
id: &str,
) -> Result<models::MicrosoftEntraProviderUser, Error<ProvidersMicrosoftEntraUsersRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra_users/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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::MicrosoftEntraProviderUser`"))),
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::MicrosoftEntraProviderUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersMicrosoftEntraUsersRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_microsoft_entra_users_used_by_list(
configuration: &configuration::Configuration,
id: &str,
) -> Result<Vec<models::UsedBy>, Error<ProvidersMicrosoftEntraUsersUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/microsoft_entra_users/{id}/used_by/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersMicrosoftEntraUsersUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_create(
configuration: &configuration::Configuration,
o_auth2_provider_request: models::OAuth2ProviderRequest,
) -> Result<models::OAuth2Provider, Error<ProvidersOauth2CreateError>> {
let p_body_o_auth2_provider_request = o_auth2_provider_request;
let uri_str = format!("{}/providers/oauth2/", 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_auth2_provider_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::OAuth2Provider`",
)))
}
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::OAuth2Provider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersOauth2CreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersOauth2DestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersOauth2DestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_list(
configuration: &configuration::Configuration,
access_code_validity: Option<&str>,
access_token_validity: Option<&str>,
application: Option<&str>,
authorization_flow: Option<&str>,
client_id: Option<&str>,
client_type: Option<&str>,
include_claims_in_id_token: Option<bool>,
issuer_mode: Option<&str>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
property_mappings: Option<Vec<uuid::Uuid>>,
refresh_token_validity: Option<&str>,
search: Option<&str>,
signing_key: Option<&str>,
sub_mode: Option<&str>,
) -> Result<models::PaginatedOAuth2ProviderList, Error<ProvidersOauth2ListError>> {
let p_query_access_code_validity = access_code_validity;
let p_query_access_token_validity = access_token_validity;
let p_query_application = application;
let p_query_authorization_flow = authorization_flow;
let p_query_client_id = client_id;
let p_query_client_type = client_type;
let p_query_include_claims_in_id_token = include_claims_in_id_token;
let p_query_issuer_mode = issuer_mode;
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_property_mappings = property_mappings;
let p_query_refresh_token_validity = refresh_token_validity;
let p_query_search = search;
let p_query_signing_key = signing_key;
let p_query_sub_mode = sub_mode;
let uri_str = format!("{}/providers/oauth2/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_access_code_validity {
req_builder = req_builder.query(&[("access_code_validity", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_access_token_validity {
req_builder = req_builder.query(&[("access_token_validity", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_application {
req_builder = req_builder.query(&[("application", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authorization_flow {
req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_client_id {
req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_client_type {
req_builder = req_builder.query(&[("client_type", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_include_claims_in_id_token {
req_builder = req_builder.query(&[("include_claims_in_id_token", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_issuer_mode {
req_builder = req_builder.query(&[("issuer_mode", ¶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_property_mappings {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("property_mappings".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"property_mappings",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.to_string(),
)]),
};
}
if let Some(ref param_value) = p_query_refresh_token_validity {
req_builder = req_builder.query(&[("refresh_token_validity", ¶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 param_value) = p_query_signing_key {
req_builder = req_builder.query(&[("signing_key", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sub_mode {
req_builder = req_builder.query(&[("sub_mode", ¶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::PaginatedOAuth2ProviderList`"))),
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::PaginatedOAuth2ProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersOauth2ListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_o_auth2_provider_request: Option<models::PatchedOAuth2ProviderRequest>,
) -> Result<models::OAuth2Provider, Error<ProvidersOauth2PartialUpdateError>> {
let p_path_id = id;
let p_body_patched_o_auth2_provider_request = patched_o_auth2_provider_request;
let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
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_auth2_provider_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::OAuth2Provider`",
)))
}
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::OAuth2Provider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersOauth2PartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_preview_user_retrieve(
configuration: &configuration::Configuration,
id: i32,
for_user: Option<i32>,
) -> Result<models::PropertyMappingPreview, Error<ProvidersOauth2PreviewUserRetrieveError>> {
let p_path_id = id;
let p_query_for_user = for_user;
let uri_str = format!(
"{}/providers/oauth2/{id}/preview_user/",
configuration.base_path,
id = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_for_user {
req_builder = req_builder.query(&[("for_user", ¶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::PropertyMappingPreview`"))),
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::PropertyMappingPreview`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersOauth2PreviewUserRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::OAuth2Provider, Error<ProvidersOauth2RetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
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::OAuth2Provider`",
)))
}
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::OAuth2Provider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersOauth2RetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_setup_urls_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::OAuth2ProviderSetupUrls, Error<ProvidersOauth2SetupUrlsRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/oauth2/{id}/setup_urls/",
configuration.base_path,
id = p_path_id
);
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::OAuth2ProviderSetupUrls`"))),
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::OAuth2ProviderSetupUrls`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersOauth2SetupUrlsRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_update(
configuration: &configuration::Configuration,
id: i32,
o_auth2_provider_request: models::OAuth2ProviderRequest,
) -> Result<models::OAuth2Provider, Error<ProvidersOauth2UpdateError>> {
let p_path_id = id;
let p_body_o_auth2_provider_request = o_auth2_provider_request;
let uri_str = format!("{}/providers/oauth2/{id}/", configuration.base_path, id = p_path_id);
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_auth2_provider_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::OAuth2Provider`",
)))
}
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::OAuth2Provider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersOauth2UpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_oauth2_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersOauth2UsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/oauth2/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersOauth2UsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_proxy_create(
configuration: &configuration::Configuration,
proxy_provider_request: models::ProxyProviderRequest,
) -> Result<models::ProxyProvider, Error<ProvidersProxyCreateError>> {
let p_body_proxy_provider_request = proxy_provider_request;
let uri_str = format!("{}/providers/proxy/", 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_proxy_provider_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::ProxyProvider`",
)))
}
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::ProxyProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersProxyCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_proxy_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersProxyDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersProxyDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_proxy_list(
configuration: &configuration::Configuration,
application__isnull: Option<bool>,
authorization_flow__slug__iexact: Option<&str>,
basic_auth_enabled__iexact: Option<bool>,
basic_auth_password_attribute__iexact: Option<&str>,
basic_auth_user_attribute__iexact: Option<&str>,
certificate__kp_uuid__iexact: Option<&str>,
certificate__name__iexact: Option<&str>,
cookie_domain__iexact: Option<&str>,
external_host__iexact: Option<&str>,
internal_host__iexact: Option<&str>,
internal_host_ssl_validation__iexact: Option<bool>,
mode__iexact: Option<&str>,
name__iexact: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
property_mappings__iexact: Option<Vec<uuid::Uuid>>,
search: Option<&str>,
skip_path_regex__iexact: Option<&str>,
) -> Result<models::PaginatedProxyProviderList, Error<ProvidersProxyListError>> {
let p_query_application__isnull = application__isnull;
let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact;
let p_query_basic_auth_enabled__iexact = basic_auth_enabled__iexact;
let p_query_basic_auth_password_attribute__iexact = basic_auth_password_attribute__iexact;
let p_query_basic_auth_user_attribute__iexact = basic_auth_user_attribute__iexact;
let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact;
let p_query_certificate__name__iexact = certificate__name__iexact;
let p_query_cookie_domain__iexact = cookie_domain__iexact;
let p_query_external_host__iexact = external_host__iexact;
let p_query_internal_host__iexact = internal_host__iexact;
let p_query_internal_host_ssl_validation__iexact = internal_host_ssl_validation__iexact;
let p_query_mode__iexact = mode__iexact;
let p_query_name__iexact = name__iexact;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_property_mappings__iexact = property_mappings__iexact;
let p_query_search = search;
let p_query_skip_path_regex__iexact = skip_path_regex__iexact;
let uri_str = format!("{}/providers/proxy/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_application__isnull {
req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authorization_flow__slug__iexact {
req_builder = req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_basic_auth_enabled__iexact {
req_builder = req_builder.query(&[("basic_auth_enabled__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_basic_auth_password_attribute__iexact {
req_builder = req_builder.query(&[("basic_auth_password_attribute__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_basic_auth_user_attribute__iexact {
req_builder = req_builder.query(&[("basic_auth_user_attribute__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact {
req_builder = req_builder.query(&[("certificate__kp_uuid__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_certificate__name__iexact {
req_builder = req_builder.query(&[("certificate__name__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_cookie_domain__iexact {
req_builder = req_builder.query(&[("cookie_domain__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_external_host__iexact {
req_builder = req_builder.query(&[("external_host__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_internal_host__iexact {
req_builder = req_builder.query(&[("internal_host__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_internal_host_ssl_validation__iexact {
req_builder = req_builder.query(&[("internal_host_ssl_validation__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_mode__iexact {
req_builder = req_builder.query(&[("mode__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name__iexact {
req_builder = req_builder.query(&[("name__iexact", ¶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_property_mappings__iexact {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("property_mappings__iexact".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"property_mappings__iexact",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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 param_value) = p_query_skip_path_regex__iexact {
req_builder = req_builder.query(&[("skip_path_regex__iexact", ¶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::PaginatedProxyProviderList`"))),
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::PaginatedProxyProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersProxyListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_proxy_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_proxy_provider_request: Option<models::PatchedProxyProviderRequest>,
) -> Result<models::ProxyProvider, Error<ProvidersProxyPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_proxy_provider_request = patched_proxy_provider_request;
let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
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_proxy_provider_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::ProxyProvider`",
)))
}
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::ProxyProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersProxyPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_proxy_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::ProxyProvider, Error<ProvidersProxyRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
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::ProxyProvider`",
)))
}
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::ProxyProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersProxyRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_proxy_update(
configuration: &configuration::Configuration,
id: i32,
proxy_provider_request: models::ProxyProviderRequest,
) -> Result<models::ProxyProvider, Error<ProvidersProxyUpdateError>> {
let p_path_id = id;
let p_body_proxy_provider_request = proxy_provider_request;
let uri_str = format!("{}/providers/proxy/{id}/", configuration.base_path, id = p_path_id);
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_proxy_provider_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::ProxyProvider`",
)))
}
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::ProxyProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersProxyUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_proxy_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersProxyUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/proxy/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersProxyUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_rac_create(
configuration: &configuration::Configuration,
rac_provider_request: models::RacProviderRequest,
) -> Result<models::RacProvider, Error<ProvidersRacCreateError>> {
let p_body_rac_provider_request = rac_provider_request;
let uri_str = format!("{}/providers/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_provider_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::RacProvider`",
)))
}
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::RacProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRacCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_rac_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersRacDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersRacDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_rac_list(
configuration: &configuration::Configuration,
application__isnull: Option<bool>,
name__iexact: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedRacProviderList, Error<ProvidersRacListError>> {
let p_query_application__isnull = application__isnull;
let p_query_name__iexact = name__iexact;
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!("{}/providers/rac/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_application__isnull {
req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name__iexact {
req_builder = req_builder.query(&[("name__iexact", ¶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::PaginatedRacProviderList`"))),
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::PaginatedRacProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRacListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_rac_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_rac_provider_request: Option<models::PatchedRacProviderRequest>,
) -> Result<models::RacProvider, Error<ProvidersRacPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_rac_provider_request = patched_rac_provider_request;
let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::RacProvider`",
)))
}
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::RacProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRacPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_rac_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::RacProvider, Error<ProvidersRacRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
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::RacProvider`",
)))
}
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::RacProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRacRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_rac_update(
configuration: &configuration::Configuration,
id: i32,
rac_provider_request: models::RacProviderRequest,
) -> Result<models::RacProvider, Error<ProvidersRacUpdateError>> {
let p_path_id = id;
let p_body_rac_provider_request = rac_provider_request;
let uri_str = format!("{}/providers/rac/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::RacProvider`",
)))
}
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::RacProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRacUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_rac_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersRacUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/rac/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersRacUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_radius_create(
configuration: &configuration::Configuration,
radius_provider_request: models::RadiusProviderRequest,
) -> Result<models::RadiusProvider, Error<ProvidersRadiusCreateError>> {
let p_body_radius_provider_request = radius_provider_request;
let uri_str = format!("{}/providers/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_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::RadiusProvider`",
)))
}
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::RadiusProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRadiusCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_radius_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersRadiusDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersRadiusDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_radius_list(
configuration: &configuration::Configuration,
application__isnull: Option<bool>,
authorization_flow__slug__iexact: Option<&str>,
client_networks__iexact: Option<&str>,
name__iexact: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedRadiusProviderList, Error<ProvidersRadiusListError>> {
let p_query_application__isnull = application__isnull;
let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact;
let p_query_client_networks__iexact = client_networks__iexact;
let p_query_name__iexact = name__iexact;
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!("{}/providers/radius/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_application__isnull {
req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authorization_flow__slug__iexact {
req_builder = req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_client_networks__iexact {
req_builder = req_builder.query(&[("client_networks__iexact", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name__iexact {
req_builder = req_builder.query(&[("name__iexact", ¶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::PaginatedRadiusProviderList`"))),
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::PaginatedRadiusProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRadiusListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_radius_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_radius_provider_request: Option<models::PatchedRadiusProviderRequest>,
) -> Result<models::RadiusProvider, Error<ProvidersRadiusPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_radius_provider_request = patched_radius_provider_request;
let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
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_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::RadiusProvider`",
)))
}
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::RadiusProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRadiusPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_radius_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::RadiusProvider, Error<ProvidersRadiusRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
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::RadiusProvider`",
)))
}
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::RadiusProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRadiusRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_radius_update(
configuration: &configuration::Configuration,
id: i32,
radius_provider_request: models::RadiusProviderRequest,
) -> Result<models::RadiusProvider, Error<ProvidersRadiusUpdateError>> {
let p_path_id = id;
let p_body_radius_provider_request = radius_provider_request;
let uri_str = format!("{}/providers/radius/{id}/", configuration.base_path, id = p_path_id);
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_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::RadiusProvider`",
)))
}
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::RadiusProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersRadiusUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_radius_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersRadiusUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/radius/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersRadiusUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_create(
configuration: &configuration::Configuration,
saml_provider_request: models::SamlProviderRequest,
) -> Result<models::SamlProvider, Error<ProvidersSamlCreateError>> {
let p_body_saml_provider_request = saml_provider_request;
let uri_str = format!("{}/providers/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_provider_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::SamlProvider`",
)))
}
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::SamlProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersSamlDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersSamlDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_import_metadata_create(
configuration: &configuration::Configuration,
name: &str,
authorization_flow: &str,
invalidation_flow: &str,
file: std::path::PathBuf,
) -> Result<models::SamlProvider, Error<ProvidersSamlImportMetadataCreateError>> {
let p_form_name = name;
let p_form_authorization_flow = authorization_flow;
let p_form_invalidation_flow = invalidation_flow;
let p_form_file = file;
let uri_str = format!("{}/providers/saml/import_metadata/", 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());
};
let mut multipart_form = reqwest::multipart::Form::new();
multipart_form = multipart_form.text("name", p_form_name.to_string());
multipart_form = multipart_form.text("authorization_flow", p_form_authorization_flow.to_string());
multipart_form = multipart_form.text("invalidation_flow", p_form_invalidation_flow.to_string());
let file = TokioFile::open(&p_form_file).await?;
let stream = FramedRead::new(file, BytesCodec::new());
let file_name = p_form_file
.file_name()
.map(|n| n.to_string_lossy().to_string())
.unwrap_or_default();
let file_part = reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name);
multipart_form = multipart_form.part("file", file_part);
req_builder = req_builder.multipart(multipart_form);
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::SamlProvider`",
)))
}
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::SamlProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlImportMetadataCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_list(
configuration: &configuration::Configuration,
acs_url: Option<&str>,
assertion_valid_not_before: Option<&str>,
assertion_valid_not_on_or_after: Option<&str>,
audience: Option<&str>,
authentication_flow: Option<&str>,
authn_context_class_ref_mapping: Option<&str>,
authorization_flow: Option<&str>,
backchannel_application: Option<&str>,
default_name_id_policy: Option<&str>,
default_relay_state: Option<&str>,
digest_algorithm: Option<&str>,
encryption_kp: Option<&str>,
invalidation_flow: Option<&str>,
is_backchannel: Option<bool>,
issuer: Option<&str>,
logout_method: Option<&str>,
name: Option<&str>,
name_id_mapping: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
property_mappings: Option<Vec<uuid::Uuid>>,
search: Option<&str>,
session_valid_not_on_or_after: Option<&str>,
sign_assertion: Option<bool>,
sign_logout_request: Option<bool>,
sign_response: Option<bool>,
signature_algorithm: Option<&str>,
signing_kp: Option<&str>,
sls_binding: Option<&str>,
sls_url: Option<&str>,
sp_binding: Option<&str>,
verification_kp: Option<&str>,
) -> Result<models::PaginatedSamlProviderList, Error<ProvidersSamlListError>> {
let p_query_acs_url = acs_url;
let p_query_assertion_valid_not_before = assertion_valid_not_before;
let p_query_assertion_valid_not_on_or_after = assertion_valid_not_on_or_after;
let p_query_audience = audience;
let p_query_authentication_flow = authentication_flow;
let p_query_authn_context_class_ref_mapping = authn_context_class_ref_mapping;
let p_query_authorization_flow = authorization_flow;
let p_query_backchannel_application = backchannel_application;
let p_query_default_name_id_policy = default_name_id_policy;
let p_query_default_relay_state = default_relay_state;
let p_query_digest_algorithm = digest_algorithm;
let p_query_encryption_kp = encryption_kp;
let p_query_invalidation_flow = invalidation_flow;
let p_query_is_backchannel = is_backchannel;
let p_query_issuer = issuer;
let p_query_logout_method = logout_method;
let p_query_name = name;
let p_query_name_id_mapping = name_id_mapping;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_property_mappings = property_mappings;
let p_query_search = search;
let p_query_session_valid_not_on_or_after = session_valid_not_on_or_after;
let p_query_sign_assertion = sign_assertion;
let p_query_sign_logout_request = sign_logout_request;
let p_query_sign_response = sign_response;
let p_query_signature_algorithm = signature_algorithm;
let p_query_signing_kp = signing_kp;
let p_query_sls_binding = sls_binding;
let p_query_sls_url = sls_url;
let p_query_sp_binding = sp_binding;
let p_query_verification_kp = verification_kp;
let uri_str = format!("{}/providers/saml/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_acs_url {
req_builder = req_builder.query(&[("acs_url", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_assertion_valid_not_before {
req_builder = req_builder.query(&[("assertion_valid_not_before", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_assertion_valid_not_on_or_after {
req_builder = req_builder.query(&[("assertion_valid_not_on_or_after", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_audience {
req_builder = req_builder.query(&[("audience", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authentication_flow {
req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authn_context_class_ref_mapping {
req_builder = req_builder.query(&[("authn_context_class_ref_mapping", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authorization_flow {
req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_backchannel_application {
req_builder = req_builder.query(&[("backchannel_application", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_default_name_id_policy {
req_builder = req_builder.query(&[("default_name_id_policy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_default_relay_state {
req_builder = req_builder.query(&[("default_relay_state", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_digest_algorithm {
req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_encryption_kp {
req_builder = req_builder.query(&[("encryption_kp", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_invalidation_flow {
req_builder = req_builder.query(&[("invalidation_flow", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_is_backchannel {
req_builder = req_builder.query(&[("is_backchannel", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_issuer {
req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_logout_method {
req_builder = req_builder.query(&[("logout_method", ¶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_name_id_mapping {
req_builder = req_builder.query(&[("name_id_mapping", ¶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_property_mappings {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("property_mappings".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"property_mappings",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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 param_value) = p_query_session_valid_not_on_or_after {
req_builder = req_builder.query(&[("session_valid_not_on_or_after", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sign_assertion {
req_builder = req_builder.query(&[("sign_assertion", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sign_logout_request {
req_builder = req_builder.query(&[("sign_logout_request", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sign_response {
req_builder = req_builder.query(&[("sign_response", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_signature_algorithm {
req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_signing_kp {
req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sls_binding {
req_builder = req_builder.query(&[("sls_binding", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sls_url {
req_builder = req_builder.query(&[("sls_url", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sp_binding {
req_builder = req_builder.query(&[("sp_binding", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_verification_kp {
req_builder = req_builder.query(&[("verification_kp", ¶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::PaginatedSamlProviderList`"))),
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::PaginatedSamlProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_metadata_retrieve(
configuration: &configuration::Configuration,
id: i32,
download: Option<bool>,
force_binding: Option<&str>,
) -> Result<models::SamlMetadata, Error<ProvidersSamlMetadataRetrieveError>> {
let p_path_id = id;
let p_query_download = download;
let p_query_force_binding = force_binding;
let uri_str = format!(
"{}/providers/saml/{id}/metadata/",
configuration.base_path,
id = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_download {
req_builder = req_builder.query(&[("download", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_force_binding {
req_builder = req_builder.query(&[("force_binding", ¶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::SamlMetadata`",
)))
}
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::SamlMetadata`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlMetadataRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_saml_provider_request: Option<models::PatchedSamlProviderRequest>,
) -> Result<models::SamlProvider, Error<ProvidersSamlPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_saml_provider_request = patched_saml_provider_request;
let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::SamlProvider`",
)))
}
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::SamlProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_preview_user_retrieve(
configuration: &configuration::Configuration,
id: i32,
for_user: Option<i32>,
) -> Result<models::PropertyMappingPreview, Error<ProvidersSamlPreviewUserRetrieveError>> {
let p_path_id = id;
let p_query_for_user = for_user;
let uri_str = format!(
"{}/providers/saml/{id}/preview_user/",
configuration.base_path,
id = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_for_user {
req_builder = req_builder.query(&[("for_user", ¶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::PropertyMappingPreview`"))),
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::PropertyMappingPreview`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlPreviewUserRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::SamlProvider, Error<ProvidersSamlRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
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::SamlProvider`",
)))
}
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::SamlProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_update(
configuration: &configuration::Configuration,
id: i32,
saml_provider_request: models::SamlProviderRequest,
) -> Result<models::SamlProvider, Error<ProvidersSamlUpdateError>> {
let p_path_id = id;
let p_body_saml_provider_request = saml_provider_request;
let uri_str = format!("{}/providers/saml/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::SamlProvider`",
)))
}
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::SamlProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSamlUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_saml_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersSamlUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/saml/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersSamlUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_create(
configuration: &configuration::Configuration,
scim_provider_request: models::ScimProviderRequest,
) -> Result<models::ScimProvider, Error<ProvidersScimCreateError>> {
let p_body_scim_provider_request = scim_provider_request;
let uri_str = format!("{}/providers/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_provider_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::ScimProvider`",
)))
}
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::ScimProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersScimDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersScimDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_groups_create(
configuration: &configuration::Configuration,
scim_provider_group_request: models::ScimProviderGroupRequest,
) -> Result<models::ScimProviderGroup, Error<ProvidersScimGroupsCreateError>> {
let p_body_scim_provider_group_request = scim_provider_group_request;
let uri_str = format!("{}/providers/scim_groups/", 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_provider_group_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::ScimProviderGroup`"))),
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::ScimProviderGroup`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimGroupsCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_groups_destroy(
configuration: &configuration::Configuration,
id: &str,
) -> Result<(), Error<ProvidersScimGroupsDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim_groups/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersScimGroupsDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_groups_list(
configuration: &configuration::Configuration,
group__group_uuid: Option<&str>,
group__name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
provider__id: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedScimProviderGroupList, Error<ProvidersScimGroupsListError>> {
let p_query_group__group_uuid = group__group_uuid;
let p_query_group__name = group__name;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_provider__id = provider__id;
let p_query_search = search;
let uri_str = format!("{}/providers/scim_groups/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_group__group_uuid {
req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_group__name {
req_builder = req_builder.query(&[("group__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_provider__id {
req_builder = req_builder.query(&[("provider__id", ¶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::PaginatedScimProviderGroupList`"))),
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::PaginatedScimProviderGroupList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimGroupsListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_groups_retrieve(
configuration: &configuration::Configuration,
id: &str,
) -> Result<models::ScimProviderGroup, Error<ProvidersScimGroupsRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim_groups/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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::ScimProviderGroup`"))),
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::ScimProviderGroup`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimGroupsRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_groups_used_by_list(
configuration: &configuration::Configuration,
id: &str,
) -> Result<Vec<models::UsedBy>, Error<ProvidersScimGroupsUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim_groups/{id}/used_by/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersScimGroupsUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_list(
configuration: &configuration::Configuration,
exclude_users_service_account: Option<bool>,
group_filters: Option<Vec<uuid::Uuid>>,
name: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
url: Option<&str>,
) -> Result<models::PaginatedScimProviderList, Error<ProvidersScimListError>> {
let p_query_exclude_users_service_account = exclude_users_service_account;
let p_query_group_filters = group_filters;
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 p_query_url = url;
let uri_str = format!("{}/providers/scim/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_exclude_users_service_account {
req_builder = req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_group_filters {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("group_filters".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"group_filters",
¶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 param_value) = p_query_url {
req_builder = req_builder.query(&[("url", ¶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::PaginatedScimProviderList`"))),
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::PaginatedScimProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_scim_provider_request: Option<models::PatchedScimProviderRequest>,
) -> Result<models::ScimProvider, Error<ProvidersScimPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_scim_provider_request = patched_scim_provider_request;
let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::ScimProvider`",
)))
}
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::ScimProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::ScimProvider, Error<ProvidersScimRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
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::ScimProvider`",
)))
}
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::ScimProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_sync_object_create(
configuration: &configuration::Configuration,
id: i32,
sync_object_request: models::SyncObjectRequest,
) -> Result<models::SyncObjectResult, Error<ProvidersScimSyncObjectCreateError>> {
let p_path_id = id;
let p_body_sync_object_request = sync_object_request;
let uri_str = format!(
"{}/providers/scim/{id}/sync/object/",
configuration.base_path,
id = p_path_id
);
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_sync_object_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::SyncObjectResult`"))),
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::SyncObjectResult`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimSyncObjectCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_sync_status_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::SyncStatus, Error<ProvidersScimSyncStatusRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim/{id}/sync/status/",
configuration.base_path,
id = p_path_id
);
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::SyncStatus`",
)))
}
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::SyncStatus`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimSyncStatusRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_update(
configuration: &configuration::Configuration,
id: i32,
scim_provider_request: models::ScimProviderRequest,
) -> Result<models::ScimProvider, Error<ProvidersScimUpdateError>> {
let p_path_id = id;
let p_body_scim_provider_request = scim_provider_request;
let uri_str = format!("{}/providers/scim/{id}/", configuration.base_path, id = p_path_id);
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_provider_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::ScimProvider`",
)))
}
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::ScimProvider`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersScimUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersScimUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_users_create(
configuration: &configuration::Configuration,
scim_provider_user_request: models::ScimProviderUserRequest,
) -> Result<models::ScimProviderUser, Error<ProvidersScimUsersCreateError>> {
let p_body_scim_provider_user_request = scim_provider_user_request;
let uri_str = format!("{}/providers/scim_users/", 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_provider_user_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::ScimProviderUser`"))),
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::ScimProviderUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimUsersCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_users_destroy(
configuration: &configuration::Configuration,
id: &str,
) -> Result<(), Error<ProvidersScimUsersDestroyError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim_users/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersScimUsersDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_users_list(
configuration: &configuration::Configuration,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
provider__id: Option<i32>,
search: Option<&str>,
user__id: Option<i32>,
user__username: Option<&str>,
) -> Result<models::PaginatedScimProviderUserList, Error<ProvidersScimUsersListError>> {
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_provider__id = provider__id;
let p_query_search = search;
let p_query_user__id = user__id;
let p_query_user__username = user__username;
let uri_str = format!("{}/providers/scim_users/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
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_provider__id {
req_builder = req_builder.query(&[("provider__id", ¶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 param_value) = p_query_user__id {
req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_user__username {
req_builder = req_builder.query(&[("user__username", ¶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::PaginatedScimProviderUserList`"))),
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::PaginatedScimProviderUserList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimUsersListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_users_retrieve(
configuration: &configuration::Configuration,
id: &str,
) -> Result<models::ScimProviderUser, Error<ProvidersScimUsersRetrieveError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim_users/{id}/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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::ScimProviderUser`"))),
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::ScimProviderUser`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersScimUsersRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_scim_users_used_by_list(
configuration: &configuration::Configuration,
id: &str,
) -> Result<Vec<models::UsedBy>, Error<ProvidersScimUsersUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/scim_users/{id}/used_by/",
configuration.base_path,
id = crate::apis::urlencode(p_path_id)
);
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<ProvidersScimUsersUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ssf_create(
configuration: &configuration::Configuration,
ssf_provider_request: models::SsfProviderRequest,
) -> Result<models::SsfProvider, Error<ProvidersSsfCreateError>> {
let p_body_ssf_provider_request = ssf_provider_request;
let uri_str = format!("{}/providers/ssf/", 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_ssf_provider_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::SsfProvider`",
)))
}
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::SsfProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSsfCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ssf_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersSsfDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersSsfDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ssf_list(
configuration: &configuration::Configuration,
application__isnull: Option<bool>,
name__iexact: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
search: Option<&str>,
) -> Result<models::PaginatedSsfProviderList, Error<ProvidersSsfListError>> {
let p_query_application__isnull = application__isnull;
let p_query_name__iexact = name__iexact;
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!("{}/providers/ssf/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_application__isnull {
req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_name__iexact {
req_builder = req_builder.query(&[("name__iexact", ¶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::PaginatedSsfProviderList`"))),
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::PaginatedSsfProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSsfListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ssf_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_ssf_provider_request: Option<models::PatchedSsfProviderRequest>,
) -> Result<models::SsfProvider, Error<ProvidersSsfPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_ssf_provider_request = patched_ssf_provider_request;
let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
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_ssf_provider_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::SsfProvider`",
)))
}
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::SsfProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSsfPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ssf_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::SsfProvider, Error<ProvidersSsfRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
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::SsfProvider`",
)))
}
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::SsfProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSsfRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ssf_update(
configuration: &configuration::Configuration,
id: i32,
ssf_provider_request: models::SsfProviderRequest,
) -> Result<models::SsfProvider, Error<ProvidersSsfUpdateError>> {
let p_path_id = id;
let p_body_ssf_provider_request = ssf_provider_request;
let uri_str = format!("{}/providers/ssf/{id}/", configuration.base_path, id = p_path_id);
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_ssf_provider_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::SsfProvider`",
)))
}
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::SsfProvider`"
))))
}
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersSsfUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_ssf_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersSsfUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/ssf/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersSsfUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_create(
configuration: &configuration::Configuration,
ws_federation_provider_request: models::WsFederationProviderRequest,
) -> Result<models::WsFederationProvider, Error<ProvidersWsfedCreateError>> {
let p_body_ws_federation_provider_request = ws_federation_provider_request;
let uri_str = format!("{}/providers/wsfed/", 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_ws_federation_provider_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::WsFederationProvider`"))),
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::WsFederationProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersWsfedCreateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_destroy(
configuration: &configuration::Configuration,
id: i32,
) -> Result<(), Error<ProvidersWsfedDestroyError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/wsfed/{id}/", configuration.base_path, id = p_path_id);
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<ProvidersWsfedDestroyError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_list(
configuration: &configuration::Configuration,
acs_url: Option<&str>,
assertion_valid_not_before: Option<&str>,
assertion_valid_not_on_or_after: Option<&str>,
audience: Option<&str>,
authentication_flow: Option<&str>,
authn_context_class_ref_mapping: Option<&str>,
authorization_flow: Option<&str>,
backchannel_application: Option<&str>,
default_name_id_policy: Option<&str>,
default_relay_state: Option<&str>,
digest_algorithm: Option<&str>,
encryption_kp: Option<&str>,
invalidation_flow: Option<&str>,
is_backchannel: Option<bool>,
issuer: Option<&str>,
logout_method: Option<&str>,
name: Option<&str>,
name_id_mapping: Option<&str>,
ordering: Option<&str>,
page: Option<i32>,
page_size: Option<i32>,
property_mappings: Option<Vec<uuid::Uuid>>,
search: Option<&str>,
session_valid_not_on_or_after: Option<&str>,
sign_assertion: Option<bool>,
sign_logout_request: Option<bool>,
sign_response: Option<bool>,
signature_algorithm: Option<&str>,
signing_kp: Option<&str>,
sls_binding: Option<&str>,
sls_url: Option<&str>,
sp_binding: Option<&str>,
verification_kp: Option<&str>,
) -> Result<models::PaginatedWsFederationProviderList, Error<ProvidersWsfedListError>> {
let p_query_acs_url = acs_url;
let p_query_assertion_valid_not_before = assertion_valid_not_before;
let p_query_assertion_valid_not_on_or_after = assertion_valid_not_on_or_after;
let p_query_audience = audience;
let p_query_authentication_flow = authentication_flow;
let p_query_authn_context_class_ref_mapping = authn_context_class_ref_mapping;
let p_query_authorization_flow = authorization_flow;
let p_query_backchannel_application = backchannel_application;
let p_query_default_name_id_policy = default_name_id_policy;
let p_query_default_relay_state = default_relay_state;
let p_query_digest_algorithm = digest_algorithm;
let p_query_encryption_kp = encryption_kp;
let p_query_invalidation_flow = invalidation_flow;
let p_query_is_backchannel = is_backchannel;
let p_query_issuer = issuer;
let p_query_logout_method = logout_method;
let p_query_name = name;
let p_query_name_id_mapping = name_id_mapping;
let p_query_ordering = ordering;
let p_query_page = page;
let p_query_page_size = page_size;
let p_query_property_mappings = property_mappings;
let p_query_search = search;
let p_query_session_valid_not_on_or_after = session_valid_not_on_or_after;
let p_query_sign_assertion = sign_assertion;
let p_query_sign_logout_request = sign_logout_request;
let p_query_sign_response = sign_response;
let p_query_signature_algorithm = signature_algorithm;
let p_query_signing_kp = signing_kp;
let p_query_sls_binding = sls_binding;
let p_query_sls_url = sls_url;
let p_query_sp_binding = sp_binding;
let p_query_verification_kp = verification_kp;
let uri_str = format!("{}/providers/wsfed/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_acs_url {
req_builder = req_builder.query(&[("acs_url", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_assertion_valid_not_before {
req_builder = req_builder.query(&[("assertion_valid_not_before", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_assertion_valid_not_on_or_after {
req_builder = req_builder.query(&[("assertion_valid_not_on_or_after", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_audience {
req_builder = req_builder.query(&[("audience", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authentication_flow {
req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authn_context_class_ref_mapping {
req_builder = req_builder.query(&[("authn_context_class_ref_mapping", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_authorization_flow {
req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_backchannel_application {
req_builder = req_builder.query(&[("backchannel_application", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_default_name_id_policy {
req_builder = req_builder.query(&[("default_name_id_policy", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_default_relay_state {
req_builder = req_builder.query(&[("default_relay_state", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_digest_algorithm {
req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_encryption_kp {
req_builder = req_builder.query(&[("encryption_kp", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_invalidation_flow {
req_builder = req_builder.query(&[("invalidation_flow", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_is_backchannel {
req_builder = req_builder.query(&[("is_backchannel", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_issuer {
req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_logout_method {
req_builder = req_builder.query(&[("logout_method", ¶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_name_id_mapping {
req_builder = req_builder.query(&[("name_id_mapping", ¶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_property_mappings {
req_builder = match "multi" {
"multi" => req_builder.query(
¶m_value
.into_iter()
.map(|p| ("property_mappings".to_owned(), p.to_string()))
.collect::<Vec<(std::string::String, std::string::String)>>(),
),
_ => req_builder.query(&[(
"property_mappings",
¶m_value
.into_iter()
.map(|p| p.to_string())
.collect::<Vec<String>>()
.join(",")
.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 param_value) = p_query_session_valid_not_on_or_after {
req_builder = req_builder.query(&[("session_valid_not_on_or_after", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sign_assertion {
req_builder = req_builder.query(&[("sign_assertion", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sign_logout_request {
req_builder = req_builder.query(&[("sign_logout_request", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sign_response {
req_builder = req_builder.query(&[("sign_response", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_signature_algorithm {
req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_signing_kp {
req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sls_binding {
req_builder = req_builder.query(&[("sls_binding", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sls_url {
req_builder = req_builder.query(&[("sls_url", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_sp_binding {
req_builder = req_builder.query(&[("sp_binding", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_verification_kp {
req_builder = req_builder.query(&[("verification_kp", ¶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::PaginatedWsFederationProviderList`"))),
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::PaginatedWsFederationProviderList`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersWsfedListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_metadata_retrieve(
configuration: &configuration::Configuration,
id: i32,
download: Option<bool>,
force_binding: Option<&str>,
) -> Result<models::SamlMetadata, Error<ProvidersWsfedMetadataRetrieveError>> {
let p_path_id = id;
let p_query_download = download;
let p_query_force_binding = force_binding;
let uri_str = format!(
"{}/providers/wsfed/{id}/metadata/",
configuration.base_path,
id = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_download {
req_builder = req_builder.query(&[("download", ¶m_value.to_string())]);
}
if let Some(ref param_value) = p_query_force_binding {
req_builder = req_builder.query(&[("force_binding", ¶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::SamlMetadata`",
)))
}
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::SamlMetadata`"
)))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersWsfedMetadataRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_partial_update(
configuration: &configuration::Configuration,
id: i32,
patched_ws_federation_provider_request: Option<models::PatchedWsFederationProviderRequest>,
) -> Result<models::WsFederationProvider, Error<ProvidersWsfedPartialUpdateError>> {
let p_path_id = id;
let p_body_patched_ws_federation_provider_request = patched_ws_federation_provider_request;
let uri_str = format!("{}/providers/wsfed/{id}/", configuration.base_path, id = p_path_id);
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_ws_federation_provider_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::WsFederationProvider`"))),
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::WsFederationProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersWsfedPartialUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_preview_user_retrieve(
configuration: &configuration::Configuration,
id: i32,
for_user: Option<i32>,
) -> Result<models::PropertyMappingPreview, Error<ProvidersWsfedPreviewUserRetrieveError>> {
let p_path_id = id;
let p_query_for_user = for_user;
let uri_str = format!(
"{}/providers/wsfed/{id}/preview_user/",
configuration.base_path,
id = p_path_id
);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);
if let Some(ref param_value) = p_query_for_user {
req_builder = req_builder.query(&[("for_user", ¶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::PropertyMappingPreview`"))),
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::PropertyMappingPreview`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersWsfedPreviewUserRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_retrieve(
configuration: &configuration::Configuration,
id: i32,
) -> Result<models::WsFederationProvider, Error<ProvidersWsfedRetrieveError>> {
let p_path_id = id;
let uri_str = format!("{}/providers/wsfed/{id}/", configuration.base_path, id = p_path_id);
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::WsFederationProvider`"))),
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::WsFederationProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersWsfedRetrieveError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_update(
configuration: &configuration::Configuration,
id: i32,
ws_federation_provider_request: models::WsFederationProviderRequest,
) -> Result<models::WsFederationProvider, Error<ProvidersWsfedUpdateError>> {
let p_path_id = id;
let p_body_ws_federation_provider_request = ws_federation_provider_request;
let uri_str = format!("{}/providers/wsfed/{id}/", configuration.base_path, id = p_path_id);
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_ws_federation_provider_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::WsFederationProvider`"))),
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::WsFederationProvider`")))),
}
} else {
let content = resp.text().await?;
let entity: Option<ProvidersWsfedUpdateError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
pub async fn providers_wsfed_used_by_list(
configuration: &configuration::Configuration,
id: i32,
) -> Result<Vec<models::UsedBy>, Error<ProvidersWsfedUsedByListError>> {
let p_path_id = id;
let uri_str = format!(
"{}/providers/wsfed/{id}/used_by/",
configuration.base_path,
id = p_path_id
);
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<ProvidersWsfedUsedByListError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}