Skip to content
Merged
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
767 changes: 767 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

41 changes: 41 additions & 0 deletions examples/v2_servicenow-integration_CreateServiceNowTemplate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Create ServiceNow template returns "Created" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;
use datadog_api_client::datadogV2::model::ServiceNowTemplateCreateRequest;
use datadog_api_client::datadogV2::model::ServiceNowTemplateCreateRequestAttributes;
use datadog_api_client::datadogV2::model::ServiceNowTemplateCreateRequestData;
use datadog_api_client::datadogV2::model::ServiceNowTemplateType;
use std::collections::BTreeMap;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let body = ServiceNowTemplateCreateRequest::new(ServiceNowTemplateCreateRequestData::new(
ServiceNowTemplateCreateRequestAttributes::new(
"incident-template".to_string(),
Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID"),
"incident".to_string(),
)
.assignment_group_id(
Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID"),
)
.business_service_id(
Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID"),
)
.fields_mapping(BTreeMap::from([
("category".to_string(), "software".to_string()),
("priority".to_string(), "1".to_string()),
]))
.user_id(Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID")),
ServiceNowTemplateType::SERVICENOW_TEMPLATES,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.CreateServiceNowTemplate", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api.create_service_now_template(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_servicenow-integration_DeleteServiceNowTemplate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Delete ServiceNow template returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.DeleteServiceNowTemplate", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api
.delete_service_now_template(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_servicenow-integration_GetServiceNowTemplate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Get ServiceNow template returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.GetServiceNowTemplate", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api
.get_service_now_template(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// List ServiceNow assignment groups returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListServiceNowAssignmentGroups", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api
.list_service_now_assignment_groups(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// List ServiceNow business services returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListServiceNowBusinessServices", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api
.list_service_now_business_services(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
16 changes: 16 additions & 0 deletions examples/v2_servicenow-integration_ListServiceNowInstances.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// List ServiceNow instances returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListServiceNowInstances", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api.list_service_now_instances().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
16 changes: 16 additions & 0 deletions examples/v2_servicenow-integration_ListServiceNowTemplates.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// List ServiceNow templates returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListServiceNowTemplates", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api.list_service_now_templates().await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
21 changes: 21 additions & 0 deletions examples/v2_servicenow-integration_ListServiceNowUsers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// List ServiceNow users returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.ListServiceNowUsers", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api
.list_service_now_users(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
46 changes: 46 additions & 0 deletions examples/v2_servicenow-integration_UpdateServiceNowTemplate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Update ServiceNow template returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_service_now_integration::ServiceNowIntegrationAPI;
use datadog_api_client::datadogV2::model::ServiceNowTemplateType;
use datadog_api_client::datadogV2::model::ServiceNowTemplateUpdateRequest;
use datadog_api_client::datadogV2::model::ServiceNowTemplateUpdateRequestAttributes;
use datadog_api_client::datadogV2::model::ServiceNowTemplateUpdateRequestData;
use std::collections::BTreeMap;
use uuid::Uuid;

#[tokio::main]
async fn main() {
let body = ServiceNowTemplateUpdateRequest::new(ServiceNowTemplateUpdateRequestData::new(
ServiceNowTemplateUpdateRequestAttributes::new(
"incident-template-updated".to_string(),
Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID"),
"incident".to_string(),
)
.assignment_group_id(
Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID"),
)
.business_service_id(
Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID"),
)
.fields_mapping(BTreeMap::from([
("category".to_string(), "hardware".to_string()),
("priority".to_string(), "2".to_string()),
]))
.user_id(Uuid::parse_str("65b3341b-0680-47f9-a6d4-134db45c603e").expect("invalid UUID")),
ServiceNowTemplateType::SERVICENOW_TEMPLATES,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.UpdateServiceNowTemplate", true);
let api = ServiceNowIntegrationAPI::with_config(configuration);
let resp = api
.update_service_now_template(
Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"),
body,
)
.await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
9 changes: 9 additions & 0 deletions src/datadog/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ impl Default for Configuration {
("v2.list_jira_accounts".to_owned(), false),
("v2.list_jira_issue_templates".to_owned(), false),
("v2.update_jira_issue_template".to_owned(), false),
("v2.create_service_now_template".to_owned(), false),
("v2.delete_service_now_template".to_owned(), false),
("v2.get_service_now_template".to_owned(), false),
("v2.list_service_now_assignment_groups".to_owned(), false),
("v2.list_service_now_business_services".to_owned(), false),
("v2.list_service_now_instances".to_owned(), false),
("v2.list_service_now_templates".to_owned(), false),
("v2.list_service_now_users".to_owned(), false),
("v2.update_service_now_template".to_owned(), false),
("v2.add_role_to_restriction_query".to_owned(), false),
("v2.create_restriction_query".to_owned(), false),
("v2.delete_restriction_query".to_owned(), false),
Expand Down
Loading