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
702 changes: 702 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions examples/v2_events_CreateEventEmailAddress.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Create an event email address returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;
use datadog_api_client::datadogV2::model::EventEmailAddressAlertType;
use datadog_api_client::datadogV2::model::EventEmailAddressCreateAttributes;
use datadog_api_client::datadogV2::model::EventEmailAddressCreateData;
use datadog_api_client::datadogV2::model::EventEmailAddressCreateRequest;
use datadog_api_client::datadogV2::model::EventEmailAddressFormat;
use datadog_api_client::datadogV2::model::EventEmailAddressResourceType;

#[tokio::main]
async fn main() {
let body = EventEmailAddressCreateRequest::new(EventEmailAddressCreateData::new(
EventEmailAddressCreateAttributes::new(EventEmailAddressFormat::JSON)
.alert_type(EventEmailAddressAlertType::INFO)
.description("Email address for production alerts.".to_string())
.notify_handles(vec!["@slack-my-channel".to_string()])
.tags(vec![
"env:production".to_string(),
"team:my-team".to_string(),
]),
EventEmailAddressResourceType::EVENT_EMAILS,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateEventEmailAddress", true);
let api = EventsAPI::with_config(configuration);
let resp = api.create_event_email_address(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
35 changes: 35 additions & 0 deletions examples/v2_events_CreateOnCallEventEmailAddress.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Create an on-call event email address returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;
use datadog_api_client::datadogV2::model::EventEmailAddressAlertType;
use datadog_api_client::datadogV2::model::EventEmailAddressFormat;
use datadog_api_client::datadogV2::model::EventEmailAddressResourceType;
use datadog_api_client::datadogV2::model::OnCallEventEmailAddressCreateAttributes;
use datadog_api_client::datadogV2::model::OnCallEventEmailAddressCreateData;
use datadog_api_client::datadogV2::model::OnCallEventEmailAddressCreateRequest;

#[tokio::main]
async fn main() {
let body = OnCallEventEmailAddressCreateRequest::new(OnCallEventEmailAddressCreateData::new(
OnCallEventEmailAddressCreateAttributes::new(
EventEmailAddressFormat::JSON,
"my-team".to_string(),
)
.alert_type(EventEmailAddressAlertType::INFO)
.description("On-call email address for my team.".to_string())
.tags(vec![
"env:production".to_string(),
"team:my-team".to_string(),
]),
EventEmailAddressResourceType::EVENT_EMAILS,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateOnCallEventEmailAddress", true);
let api = EventsAPI::with_config(configuration);
let resp = api.create_on_call_event_email_address(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_events_DeleteEventEmailAddress.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Revoke an event email address returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteEventEmailAddress", true);
let api = EventsAPI::with_config(configuration);
let resp = api
.delete_event_email_address(
Uuid::parse_str("00000000-0000-0000-0000-000000000001").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_events_DeleteOnCallEventEmailAddress.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Revoke an on-call event email address returns "No Content" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteOnCallEventEmailAddress", true);
let api = EventsAPI::with_config(configuration);
let resp = api
.delete_on_call_event_email_address(
Uuid::parse_str("00000000-0000-0000-0000-000000000001").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_events_GetEventEmailAddress.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Get an event email address returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetEventEmailAddress", true);
let api = EventsAPI::with_config(configuration);
let resp = api
.get_event_email_address(
Uuid::parse_str("00000000-0000-0000-0000-000000000001").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
19 changes: 19 additions & 0 deletions examples/v2_events_ListEventEmailAddresses.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// List event email addresses returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;
use datadog_api_client::datadogV2::api_events::ListEventEmailAddressesOptionalParams;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListEventEmailAddresses", true);
let api = EventsAPI::with_config(configuration);
let resp = api
.list_event_email_addresses(ListEventEmailAddressesOptionalParams::default())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
18 changes: 18 additions & 0 deletions examples/v2_events_ListOnCallEventEmailAddresses.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// List on-call event email addresses returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListOnCallEventEmailAddresses", true);
let api = EventsAPI::with_config(configuration);
let resp = api
.list_on_call_event_email_addresses("my-team".to_string())
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
36 changes: 36 additions & 0 deletions examples/v2_events_UpdateEventEmailAddress.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Update an event email address returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_events::EventsAPI;
use datadog_api_client::datadogV2::model::EventEmailAddressAlertType;
use datadog_api_client::datadogV2::model::EventEmailAddressResourceType;
use datadog_api_client::datadogV2::model::EventEmailAddressUpdateAttributes;
use datadog_api_client::datadogV2::model::EventEmailAddressUpdateData;
use datadog_api_client::datadogV2::model::EventEmailAddressUpdateRequest;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let body = EventEmailAddressUpdateRequest::new(EventEmailAddressUpdateData::new(
EventEmailAddressUpdateAttributes::new(
EventEmailAddressAlertType::INFO,
Some("Updated description for the email address.".to_string()),
vec!["@slack-my-channel".to_string()],
vec!["env:production".to_string(), "team:my-team".to_string()],
),
EventEmailAddressResourceType::EVENT_EMAILS,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateEventEmailAddress", true);
let api = EventsAPI::with_config(configuration);
let resp = api
.update_event_email_address(
Uuid::parse_str("00000000-0000-0000-0000-000000000001").expect("invalid UUID"),
body,
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
8 changes: 8 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ impl Default for Configuration {
("v2.get_deployment_rule".to_owned(), false),
("v2.update_deployment_gate".to_owned(), false),
("v2.update_deployment_rule".to_owned(), false),
("v2.create_event_email_address".to_owned(), false),
("v2.create_on_call_event_email_address".to_owned(), false),
("v2.delete_event_email_address".to_owned(), false),
("v2.delete_on_call_event_email_address".to_owned(), false),
("v2.get_event_email_address".to_owned(), false),
("v2.list_event_email_addresses".to_owned(), false),
("v2.list_on_call_event_email_addresses".to_owned(), false),
("v2.update_event_email_address".to_owned(), false),
("v2.create_hamr_org_connection".to_owned(), false),
("v2.get_hamr_org_connection".to_owned(), false),
("v2.create_global_incident_handle".to_owned(), false),
Expand Down
Loading