v2_logs_archives_RemoveRoleFromArchive/
v2_logs-archives_RemoveRoleFromArchive.rs

1// Revoke role from an archive returns "OK" response
2use datadog_api_client::datadog;
3use datadog_api_client::datadogV2::api_logs_archives::LogsArchivesAPI;
4use datadog_api_client::datadogV2::model::RelationshipToRole;
5use datadog_api_client::datadogV2::model::RelationshipToRoleData;
6use datadog_api_client::datadogV2::model::RolesType;
7
8#[tokio::main]
9async fn main() {
10    let body = RelationshipToRole::new().data(
11        RelationshipToRoleData::new()
12            .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13            .type_(RolesType::ROLES),
14    );
15    let configuration = datadog::Configuration::new();
16    let api = LogsArchivesAPI::with_config(configuration);
17    let resp = api
18        .remove_role_from_archive("archive_id".to_string(), body)
19        .await;
20    if let Ok(value) = resp {
21        println!("{:#?}", value);
22    } else {
23        println!("{:#?}", resp.unwrap_err());
24    }
25}