Skip to content

Commit f4f7f2d

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 24951f7 of spec repo
1 parent 539aaff commit f4f7f2d

File tree

160 files changed

+21398
-0
lines changed

Some content is hidden

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

160 files changed

+21398
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 2158 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Create component returns "Created" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::CreateComponentOptionalParams;
4+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
5+
use datadog_api_client::datadogV2::model::CreateComponentRequest;
6+
use datadog_api_client::datadogV2::model::CreateComponentRequestData;
7+
use datadog_api_client::datadogV2::model::CreateComponentRequestDataAttributes;
8+
use datadog_api_client::datadogV2::model::CreateComponentRequestDataAttributesType;
9+
use datadog_api_client::datadogV2::model::StatusPagesComponentGroupType;
10+
11+
#[tokio::main]
12+
async fn main() {
13+
// there is a valid "status_page" in the system
14+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
15+
.expect("Invalid UUID");
16+
let body = CreateComponentRequest::new().data(
17+
CreateComponentRequestData::new(StatusPagesComponentGroupType::COMPONENTS).attributes(
18+
CreateComponentRequestDataAttributes::new(
19+
"5e2fd69be33e79aa".to_string(),
20+
0,
21+
CreateComponentRequestDataAttributesType::COMPONENT,
22+
),
23+
),
24+
);
25+
let configuration = datadog::Configuration::new();
26+
let api = StatusPagesAPI::with_config(configuration);
27+
let resp = api
28+
.create_component(
29+
status_page_data_id.clone(),
30+
body,
31+
CreateComponentOptionalParams::default(),
32+
)
33+
.await;
34+
if let Ok(value) = resp {
35+
println!("{:#?}", value);
36+
} else {
37+
println!("{:#?}", resp.unwrap_err());
38+
}
39+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Create degradation returns "Created" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::CreateDegradationOptionalParams;
4+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
5+
use datadog_api_client::datadogV2::model::CreateDegradationRequest;
6+
use datadog_api_client::datadogV2::model::CreateDegradationRequestData;
7+
use datadog_api_client::datadogV2::model::CreateDegradationRequestDataAttributes;
8+
use datadog_api_client::datadogV2::model::CreateDegradationRequestDataAttributesComponentsAffectedItems;
9+
use datadog_api_client::datadogV2::model::CreateDegradationRequestDataAttributesStatus;
10+
use datadog_api_client::datadogV2::model::PatchDegradationRequestDataType;
11+
use datadog_api_client::datadogV2::model::StatusPagesComponentDataAttributesStatus;
12+
13+
#[tokio::main]
14+
async fn main() {
15+
// there is a valid "status_page" in the system
16+
let status_page_data_attributes_components_0_id = uuid::Uuid::parse_str(
17+
&std::env::var("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID").unwrap(),
18+
)
19+
.expect("Invalid UUID");
20+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
21+
.expect("Invalid UUID");
22+
let body = CreateDegradationRequest::new().data(
23+
CreateDegradationRequestData::new(PatchDegradationRequestDataType::DEGRADATIONS)
24+
.attributes(
25+
CreateDegradationRequestDataAttributes::new(
26+
vec![
27+
CreateDegradationRequestDataAttributesComponentsAffectedItems::new(
28+
status_page_data_attributes_components_0_id.clone(),
29+
StatusPagesComponentDataAttributesStatus::MAJOR_OUTAGE,
30+
),
31+
],
32+
CreateDegradationRequestDataAttributesStatus::INVESTIGATING,
33+
"5e2fd69be33e79aa".to_string(),
34+
)
35+
.description("5e2fd69be33e79aa".to_string()),
36+
),
37+
);
38+
let configuration = datadog::Configuration::new();
39+
let api = StatusPagesAPI::with_config(configuration);
40+
let resp = api
41+
.create_degradation(
42+
status_page_data_id.clone(),
43+
body,
44+
CreateDegradationOptionalParams::default(),
45+
)
46+
.await;
47+
if let Ok(value) = resp {
48+
println!("{:#?}", value);
49+
} else {
50+
println!("{:#?}", resp.unwrap_err());
51+
}
52+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Create status page returns "Created" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::CreateStatusPageOptionalParams;
4+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
5+
use datadog_api_client::datadogV2::model::CreateStatusPageRequest;
6+
use datadog_api_client::datadogV2::model::CreateStatusPageRequestData;
7+
use datadog_api_client::datadogV2::model::CreateStatusPageRequestDataAttributes;
8+
use datadog_api_client::datadogV2::model::CreateStatusPageRequestDataAttributesType;
9+
use datadog_api_client::datadogV2::model::CreateStatusPageRequestDataAttributesVisualizationType;
10+
use datadog_api_client::datadogV2::model::StatusPageDataType;
11+
12+
#[tokio::main]
13+
async fn main() {
14+
let body = CreateStatusPageRequest::new().data(
15+
CreateStatusPageRequestData::new(StatusPageDataType::STATUS_PAGES).attributes(
16+
CreateStatusPageRequestDataAttributes::new(
17+
"dd-integrations-tests-5e2fd69be33e79aa".to_string(),
18+
true,
19+
"[DD Integration Tests] 5e2fd69be33e79aa".to_string(),
20+
CreateStatusPageRequestDataAttributesType::INTERNAL,
21+
CreateStatusPageRequestDataAttributesVisualizationType::BARS_AND_UPTIME_PERCENTAGE,
22+
),
23+
),
24+
);
25+
let configuration = datadog::Configuration::new();
26+
let api = StatusPagesAPI::with_config(configuration);
27+
let resp = api
28+
.create_status_page(body, CreateStatusPageOptionalParams::default())
29+
.await;
30+
if let Ok(value) = resp {
31+
println!("{:#?}", value);
32+
} else {
33+
println!("{:#?}", resp.unwrap_err());
34+
}
35+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Delete component returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "status_page" in the system
8+
let status_page_data_attributes_components_0_id = uuid::Uuid::parse_str(
9+
&std::env::var("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID").unwrap(),
10+
)
11+
.expect("Invalid UUID");
12+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
13+
.expect("Invalid UUID");
14+
let configuration = datadog::Configuration::new();
15+
let api = StatusPagesAPI::with_config(configuration);
16+
let resp = api
17+
.delete_component(
18+
status_page_data_id.clone(),
19+
status_page_data_attributes_components_0_id.clone(),
20+
)
21+
.await;
22+
if let Ok(value) = resp {
23+
println!("{:#?}", value);
24+
} else {
25+
println!("{:#?}", resp.unwrap_err());
26+
}
27+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Delete degradation returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "status_page" in the system
8+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
9+
.expect("Invalid UUID");
10+
11+
// there is a valid "degradation" in the system
12+
let degradation_data_id = uuid::Uuid::parse_str(&std::env::var("DEGRADATION_DATA_ID").unwrap())
13+
.expect("Invalid UUID");
14+
let configuration = datadog::Configuration::new();
15+
let api = StatusPagesAPI::with_config(configuration);
16+
let resp = api
17+
.delete_degradation(status_page_data_id.clone(), degradation_data_id.clone())
18+
.await;
19+
if let Ok(value) = resp {
20+
println!("{:#?}", value);
21+
} else {
22+
println!("{:#?}", resp.unwrap_err());
23+
}
24+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Delete status page returns "No Content" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
4+
5+
#[tokio::main]
6+
async fn main() {
7+
// there is a valid "status_page" in the system
8+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
9+
.expect("Invalid UUID");
10+
let configuration = datadog::Configuration::new();
11+
let api = StatusPagesAPI::with_config(configuration);
12+
let resp = api.delete_status_page(status_page_data_id.clone()).await;
13+
if let Ok(value) = resp {
14+
println!("{:#?}", value);
15+
} else {
16+
println!("{:#?}", resp.unwrap_err());
17+
}
18+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Get component returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::GetComponentOptionalParams;
4+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "status_page" in the system
9+
let status_page_data_attributes_components_0_id = uuid::Uuid::parse_str(
10+
&std::env::var("STATUS_PAGE_DATA_ATTRIBUTES_COMPONENTS_0_ID").unwrap(),
11+
)
12+
.expect("Invalid UUID");
13+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
14+
.expect("Invalid UUID");
15+
let configuration = datadog::Configuration::new();
16+
let api = StatusPagesAPI::with_config(configuration);
17+
let resp = api
18+
.get_component(
19+
status_page_data_id.clone(),
20+
status_page_data_attributes_components_0_id.clone(),
21+
GetComponentOptionalParams::default(),
22+
)
23+
.await;
24+
if let Ok(value) = resp {
25+
println!("{:#?}", value);
26+
} else {
27+
println!("{:#?}", resp.unwrap_err());
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Get degradation returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::GetDegradationOptionalParams;
4+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "status_page" in the system
9+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
10+
.expect("Invalid UUID");
11+
12+
// there is a valid "degradation" in the system
13+
let degradation_data_id = uuid::Uuid::parse_str(&std::env::var("DEGRADATION_DATA_ID").unwrap())
14+
.expect("Invalid UUID");
15+
let configuration = datadog::Configuration::new();
16+
let api = StatusPagesAPI::with_config(configuration);
17+
let resp = api
18+
.get_degradation(
19+
status_page_data_id.clone(),
20+
degradation_data_id.clone(),
21+
GetDegradationOptionalParams::default(),
22+
)
23+
.await;
24+
if let Ok(value) = resp {
25+
println!("{:#?}", value);
26+
} else {
27+
println!("{:#?}", resp.unwrap_err());
28+
}
29+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Get status page returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_status_pages::GetStatusPageOptionalParams;
4+
use datadog_api_client::datadogV2::api_status_pages::StatusPagesAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
// there is a valid "status_page" in the system
9+
let status_page_data_id = uuid::Uuid::parse_str(&std::env::var("STATUS_PAGE_DATA_ID").unwrap())
10+
.expect("Invalid UUID");
11+
let configuration = datadog::Configuration::new();
12+
let api = StatusPagesAPI::with_config(configuration);
13+
let resp = api
14+
.get_status_page(
15+
status_page_data_id.clone(),
16+
GetStatusPageOptionalParams::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)