Skip to content

Commit da8edc6

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8c68959 of spec repo
1 parent 4660cb2 commit da8edc6

File tree

40 files changed

+5289
-2
lines changed

40 files changed

+5289
-2
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 647 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
let body = RelationshipToRole::new().data(
11+
RelationshipToRoleData::new()
12+
.id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d".to_string())
13+
.type_(RolesType::ROLES),
14+
);
15+
let mut configuration = datadog::Configuration::new();
16+
configuration.set_unstable_operation_enabled("v2.AddRoleToRestrictionQuery", true);
17+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
18+
let resp = api
19+
.add_role_to_restriction_query("restriction_query_id".to_string(), body)
20+
.await;
21+
if let Ok(value) = resp {
22+
println!("{:#?}", value);
23+
} else {
24+
println!("{:#?}", resp.unwrap_err());
25+
}
26+
}
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 "No Content" 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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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(
14+
RestrictionQueryCreateAttributes::new()
15+
.restriction_query("env:sandbox".to_string()),
16+
)
17+
.type_(LogsRestrictionQueriesType::LOGS_RESTRICTION_QUERIES),
18+
);
19+
let mut configuration = datadog::Configuration::new();
20+
configuration.set_unstable_operation_enabled("v2.CreateRestrictionQuery", true);
21+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
22+
let resp = api.create_restriction_query(body).await;
23+
if let Ok(value) = resp {
24+
println!("{:#?}", value);
25+
} else {
26+
println!("{:#?}", resp.unwrap_err());
27+
}
28+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
let mut configuration = datadog::Configuration::new();
8+
configuration.set_unstable_operation_enabled("v2.DeleteRestrictionQuery", true);
9+
let api = LogsRestrictionQueriesAPI::with_config(configuration);
10+
let resp = api
11+
.delete_restriction_query("restriction_query_id".to_string())
12+
.await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Delete a restriction query returns "No Content" 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+
}

0 commit comments

Comments
 (0)