Skip to content

Commit ce8b1f9

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 263619f of spec repo
1 parent c7a82a3 commit ce8b1f9

File tree

81 files changed

+6758
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+6758
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 739 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Grant role to a restriction query returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
4+
use datadog_api_client::datadogV2::model::RelationshipToRole;
5+
use datadog_api_client::datadogV2::model::RelationshipToRoleData;
6+
use datadog_api_client::datadogV2::model::RolesType;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
// there is a valid "restriction_query" in the system
11+
let restriction_query_data_id = std::env::var("RESTRICTION_QUERY_DATA_ID").unwrap();
12+
13+
// there is a valid "role" in the system
14+
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
15+
let body = RelationshipToRole::new().data(
16+
RelationshipToRoleData::new()
17+
.id(role_data_id.clone())
18+
.type_(RolesType::ROLES),
19+
);
20+
let mut configuration = datadog::Configuration::new();
21+
configuration.set_unstable_operation_enabled("v2.AddRoleToRestrictionQuery", true);
22+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
23+
let resp = api
24+
.add_role_to_restriction_query(restriction_query_data_id.clone(), body)
25+
.await;
26+
if let Ok(value) = resp {
27+
println!("{:#?}", value);
28+
} else {
29+
println!("{:#?}", resp.unwrap_err());
30+
}
31+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Create a restriction query returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
4+
use datadog_api_client::datadogV2::model::LogsRestrictionQueriesType;
5+
use datadog_api_client::datadogV2::model::RestrictionQueryCreateAttributes;
6+
use datadog_api_client::datadogV2::model::RestrictionQueryCreateData;
7+
use datadog_api_client::datadogV2::model::RestrictionQueryCreatePayload;
8+
9+
#[tokio::main]
10+
async fn main() {
11+
let body = RestrictionQueryCreatePayload::new().data(
12+
RestrictionQueryCreateData::new()
13+
.attributes(RestrictionQueryCreateAttributes::new(
14+
"env:sandbox".to_string(),
15+
))
16+
.type_(LogsRestrictionQueriesType::LOGS_RESTRICTION_QUERIES),
17+
);
18+
let mut configuration = datadog::Configuration::new();
19+
configuration.set_unstable_operation_enabled("v2.CreateRestrictionQuery", true);
20+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
21+
let resp = api.create_restriction_query(body).await;
22+
if let Ok(value) = resp {
23+
println!("{:#?}", value);
24+
} else {
25+
println!("{:#?}", resp.unwrap_err());
26+
}
27+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Delete a restriction query returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "restriction_query" in the system
8+
let restriction_query_data_id = std::env::var("RESTRICTION_QUERY_DATA_ID").unwrap();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.DeleteRestrictionQuery", true);
11+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
12+
let resp = api
13+
.delete_restriction_query(restriction_query_data_id.clone())
14+
.await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Get a restriction query returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "restriction_query" in the system
8+
let restriction_query_data_id = std::env::var("RESTRICTION_QUERY_DATA_ID").unwrap();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.GetRestrictionQuery", true);
11+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
12+
let resp = api
13+
.get_restriction_query(restriction_query_data_id.clone())
14+
.await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Get restriction query for a given role returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "role" in the system
8+
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.GetRoleRestrictionQuery", true);
11+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
12+
let resp = api.get_role_restriction_query(role_data_id.clone()).await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// List restriction queries returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::ListRestrictionQueriesOptionalParams;
4+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.ListRestrictionQueries", true);
10+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
11+
let resp = api
12+
.list_restriction_queries(ListRestrictionQueriesOptionalParams::default())
13+
.await;
14+
if let Ok(value) = resp {
15+
println!("{:#?}", value);
16+
} else {
17+
println!("{:#?}", resp.unwrap_err());
18+
}
19+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// List roles for a restriction query returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::ListRestrictionQueryRolesOptionalParams;
4+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "restriction_query" in the system
9+
let restriction_query_data_id = std::env::var("RESTRICTION_QUERY_DATA_ID").unwrap();
10+
let mut configuration = datadog::Configuration::new();
11+
configuration.set_unstable_operation_enabled("v2.ListRestrictionQueryRoles", true);
12+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
13+
let resp = api
14+
.list_restriction_query_roles(
15+
restriction_query_data_id.clone(),
16+
ListRestrictionQueryRolesOptionalParams::default(),
17+
)
18+
.await;
19+
if let Ok(value) = resp {
20+
println!("{:#?}", value);
21+
} else {
22+
println!("{:#?}", resp.unwrap_err());
23+
}
24+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Get all restriction queries for a given user returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "user" in the system
8+
let user_data_id = std::env::var("USER_DATA_ID").unwrap();
9+
let mut configuration = datadog::Configuration::new();
10+
configuration.set_unstable_operation_enabled("v2.ListUserRestrictionQueries", true);
11+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
12+
let resp = api
13+
.list_user_restriction_queries(user_data_id.clone())
14+
.await;
15+
if let Ok(value) = resp {
16+
println!("{:#?}", value);
17+
} else {
18+
println!("{:#?}", resp.unwrap_err());
19+
}
20+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Revoke role from a restriction query returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_logs_restriction_queries::LogsRestrictionQueriesAPI;
4+
use datadog_api_client::datadogV2::model::RelationshipToRole;
5+
use datadog_api_client::datadogV2::model::RelationshipToRoleData;
6+
use datadog_api_client::datadogV2::model::RolesType;
7+
8+
#[tokio::main]
9+
async fn main() {
10+
// there is a valid "restriction_query" in the system
11+
let restriction_query_data_id = std::env::var("RESTRICTION_QUERY_DATA_ID").unwrap();
12+
13+
// there is a valid "role" in the system
14+
let role_data_id = std::env::var("ROLE_DATA_ID").unwrap();
15+
let body = RelationshipToRole::new().data(
16+
RelationshipToRoleData::new()
17+
.id(role_data_id.clone())
18+
.type_(RolesType::ROLES),
19+
);
20+
let mut configuration = datadog::Configuration::new();
21+
configuration.set_unstable_operation_enabled("v2.RemoveRoleFromRestrictionQuery", true);
22+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
23+
let resp = api
24+
.remove_role_from_restriction_query(restriction_query_data_id.clone(), body)
25+
.await;
26+
if let Ok(value) = resp {
27+
println!("{:#?}", value);
28+
} else {
29+
println!("{:#?}", resp.unwrap_err());
30+
}
31+
}

0 commit comments

Comments
 (0)