Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
440 changes: 440 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions examples/v2_synthetics_CreateSyntheticsSuite.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Synthetics: Create a test suite returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
use datadog_api_client::datadogV2::model::SuiteCreateEdit;
use datadog_api_client::datadogV2::model::SuiteCreateEditRequest;
use datadog_api_client::datadogV2::model::SyntheticsSuite;
use datadog_api_client::datadogV2::model::SyntheticsSuiteOptions;
use datadog_api_client::datadogV2::model::SyntheticsSuiteType;

#[tokio::main]
async fn main() {
let body = SuiteCreateEditRequest::new(SuiteCreateEdit::new(
SyntheticsSuite::new(
"Notification message".to_string(),
"Example suite name".to_string(),
SyntheticsSuiteOptions::new(),
vec![],
SyntheticsSuiteType::SUITE,
)
.tags(vec!["env:production".to_string()]),
SyntheticsSuiteType::SUITE,
));
let configuration = datadog::Configuration::new();
let api = SyntheticsAPI::with_config(configuration);
let resp = api.create_synthetics_suite(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
25 changes: 25 additions & 0 deletions examples/v2_synthetics_DeleteSyntheticsSuites.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Synthetics: Bulk delete suites returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
use datadog_api_client::datadogV2::model::DeletedSuitesRequestDelete;
use datadog_api_client::datadogV2::model::DeletedSuitesRequestDeleteAttributes;
use datadog_api_client::datadogV2::model::DeletedSuitesRequestDeleteRequest;
use datadog_api_client::datadogV2::model::DeletedSuitesRequestType;

#[tokio::main]
async fn main() {
let body = DeletedSuitesRequestDeleteRequest::new(
DeletedSuitesRequestDelete::new(DeletedSuitesRequestDeleteAttributes::new(vec![
"".to_string()
]))
.type_(DeletedSuitesRequestType::DELETE_SUITES_REQUEST),
);
let configuration = datadog::Configuration::new();
let api = SyntheticsAPI::with_config(configuration);
let resp = api.delete_synthetics_suites(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
36 changes: 36 additions & 0 deletions examples/v2_synthetics_EditSyntheticsSuite.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Synthetics: edit a test suite returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;
use datadog_api_client::datadogV2::model::SuiteCreateEdit;
use datadog_api_client::datadogV2::model::SuiteCreateEditRequest;
use datadog_api_client::datadogV2::model::SyntheticsSuite;
use datadog_api_client::datadogV2::model::SyntheticsSuiteOptions;
use datadog_api_client::datadogV2::model::SyntheticsSuiteTest;
use datadog_api_client::datadogV2::model::SyntheticsSuiteTestAlertingCriticality;
use datadog_api_client::datadogV2::model::SyntheticsSuiteType;

#[tokio::main]
async fn main() {
let body = SuiteCreateEditRequest::new(SuiteCreateEdit::new(
SyntheticsSuite::new(
"Notification message".to_string(),
"Example suite name".to_string(),
SyntheticsSuiteOptions::new(),
vec![SyntheticsSuiteTest::new("".to_string())
.alerting_criticality(SyntheticsSuiteTestAlertingCriticality::CRITICAL)],
SyntheticsSuiteType::SUITE,
)
.tags(vec!["env:production".to_string()]),
SyntheticsSuiteType::SUITE,
));
let configuration = datadog::Configuration::new();
let api = SyntheticsAPI::with_config(configuration);
let resp = api
.edit_synthetics_suite("public_id".to_string(), body)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
15 changes: 15 additions & 0 deletions examples/v2_synthetics_GetSyntheticsSuite.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Synthetics: Get a suite returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = SyntheticsAPI::with_config(configuration);
let resp = api.get_synthetics_suite("public_id".to_string()).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
18 changes: 18 additions & 0 deletions examples/v2_synthetics_SearchSuites.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Search Synthetics suites returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_synthetics::SearchSuitesOptionalParams;
use datadog_api_client::datadogV2::api_synthetics::SyntheticsAPI;

#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = SyntheticsAPI::with_config(configuration);
let resp = api
.search_suites(SearchSuitesOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Loading
Loading