use bon::bon;
use super::{configuration, Error};
use crate::apis::ContentType;
use crate::*;
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{de::Error as OtherError, Deserialize, Serialize};
use std::sync::Arc;
#[async_trait]
pub trait SecurityApi: Send + Sync {
async fn get_dashboards_info(
&self,
params: GetDashboardsInfoParams,
) -> Result<GetDashboardsInfoSuccess, Error>;
async fn patch_distinguished_name(
&self,
params: PatchDistinguishedNameParams,
) -> Result<PatchDistinguishedNameSuccess, Error>;
async fn update_distinguished_name(
&self,
params: UpdateDistinguishedNameParams,
) -> Result<UpdateDistinguishedNameSuccess, Error>;
async fn authinfo(
&self,
params: AuthinfoParams,
) -> Result<AuthinfoSuccess, Error>;
async fn patch_tenant(
&self,
params: PatchTenantParams,
) -> Result<PatchTenantSuccess, Error>;
async fn get_action_group(
&self,
params: GetActionGroupParams,
) -> Result<crate::security::ActionGroupsMap, Error>;
async fn get_account_details(
&self,
params: GetAccountDetailsParams,
) -> Result<crate::security::AccountDetails, Error>;
async fn post_dashboards_info(
&self,
params: PostDashboardsInfoParams,
) -> Result<PostDashboardsInfoSuccess, Error>;
async fn patch_audit_configuration(
&self,
params: PatchAuditConfigurationParams,
) -> Result<crate::security::Ok, Error>;
async fn patch_role_mapping(
&self,
params: PatchRoleMappingParams,
) -> Result<PatchRoleMappingSuccess, Error>;
async fn create_role_mapping(
&self,
params: CreateRoleMappingParams,
) -> Result<CreateRoleMappingSuccess, Error>;
async fn get_role_mapping(
&self,
params: GetRoleMappingParams,
) -> Result<crate::security::RoleMappings, Error>;
async fn get_role_mappings(
&self,
params: GetRoleMappingsParams,
) -> Result<crate::security::RoleMappings, Error>;
async fn patch_action_group(
&self,
params: PatchActionGroupParams,
) -> Result<crate::security::Ok, Error>;
async fn get_distinguished_name(
&self,
params: GetDistinguishedNameParams,
) -> Result<GetDistinguishedNameSuccess, Error>;
async fn get_users(
&self,
params: GetUsersParams,
) -> Result<crate::security::UsersMap, Error>;
async fn patch_role_mappings(
&self,
params: PatchRoleMappingsParams,
) -> Result<PatchRoleMappingsSuccess, Error>;
async fn create_user(
&self,
params: CreateUserParams,
) -> Result<CreateUserSuccess, Error>;
async fn migrate(
&self,
params: MigrateParams,
) -> Result<MigrateSuccess, Error>;
async fn delete_user_legacy(
&self,
params: DeleteUserLegacyParams,
) -> Result<crate::security::Ok, Error>;
async fn get_action_groups(
&self,
params: GetActionGroupsParams,
) -> Result<crate::security::ActionGroupsMap, Error>;
async fn patch_users(
&self,
params: PatchUsersParams,
) -> Result<crate::security::Ok, Error>;
async fn get_user_legacy(
&self,
params: GetUserLegacyParams,
) -> Result<crate::security::UsersMap, Error>;
async fn delete_role_mapping(
&self,
params: DeleteRoleMappingParams,
) -> Result<crate::security::Ok, Error>;
async fn delete_action_group(
&self,
params: DeleteActionGroupParams,
) -> Result<crate::security::Ok, Error>;
async fn patch_roles(
&self,
params: PatchRolesParams,
) -> Result<PatchRolesSuccess, Error>;
async fn get_audit_configuration(
&self,
params: GetAuditConfigurationParams,
) -> Result<crate::security::AuditConfigWithReadOnly, Error>;
async fn delete_tenant(
&self,
params: DeleteTenantParams,
) -> Result<DeleteTenantSuccess, Error>;
async fn tenant_info(
&self,
params: TenantInfoParams,
) -> Result<TenantInfoSuccess, Error>;
async fn delete_role(
&self,
params: DeleteRoleParams,
) -> Result<crate::security::Ok, Error>;
async fn get_certificates(
&self,
params: GetCertificatesParams,
) -> Result<GetCertificatesSuccess, Error>;
async fn create_tenant(
&self,
params: CreateTenantParams,
) -> Result<CreateTenantSuccess, Error>;
async fn validate(
&self,
params: ValidateParams,
) -> Result<ValidateSuccess, Error>;
async fn get_permissions_info(
&self,
params: GetPermissionsInfoParams,
) -> Result<GetPermissionsInfoSuccess, Error>;
async fn delete_distinguished_name(
&self,
params: DeleteDistinguishedNameParams,
) -> Result<DeleteDistinguishedNameSuccess, Error>;
async fn who_am_i(
&self,
params: WhoAmIParams,
) -> Result<WhoAmISuccess, Error>;
async fn patch_distinguished_names(
&self,
params: PatchDistinguishedNamesParams,
) -> Result<PatchDistinguishedNamesSuccess, Error>;
async fn get_tenant(
&self,
params: GetTenantParams,
) -> Result<crate::security::TenantsMap, Error>;
async fn create_role(
&self,
params: CreateRoleParams,
) -> Result<CreateRoleSuccess, Error>;
async fn delete_user(
&self,
params: DeleteUserParams,
) -> Result<crate::security::Ok, Error>;
async fn patch_action_groups(
&self,
params: PatchActionGroupsParams,
) -> Result<crate::security::Ok, Error>;
async fn get_user(
&self,
params: GetUserParams,
) -> Result<crate::security::UsersMap, Error>;
async fn get_roles(
&self,
params: GetRolesParams,
) -> Result<crate::security::RolesMap, Error>;
async fn flush_cache(
&self,
params: FlushCacheParams,
) -> Result<crate::security::Ok, Error>;
async fn create_user_legacy(
&self,
params: CreateUserLegacyParams,
) -> Result<CreateUserLegacySuccess, Error>;
async fn patch_tenants(
&self,
params: PatchTenantsParams,
) -> Result<PatchTenantsSuccess, Error>;
async fn patch_role(
&self,
params: PatchRoleParams,
) -> Result<PatchRoleSuccess, Error>;
async fn get_role(
&self,
params: GetRoleParams,
) -> Result<crate::security::RolesMap, Error>;
async fn get_distinguished_names(
&self,
params: GetDistinguishedNamesParams,
) -> Result<GetDistinguishedNamesSuccess, Error>;
async fn cache(
&self,
params: CacheParams,
) -> Result<crate::security::Error, Error>;
async fn create_action_group(
&self,
params: CreateActionGroupParams,
) -> Result<CreateActionGroupSuccess, Error>;
async fn authtoken(
&self,
params: AuthtokenParams,
) -> Result<crate::security::Ok, Error>;
async fn update_audit_configuration(
&self,
params: UpdateAuditConfigurationParams,
) -> Result<crate::security::Ok, Error>;
async fn health(
&self,
params: HealthParams,
) -> Result<crate::security::HealthInfo, Error>;
async fn get_users_legacy(
&self,
params: GetUsersLegacyParams,
) -> Result<crate::security::UsersMap, Error>;
async fn patch_user(
&self,
params: PatchUserParams,
) -> Result<crate::security::Ok, Error>;
async fn get_tenants(
&self,
params: GetTenantsParams,
) -> Result<GetTenantsSuccess, Error>;
async fn change_password(
&self,
params: ChangePasswordParams,
) -> Result<ChangePasswordSuccess, Error>;
}
pub struct SecurityApiClient {
configuration: Arc<crate::Configuration>,
}
impl SecurityApiClient {
pub fn new(configuration: Arc<crate::Configuration>) -> Self {
Self { configuration }
}
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetDashboardsInfoParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchDistinguishedNameParams {
pub cluster_name: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct UpdateDistinguishedNameParams {
pub update_distinguished_name: security::UpdateDistinguishedName,
pub cluster_name: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct AuthinfoParams {
pub auth_type: Option<String>,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub verbose: Option<bool>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchTenantParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub tenant: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetActionGroupParams {
pub action_group: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetAccountDetailsParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PostDashboardsInfoParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchAuditConfigurationParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchRoleMappingParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateRoleMappingParams {
pub create_role_mapping: security::CreateRoleMapping,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetRoleMappingParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetRoleMappingsParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchActionGroupParams {
pub action_group: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetDistinguishedNameParams {
pub cluster_name: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub show_all: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetUsersParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchRoleMappingsParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateUserParams {
pub create_user: security::CreateUser,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub username: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct MigrateParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DeleteUserLegacyParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub username: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetActionGroupsParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchUsersParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetUserLegacyParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub username: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DeleteRoleMappingParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DeleteActionGroupParams {
pub action_group: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchRolesParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetAuditConfigurationParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DeleteTenantParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub tenant: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct TenantInfoParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DeleteRoleParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetCertificatesParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateTenantParams {
pub create_tenant: security::CreateTenant,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub tenant: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct ValidateParams {
pub accept_invalid: Option<bool>,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetPermissionsInfoParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DeleteDistinguishedNameParams {
pub cluster_name: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct WhoAmIParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchDistinguishedNamesParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetTenantParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub tenant: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateRoleParams {
pub create_role: security::CreateRole,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct DeleteUserParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub username: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchActionGroupsParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetUserParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub username: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetRolesParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct FlushCacheParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateUserLegacyParams {
pub create_user_legacy: security::CreateUserLegacy,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub username: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchTenantsParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchRoleParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetRoleParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub role: String,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetDistinguishedNamesParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub show_all: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CacheParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct CreateActionGroupParams {
pub create_action_group: security::CreateActionGroup,
pub action_group: String,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct AuthtokenParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct UpdateAuditConfigurationParams {
pub update_audit_configuration: security::UpdateAuditConfiguration,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct HealthParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub mode: Option<String>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetUsersLegacyParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct PatchUserParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
pub username: String,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct GetTenantsParams {
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[derive(Clone, Debug)]
#[cfg_attr(feature = "bon", derive(::bon::Builder))]
pub struct ChangePasswordParams {
pub change_password: security::ChangePassword,
pub error_trace: Option<bool>,
pub filter_path: Option<common::FilterPath>,
pub human: Option<bool>,
pub pretty: Option<bool>,
pub source: Option<String>,
}
#[async_trait]
impl SecurityApi for SecurityApiClient {
async fn get_dashboards_info(
&self,
params: GetDashboardsInfoParams,
) -> Result<GetDashboardsInfoSuccess, Error> {
let GetDashboardsInfoParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/dashboardsinfo",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<GetDashboardsInfoSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_distinguished_name(
&self,
params: PatchDistinguishedNameParams,
) -> Result<PatchDistinguishedNameSuccess, Error>
{
let PatchDistinguishedNameParams {
cluster_name,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/nodesdn/{cluster_name}",
local_var_configuration.base_path,
cluster_name = cluster_name
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchDistinguishedNameSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn update_distinguished_name(
&self,
params: UpdateDistinguishedNameParams,
) -> Result<UpdateDistinguishedNameSuccess, Error>
{
let UpdateDistinguishedNameParams {
update_distinguished_name,
cluster_name,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/nodesdn/{cluster_name}",
local_var_configuration.base_path,
cluster_name = cluster_name
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&update_distinguished_name);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<UpdateDistinguishedNameSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn authinfo(
&self,
params: AuthinfoParams,
) -> Result<AuthinfoSuccess, Error> {
let AuthinfoParams {
auth_type,
error_trace,
filter_path,
human,
pretty,
source,
verbose,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/authinfo",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = verbose {
local_var_req_builder =
local_var_req_builder.query(&[("verbose", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = auth_type {
local_var_req_builder =
local_var_req_builder.query(&[("auth_type", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<AuthinfoSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_tenant(
&self,
params: PatchTenantParams,
) -> Result<PatchTenantSuccess, Error> {
let PatchTenantParams {
error_trace,
filter_path,
human,
pretty,
source,
tenant,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/tenants/{tenant}",
local_var_configuration.base_path,
tenant = tenant
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchTenantSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_action_group(
&self,
params: GetActionGroupParams,
) -> Result<crate::security::ActionGroupsMap, Error> {
let GetActionGroupParams {
action_group,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/actiongroups/{action_group}",
local_var_configuration.base_path,
action_group = action_group
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_account_details(
&self,
params: GetAccountDetailsParams,
) -> Result<crate::security::AccountDetails, Error> {
let GetAccountDetailsParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/account",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn post_dashboards_info(
&self,
params: PostDashboardsInfoParams,
) -> Result<PostDashboardsInfoSuccess, Error> {
let PostDashboardsInfoParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/dashboardsinfo",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PostDashboardsInfoSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_audit_configuration(
&self,
params: PatchAuditConfigurationParams,
) -> Result<crate::security::Ok, Error> {
let PatchAuditConfigurationParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/audit",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_role_mapping(
&self,
params: PatchRoleMappingParams,
) -> Result<PatchRoleMappingSuccess, Error> {
let PatchRoleMappingParams {
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/rolesmapping/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchRoleMappingSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn create_role_mapping(
&self,
params: CreateRoleMappingParams,
) -> Result<CreateRoleMappingSuccess, Error> {
let CreateRoleMappingParams {
create_role_mapping,
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/rolesmapping/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&create_role_mapping);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<CreateRoleMappingSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_role_mapping(
&self,
params: GetRoleMappingParams,
) -> Result<crate::security::RoleMappings, Error> {
let GetRoleMappingParams {
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/rolesmapping/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_role_mappings(
&self,
params: GetRoleMappingsParams,
) -> Result<crate::security::RoleMappings, Error> {
let GetRoleMappingsParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/rolesmapping",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_action_group(
&self,
params: PatchActionGroupParams,
) -> Result<crate::security::Ok, Error> {
let PatchActionGroupParams {
action_group,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/actiongroups/{action_group}",
local_var_configuration.base_path,
action_group = action_group
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_distinguished_name(
&self,
params: GetDistinguishedNameParams,
) -> Result<GetDistinguishedNameSuccess, Error>
{
let GetDistinguishedNameParams {
cluster_name,
error_trace,
filter_path,
human,
pretty,
show_all,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/nodesdn/{cluster_name}",
local_var_configuration.base_path,
cluster_name = cluster_name
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = show_all {
local_var_req_builder =
local_var_req_builder.query(&[("show_all", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<GetDistinguishedNameSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_users(
&self,
params: GetUsersParams,
) -> Result<crate::security::UsersMap, Error> {
let GetUsersParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/internalusers",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_role_mappings(
&self,
params: PatchRoleMappingsParams,
) -> Result<PatchRoleMappingsSuccess, Error> {
let PatchRoleMappingsParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/rolesmapping",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchRoleMappingsSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn create_user(
&self,
params: CreateUserParams,
) -> Result<CreateUserSuccess, Error> {
let CreateUserParams {
create_user,
error_trace,
filter_path,
human,
pretty,
source,
username,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/internalusers/{username}",
local_var_configuration.base_path,
username = username
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&create_user);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<CreateUserSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn migrate(
&self,
params: MigrateParams,
) -> Result<MigrateSuccess, Error> {
let MigrateParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/migrate",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<MigrateSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn delete_user_legacy(
&self,
params: DeleteUserLegacyParams,
) -> Result<crate::security::Ok, Error> {
let DeleteUserLegacyParams {
error_trace,
filter_path,
human,
pretty,
source,
username,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/user/{username}",
local_var_configuration.base_path,
username = username
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_action_groups(
&self,
params: GetActionGroupsParams,
) -> Result<crate::security::ActionGroupsMap, Error> {
let GetActionGroupsParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/actiongroups",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_users(
&self,
params: PatchUsersParams,
) -> Result<crate::security::Ok, Error> {
let PatchUsersParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/internalusers",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_user_legacy(
&self,
params: GetUserLegacyParams,
) -> Result<crate::security::UsersMap, Error> {
let GetUserLegacyParams {
error_trace,
filter_path,
human,
pretty,
source,
username,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/user/{username}",
local_var_configuration.base_path,
username = username
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn delete_role_mapping(
&self,
params: DeleteRoleMappingParams,
) -> Result<crate::security::Ok, Error> {
let DeleteRoleMappingParams {
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/rolesmapping/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn delete_action_group(
&self,
params: DeleteActionGroupParams,
) -> Result<crate::security::Ok, Error> {
let DeleteActionGroupParams {
action_group,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/actiongroups/{action_group}",
local_var_configuration.base_path,
action_group = action_group
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_roles(
&self,
params: PatchRolesParams,
) -> Result<PatchRolesSuccess, Error> {
let PatchRolesParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/roles",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchRolesSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_audit_configuration(
&self,
params: GetAuditConfigurationParams,
) -> Result<crate::security::AuditConfigWithReadOnly, Error>
{
let GetAuditConfigurationParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/audit",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn delete_tenant(
&self,
params: DeleteTenantParams,
) -> Result<DeleteTenantSuccess, Error> {
let DeleteTenantParams {
error_trace,
filter_path,
human,
pretty,
source,
tenant,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/tenants/{tenant}",
local_var_configuration.base_path,
tenant = tenant
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<DeleteTenantSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn tenant_info(
&self,
params: TenantInfoParams,
) -> Result<TenantInfoSuccess, Error> {
let TenantInfoParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/tenantinfo",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<TenantInfoSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn delete_role(
&self,
params: DeleteRoleParams,
) -> Result<crate::security::Ok, Error> {
let DeleteRoleParams {
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/roles/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_certificates(
&self,
params: GetCertificatesParams,
) -> Result<GetCertificatesSuccess, Error> {
let GetCertificatesParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/ssl/certs",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<GetCertificatesSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn create_tenant(
&self,
params: CreateTenantParams,
) -> Result<CreateTenantSuccess, Error> {
let CreateTenantParams {
create_tenant,
error_trace,
filter_path,
human,
pretty,
source,
tenant,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/tenants/{tenant}",
local_var_configuration.base_path,
tenant = tenant
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&create_tenant);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<CreateTenantSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn validate(
&self,
params: ValidateParams,
) -> Result<ValidateSuccess, Error> {
let ValidateParams {
accept_invalid,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/validate",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = accept_invalid {
local_var_req_builder =
local_var_req_builder.query(&[("accept_invalid", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<ValidateSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_permissions_info(
&self,
params: GetPermissionsInfoParams,
) -> Result<GetPermissionsInfoSuccess, Error> {
let GetPermissionsInfoParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/permissionsinfo",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<GetPermissionsInfoSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn delete_distinguished_name(
&self,
params: DeleteDistinguishedNameParams,
) -> Result<DeleteDistinguishedNameSuccess, Error>
{
let DeleteDistinguishedNameParams {
cluster_name,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/nodesdn/{cluster_name}",
local_var_configuration.base_path,
cluster_name = cluster_name
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<DeleteDistinguishedNameSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn who_am_i(
&self,
params: WhoAmIParams,
) -> Result<WhoAmISuccess, Error> {
let WhoAmIParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/whoami",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<WhoAmISuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_distinguished_names(
&self,
params: PatchDistinguishedNamesParams,
) -> Result<PatchDistinguishedNamesSuccess, Error>
{
let PatchDistinguishedNamesParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/nodesdn",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchDistinguishedNamesSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_tenant(
&self,
params: GetTenantParams,
) -> Result<crate::security::TenantsMap, Error> {
let GetTenantParams {
error_trace,
filter_path,
human,
pretty,
source,
tenant,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/tenants/{tenant}",
local_var_configuration.base_path,
tenant = tenant
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn create_role(
&self,
params: CreateRoleParams,
) -> Result<CreateRoleSuccess, Error> {
let CreateRoleParams {
create_role,
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/roles/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&create_role);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<CreateRoleSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn delete_user(
&self,
params: DeleteUserParams,
) -> Result<crate::security::Ok, Error> {
let DeleteUserParams {
error_trace,
filter_path,
human,
pretty,
source,
username,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/internalusers/{username}",
local_var_configuration.base_path,
username = username
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_action_groups(
&self,
params: PatchActionGroupsParams,
) -> Result<crate::security::Ok, Error> {
let PatchActionGroupsParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/actiongroups",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_user(
&self,
params: GetUserParams,
) -> Result<crate::security::UsersMap, Error> {
let GetUserParams {
error_trace,
filter_path,
human,
pretty,
source,
username,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/internalusers/{username}",
local_var_configuration.base_path,
username = username
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_roles(
&self,
params: GetRolesParams,
) -> Result<crate::security::RolesMap, Error> {
let GetRolesParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/roles",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn flush_cache(
&self,
params: FlushCacheParams,
) -> Result<crate::security::Ok, Error> {
let FlushCacheParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/cache",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn create_user_legacy(
&self,
params: CreateUserLegacyParams,
) -> Result<CreateUserLegacySuccess, Error> {
let CreateUserLegacyParams {
create_user_legacy,
error_trace,
filter_path,
human,
pretty,
source,
username,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/user/{username}",
local_var_configuration.base_path,
username = username
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&create_user_legacy);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<CreateUserLegacySuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_tenants(
&self,
params: PatchTenantsParams,
) -> Result<PatchTenantsSuccess, Error> {
let PatchTenantsParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/tenants",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchTenantsSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_role(
&self,
params: PatchRoleParams,
) -> Result<PatchRoleSuccess, Error> {
let PatchRoleParams {
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/roles/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<PatchRoleSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_role(
&self,
params: GetRoleParams,
) -> Result<crate::security::RolesMap, Error> {
let GetRoleParams {
error_trace,
filter_path,
human,
pretty,
role,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/roles/{role}",
local_var_configuration.base_path,
role = role
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_distinguished_names(
&self,
params: GetDistinguishedNamesParams,
) -> Result<GetDistinguishedNamesSuccess, Error>
{
let GetDistinguishedNamesParams {
error_trace,
filter_path,
human,
pretty,
show_all,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/nodesdn",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = show_all {
local_var_req_builder =
local_var_req_builder.query(&[("show_all", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<GetDistinguishedNamesSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn cache(
&self,
params: CacheParams,
) -> Result<crate::security::Error, Error> {
let CacheParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/cache",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn create_action_group(
&self,
params: CreateActionGroupParams,
) -> Result<CreateActionGroupSuccess, Error> {
let CreateActionGroupParams {
create_action_group,
action_group,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/actiongroups/{action_group}",
local_var_configuration.base_path,
action_group = action_group
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&create_action_group);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<CreateActionGroupSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn authtoken(
&self,
params: AuthtokenParams,
) -> Result<crate::security::Ok, Error> {
let AuthtokenParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/authtoken",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn update_audit_configuration(
&self,
params: UpdateAuditConfigurationParams,
) -> Result<crate::security::Ok, Error> {
let UpdateAuditConfigurationParams {
update_audit_configuration,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/audit/config",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&update_audit_configuration);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn health(
&self,
params: HealthParams,
) -> Result<crate::security::HealthInfo, Error> {
let HealthParams {
error_trace,
filter_path,
human,
mode,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/health",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_str) = mode {
local_var_req_builder =
local_var_req_builder.query(&[("mode", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_users_legacy(
&self,
params: GetUsersLegacyParams,
) -> Result<crate::security::UsersMap, Error> {
let GetUsersLegacyParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/user",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn patch_user(
&self,
params: PatchUserParams,
) -> Result<crate::security::Ok, Error> {
let PatchUserParams {
error_trace,
filter_path,
human,
pretty,
source,
username,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/internalusers/{username}",
local_var_configuration.base_path,
username = username
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn get_tenants(
&self,
params: GetTenantsParams,
) -> Result<GetTenantsSuccess, Error> {
let GetTenantsParams {
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/tenants",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<GetTenantsSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
async fn change_password(
&self,
params: ChangePasswordParams,
) -> Result<ChangePasswordSuccess, Error> {
let ChangePasswordParams {
change_password,
error_trace,
filter_path,
human,
pretty,
source,
} = params;
let local_var_configuration = &self.configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!(
"{}_plugins/_security/api/account",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_str) = filter_path {
local_var_req_builder =
local_var_req_builder.query(&[("filter_path", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = error_trace {
local_var_req_builder =
local_var_req_builder.query(&[("error_trace", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = human {
local_var_req_builder =
local_var_req_builder.query(&[("human", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = pretty {
local_var_req_builder =
local_var_req_builder.query(&[("pretty", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = source {
local_var_req_builder =
local_var_req_builder.query(&[("source", &local_var_str.to_string())]);
}
local_var_req_builder = local_var_req_builder.json(&change_password);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
let local_var_entity: Option<ChangePasswordSuccess> =
serde_json::from_str(&local_var_content).ok();
let local_var_result = ResponseContent {
status: local_var_status,
content: local_var_content,
entity: local_var_entity,
};
Ok(local_var_result)
} else {
let local_var_error = ResponseContent {
status: local_var_status,
content: local_var_content,
};
Err(Error::ApiError(local_var_error))
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDashboardsInfoError {
DefaultResponse(crate::security::DashboardsInfo),
Status500(crate::security::InternalServerError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchDistinguishedNameError {
Status400(crate::security::Error),
Status403(crate::security::Error),
DefaultResponse(crate::security::Ok),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UpdateDistinguishedNameError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
Status403(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AuthinfoError {
Status500(crate::security::InternalServerError),
DefaultResponse(crate::security::AuthInfo),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchTenantError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PostDashboardsInfoError {
Status500(crate::security::InternalServerError),
DefaultResponse(crate::security::DashboardsInfo),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchRoleMappingError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDistinguishedNameError {
Status400(crate::security::Error),
Status403(crate::security::Error),
DefaultResponse(crate::security::DistinguishedNamesMap),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchRoleMappingsError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum MigrateError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchRolesError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteTenantError {
Status400(crate::security::Error),
DefaultResponse(crate::security::Ok),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum TenantInfoError {
DefaultResponse(crate::security::TenantInfo),
Status403(String),
Status500(crate::security::InternalServerError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetCertificatesError {
Status403(crate::security::Error),
DefaultResponse(crate::security::GetCertificates),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CreateTenantError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ValidateError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetPermissionsInfoError {
DefaultResponse(crate::security::PermissionsInfo),
Status500(crate::security::InternalServerError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeleteDistinguishedNameError {
Status403(crate::security::Error),
Status400(crate::security::Error),
DefaultResponse(crate::security::Ok),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum WhoAmIError {
DefaultResponse(crate::security::WhoAmI),
Status500(crate::security::InternalServerError),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchDistinguishedNamesError {
Status403(crate::security::Error),
Status400(crate::security::Error),
DefaultResponse(crate::security::Ok),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchTenantsError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum PatchRoleError {
DefaultResponse(crate::security::Ok),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetDistinguishedNamesError {
DefaultResponse(crate::security::DistinguishedNamesMap),
Status403(crate::security::Error),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum CacheError {
Status501(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetTenantsError {
DefaultResponse(crate::security::TenantsMap),
Status400(crate::security::Error),
UnknownValue(serde_json::Value),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ChangePasswordError {
DefaultResponse(crate::security::Ok),
Status403(crate::security::Error),
UnknownValue(serde_json::Value),
}