pub struct AuthNMappingsAPI { /* private fields */ }Expand description
The AuthN Mappings API is used to automatically map groups of users to roles in Datadog using attributes sent from Identity Providers. Use these endpoints to manage your AuthN Mappings.
Implementations§
source§impl AuthNMappingsAPI
impl AuthNMappingsAPI
pub fn new() -> Self
sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
examples/v2_authn-mappings_ListAuthNMappings.rs (line 9)
7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api
.list_authn_mappings(ListAuthNMappingsOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}More examples
examples/v2_authn-mappings_GetAuthNMapping.rs (line 10)
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "authn_mapping" in the system
let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api.get_authn_mapping(authn_mapping_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}examples/v2_authn-mappings_DeleteAuthNMapping.rs (line 10)
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "authn_mapping" in the system
let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api
.delete_authn_mapping(authn_mapping_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}examples/v2_authn-mappings_CreateAuthNMapping.rs (line 38)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
async fn main() {
// there is a valid "role" in the system
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
let body = AuthNMappingCreateRequest::new(
AuthNMappingCreateData::new(AuthNMappingsType::AUTHN_MAPPINGS)
.attributes(
AuthNMappingCreateAttributes::new()
.attribute_key("exampleauthnmapping".to_string())
.attribute_value("Example-AuthN-Mapping".to_string()),
)
.relationships(
AuthNMappingCreateRelationships::AuthNMappingRelationshipToRole(Box::new(
AuthNMappingRelationshipToRole::new(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
),
),
)),
),
);
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api.create_authn_mapping(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}examples/v2_authn-mappings_UpdateAuthNMapping.rs (line 44)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
async fn main() {
// there is a valid "authn_mapping" in the system
let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
// there is a valid "role" in the system
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
let body = AuthNMappingUpdateRequest::new(
AuthNMappingUpdateData::new(
authn_mapping_data_id.clone(),
AuthNMappingsType::AUTHN_MAPPINGS,
)
.attributes(
AuthNMappingUpdateAttributes::new()
.attribute_key("member-of".to_string())
.attribute_value("Development".to_string()),
)
.relationships(
AuthNMappingUpdateRelationships::AuthNMappingRelationshipToRole(Box::new(
AuthNMappingRelationshipToRole::new(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
),
),
)),
),
);
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api
.update_authn_mapping(authn_mapping_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
sourcepub async fn create_authn_mapping(
&self,
body: AuthNMappingCreateRequest,
) -> Result<AuthNMappingResponse, Error<CreateAuthNMappingError>>
pub async fn create_authn_mapping( &self, body: AuthNMappingCreateRequest, ) -> Result<AuthNMappingResponse, Error<CreateAuthNMappingError>>
Create an AuthN Mapping.
Examples found in repository?
examples/v2_authn-mappings_CreateAuthNMapping.rs (line 39)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
async fn main() {
// there is a valid "role" in the system
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
let body = AuthNMappingCreateRequest::new(
AuthNMappingCreateData::new(AuthNMappingsType::AUTHN_MAPPINGS)
.attributes(
AuthNMappingCreateAttributes::new()
.attribute_key("exampleauthnmapping".to_string())
.attribute_value("Example-AuthN-Mapping".to_string()),
)
.relationships(
AuthNMappingCreateRelationships::AuthNMappingRelationshipToRole(Box::new(
AuthNMappingRelationshipToRole::new(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
),
),
)),
),
);
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api.create_authn_mapping(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn create_authn_mapping_with_http_info(
&self,
body: AuthNMappingCreateRequest,
) -> Result<ResponseContent<AuthNMappingResponse>, Error<CreateAuthNMappingError>>
pub async fn create_authn_mapping_with_http_info( &self, body: AuthNMappingCreateRequest, ) -> Result<ResponseContent<AuthNMappingResponse>, Error<CreateAuthNMappingError>>
Create an AuthN Mapping.
sourcepub async fn delete_authn_mapping(
&self,
authn_mapping_id: String,
) -> Result<(), Error<DeleteAuthNMappingError>>
pub async fn delete_authn_mapping( &self, authn_mapping_id: String, ) -> Result<(), Error<DeleteAuthNMappingError>>
Delete an AuthN Mapping specified by AuthN Mapping UUID.
Examples found in repository?
examples/v2_authn-mappings_DeleteAuthNMapping.rs (line 12)
6 7 8 9 10 11 12 13 14 15 16 17 18 19
async fn main() {
// there is a valid "authn_mapping" in the system
let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api
.delete_authn_mapping(authn_mapping_data_id.clone())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn delete_authn_mapping_with_http_info(
&self,
authn_mapping_id: String,
) -> Result<ResponseContent<()>, Error<DeleteAuthNMappingError>>
pub async fn delete_authn_mapping_with_http_info( &self, authn_mapping_id: String, ) -> Result<ResponseContent<()>, Error<DeleteAuthNMappingError>>
Delete an AuthN Mapping specified by AuthN Mapping UUID.
sourcepub async fn get_authn_mapping(
&self,
authn_mapping_id: String,
) -> Result<AuthNMappingResponse, Error<GetAuthNMappingError>>
pub async fn get_authn_mapping( &self, authn_mapping_id: String, ) -> Result<AuthNMappingResponse, Error<GetAuthNMappingError>>
Get an AuthN Mapping specified by the AuthN Mapping UUID.
Examples found in repository?
examples/v2_authn-mappings_GetAuthNMapping.rs (line 11)
6 7 8 9 10 11 12 13 14 15 16 17
async fn main() {
// there is a valid "authn_mapping" in the system
let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api.get_authn_mapping(authn_mapping_data_id.clone()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn get_authn_mapping_with_http_info(
&self,
authn_mapping_id: String,
) -> Result<ResponseContent<AuthNMappingResponse>, Error<GetAuthNMappingError>>
pub async fn get_authn_mapping_with_http_info( &self, authn_mapping_id: String, ) -> Result<ResponseContent<AuthNMappingResponse>, Error<GetAuthNMappingError>>
Get an AuthN Mapping specified by the AuthN Mapping UUID.
sourcepub async fn list_authn_mappings(
&self,
params: ListAuthNMappingsOptionalParams,
) -> Result<AuthNMappingsResponse, Error<ListAuthNMappingsError>>
pub async fn list_authn_mappings( &self, params: ListAuthNMappingsOptionalParams, ) -> Result<AuthNMappingsResponse, Error<ListAuthNMappingsError>>
List all AuthN Mappings in the org.
Examples found in repository?
examples/v2_authn-mappings_ListAuthNMappings.rs (line 11)
7 8 9 10 11 12 13 14 15 16 17 18
async fn main() {
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api
.list_authn_mappings(ListAuthNMappingsOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn list_authn_mappings_with_http_info(
&self,
params: ListAuthNMappingsOptionalParams,
) -> Result<ResponseContent<AuthNMappingsResponse>, Error<ListAuthNMappingsError>>
pub async fn list_authn_mappings_with_http_info( &self, params: ListAuthNMappingsOptionalParams, ) -> Result<ResponseContent<AuthNMappingsResponse>, Error<ListAuthNMappingsError>>
List all AuthN Mappings in the org.
sourcepub async fn update_authn_mapping(
&self,
authn_mapping_id: String,
body: AuthNMappingUpdateRequest,
) -> Result<AuthNMappingResponse, Error<UpdateAuthNMappingError>>
pub async fn update_authn_mapping( &self, authn_mapping_id: String, body: AuthNMappingUpdateRequest, ) -> Result<AuthNMappingResponse, Error<UpdateAuthNMappingError>>
Edit an AuthN Mapping.
Examples found in repository?
examples/v2_authn-mappings_UpdateAuthNMapping.rs (line 46)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
async fn main() {
// there is a valid "authn_mapping" in the system
let authn_mapping_data_id = std::env::var("AUTHN_MAPPING_DATA_ID").unwrap();
// there is a valid "role" in the system
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
let body = AuthNMappingUpdateRequest::new(
AuthNMappingUpdateData::new(
authn_mapping_data_id.clone(),
AuthNMappingsType::AUTHN_MAPPINGS,
)
.attributes(
AuthNMappingUpdateAttributes::new()
.attribute_key("member-of".to_string())
.attribute_value("Development".to_string()),
)
.relationships(
AuthNMappingUpdateRelationships::AuthNMappingRelationshipToRole(Box::new(
AuthNMappingRelationshipToRole::new(
RelationshipToRole::new().data(
RelationshipToRoleData::new()
.id(role_data_id.clone())
.type_(RolesType::ROLES),
),
),
)),
),
);
let configuration = datadog::Configuration::new();
let api = AuthNMappingsAPI::with_config(configuration);
let resp = api
.update_authn_mapping(authn_mapping_data_id.clone(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}sourcepub async fn update_authn_mapping_with_http_info(
&self,
authn_mapping_id: String,
body: AuthNMappingUpdateRequest,
) -> Result<ResponseContent<AuthNMappingResponse>, Error<UpdateAuthNMappingError>>
pub async fn update_authn_mapping_with_http_info( &self, authn_mapping_id: String, body: AuthNMappingUpdateRequest, ) -> Result<ResponseContent<AuthNMappingResponse>, Error<UpdateAuthNMappingError>>
Edit an AuthN Mapping.
Trait Implementations§
source§impl Clone for AuthNMappingsAPI
impl Clone for AuthNMappingsAPI
source§fn clone(&self) -> AuthNMappingsAPI
fn clone(&self) -> AuthNMappingsAPI
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for AuthNMappingsAPI
impl Debug for AuthNMappingsAPI
Auto Trait Implementations§
impl Freeze for AuthNMappingsAPI
impl !RefUnwindSafe for AuthNMappingsAPI
impl Send for AuthNMappingsAPI
impl Sync for AuthNMappingsAPI
impl Unpin for AuthNMappingsAPI
impl !UnwindSafe for AuthNMappingsAPI
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)