pub struct IncidentsAPI { /* private fields */ }
Expand description
Manage incident response, as well as associated attachments, metadata, and todos. See the Incident Management page for more information.
Implementations§
Source§impl IncidentsAPI
impl IncidentsAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.ListIncidents", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .list_incidents(ListIncidentsOptionalParams::default())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.ListIncidentTypes", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .list_incident_types(ListIncidentTypesOptionalParams::default())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.DeleteIncident", true);
11 let api = IncidentsAPI::with_config(configuration);
12 let resp = api.delete_incident(incident_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .list_incident_attachments(
13 "incident_id".to_string(),
14 ListIncidentAttachmentsOptionalParams::default(),
15 )
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.SearchIncidents", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .search_incidents(
13 "state:(active OR stable OR resolved)".to_string(),
14 SearchIncidentsOptionalParams::default(),
15 )
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
- examples/v2_incidents_ListIncidentTodos.rs
- examples/v2_incidents_ListIncidents_2665616954.rs
- examples/v2_incidents_ListIncidentIntegrations.rs
- examples/v2_incidents_DeleteIncidentType.rs
- examples/v2_incidents_GetIncident.rs
- examples/v2_incidents_SearchIncidents_1931679109.rs
- examples/v2_incidents_ListIncidentAttachments_2457735435.rs
- examples/v2_incidents_GetIncidentTodo.rs
- examples/v2_incidents_DeleteIncidentTodo.rs
- examples/v2_incidents_GetIncidentIntegration.rs
- examples/v2_incidents_DeleteIncidentIntegration.rs
- examples/v2_incidents_UpdateIncidentType.rs
- examples/v2_incidents_CreateIncidentType.rs
- examples/v2_incidents_CreateIncidentTodo.rs
- examples/v2_incidents_UpdateIncident_1009194038.rs
- examples/v2_incidents_UpdateIncident_3369341440.rs
- examples/v2_incidents_UpdateIncidentTodo.rs
- examples/v2_incidents_UpdateIncidentAttachments_3881702075.rs
- examples/v2_incidents_UpdateIncident.rs
- examples/v2_incidents_CreateIncident.rs
- examples/v2_incidents_CreateIncidentIntegration.rs
- examples/v2_incidents_UpdateIncidentIntegration.rs
- examples/v2_incidents_UpdateIncidentAttachments.rs
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn create_incident(
&self,
body: IncidentCreateRequest,
) -> Result<IncidentResponse, Error<CreateIncidentError>>
pub async fn create_incident( &self, body: IncidentCreateRequest, ) -> Result<IncidentResponse, Error<CreateIncidentError>>
Create an incident.
Examples found in repository?
18async fn main() {
19 // there is a valid "user" in the system
20 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
21 let body = IncidentCreateRequest::new(
22 IncidentCreateData::new(
23 IncidentCreateAttributes::new(false, "Example-Incident".to_string()).fields(
24 BTreeMap::from([(
25 "state".to_string(),
26 IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(
27 IncidentFieldAttributesSingleValue::new()
28 .type_(IncidentFieldAttributesSingleValueType::DROPDOWN)
29 .value(Some("resolved".to_string())),
30 )),
31 )]),
32 ),
33 IncidentType::INCIDENTS,
34 )
35 .relationships(IncidentCreateRelationships::new(Some(
36 NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
37 user_data_id.clone(),
38 UsersType::USERS,
39 ))),
40 ))),
41 );
42 let mut configuration = datadog::Configuration::new();
43 configuration.set_unstable_operation_enabled("v2.CreateIncident", true);
44 let api = IncidentsAPI::with_config(configuration);
45 let resp = api.create_incident(body).await;
46 if let Ok(value) = resp {
47 println!("{:#?}", value);
48 } else {
49 println!("{:#?}", resp.unwrap_err());
50 }
51}
Sourcepub async fn create_incident_with_http_info(
&self,
body: IncidentCreateRequest,
) -> Result<ResponseContent<IncidentResponse>, Error<CreateIncidentError>>
pub async fn create_incident_with_http_info( &self, body: IncidentCreateRequest, ) -> Result<ResponseContent<IncidentResponse>, Error<CreateIncidentError>>
Create an incident.
Sourcepub async fn create_incident_integration(
&self,
incident_id: String,
body: IncidentIntegrationMetadataCreateRequest,
) -> Result<IncidentIntegrationMetadataResponse, Error<CreateIncidentIntegrationError>>
pub async fn create_incident_integration( &self, incident_id: String, body: IncidentIntegrationMetadataCreateRequest, ) -> Result<IncidentIntegrationMetadataResponse, Error<CreateIncidentIntegrationError>>
Create an incident integration metadata.
Examples found in repository?
13async fn main() {
14 // there is a valid "incident" in the system
15 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
16 let body =
17 IncidentIntegrationMetadataCreateRequest::new(IncidentIntegrationMetadataCreateData::new(
18 IncidentIntegrationMetadataAttributes::new(
19 1,
20 IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(
21 SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new(
22 "C0123456789".to_string(),
23 "#new-channel".to_string(),
24 "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
25 .to_string(),
26 )
27 .team_id("T01234567".to_string())]),
28 )),
29 )
30 .incident_id(incident_data_id.clone()),
31 IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
32 ));
33 let mut configuration = datadog::Configuration::new();
34 configuration.set_unstable_operation_enabled("v2.CreateIncidentIntegration", true);
35 let api = IncidentsAPI::with_config(configuration);
36 let resp = api
37 .create_incident_integration(incident_data_id.clone(), body)
38 .await;
39 if let Ok(value) = resp {
40 println!("{:#?}", value);
41 } else {
42 println!("{:#?}", resp.unwrap_err());
43 }
44}
Sourcepub async fn create_incident_integration_with_http_info(
&self,
incident_id: String,
body: IncidentIntegrationMetadataCreateRequest,
) -> Result<ResponseContent<IncidentIntegrationMetadataResponse>, Error<CreateIncidentIntegrationError>>
pub async fn create_incident_integration_with_http_info( &self, incident_id: String, body: IncidentIntegrationMetadataCreateRequest, ) -> Result<ResponseContent<IncidentIntegrationMetadataResponse>, Error<CreateIncidentIntegrationError>>
Create an incident integration metadata.
Sourcepub async fn create_incident_todo(
&self,
incident_id: String,
body: IncidentTodoCreateRequest,
) -> Result<IncidentTodoResponse, Error<CreateIncidentTodoError>>
pub async fn create_incident_todo( &self, incident_id: String, body: IncidentTodoCreateRequest, ) -> Result<IncidentTodoResponse, Error<CreateIncidentTodoError>>
Create an incident todo.
Examples found in repository?
11async fn main() {
12 // there is a valid "incident" in the system
13 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
14 let body = IncidentTodoCreateRequest::new(IncidentTodoCreateData::new(
15 IncidentTodoAttributes::new(
16 vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle(
17 "@test.user@test.com".to_string(),
18 )],
19 "Restore lost data.".to_string(),
20 ),
21 IncidentTodoType::INCIDENT_TODOS,
22 ));
23 let mut configuration = datadog::Configuration::new();
24 configuration.set_unstable_operation_enabled("v2.CreateIncidentTodo", true);
25 let api = IncidentsAPI::with_config(configuration);
26 let resp = api
27 .create_incident_todo(incident_data_id.clone(), body)
28 .await;
29 if let Ok(value) = resp {
30 println!("{:#?}", value);
31 } else {
32 println!("{:#?}", resp.unwrap_err());
33 }
34}
Sourcepub async fn create_incident_todo_with_http_info(
&self,
incident_id: String,
body: IncidentTodoCreateRequest,
) -> Result<ResponseContent<IncidentTodoResponse>, Error<CreateIncidentTodoError>>
pub async fn create_incident_todo_with_http_info( &self, incident_id: String, body: IncidentTodoCreateRequest, ) -> Result<ResponseContent<IncidentTodoResponse>, Error<CreateIncidentTodoError>>
Create an incident todo.
Sourcepub async fn create_incident_type(
&self,
body: IncidentTypeCreateRequest,
) -> Result<IncidentTypeResponse, Error<CreateIncidentTypeError>>
pub async fn create_incident_type( &self, body: IncidentTypeCreateRequest, ) -> Result<IncidentTypeResponse, Error<CreateIncidentTypeError>>
Create an incident type.
Examples found in repository?
10async fn main() {
11 let body =
12 IncidentTypeCreateRequest::new(
13 IncidentTypeCreateData::new(
14 IncidentTypeAttributes::new("Security Incident".to_string())
15 .description(
16 "Any incidents that harm (or have the potential to) the confidentiality, integrity, or availability of our data.".to_string(),
17 )
18 .is_default(false),
19 IncidentTypeType::INCIDENT_TYPES,
20 ),
21 );
22 let mut configuration = datadog::Configuration::new();
23 configuration.set_unstable_operation_enabled("v2.CreateIncidentType", true);
24 let api = IncidentsAPI::with_config(configuration);
25 let resp = api.create_incident_type(body).await;
26 if let Ok(value) = resp {
27 println!("{:#?}", value);
28 } else {
29 println!("{:#?}", resp.unwrap_err());
30 }
31}
Sourcepub async fn create_incident_type_with_http_info(
&self,
body: IncidentTypeCreateRequest,
) -> Result<ResponseContent<IncidentTypeResponse>, Error<CreateIncidentTypeError>>
pub async fn create_incident_type_with_http_info( &self, body: IncidentTypeCreateRequest, ) -> Result<ResponseContent<IncidentTypeResponse>, Error<CreateIncidentTypeError>>
Create an incident type.
Sourcepub async fn delete_incident(
&self,
incident_id: String,
) -> Result<(), Error<DeleteIncidentError>>
pub async fn delete_incident( &self, incident_id: String, ) -> Result<(), Error<DeleteIncidentError>>
Deletes an existing incident from the users organization.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.DeleteIncident", true);
11 let api = IncidentsAPI::with_config(configuration);
12 let resp = api.delete_incident(incident_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn delete_incident_with_http_info(
&self,
incident_id: String,
) -> Result<ResponseContent<()>, Error<DeleteIncidentError>>
pub async fn delete_incident_with_http_info( &self, incident_id: String, ) -> Result<ResponseContent<()>, Error<DeleteIncidentError>>
Deletes an existing incident from the users organization.
Sourcepub async fn delete_incident_integration(
&self,
incident_id: String,
integration_metadata_id: String,
) -> Result<(), Error<DeleteIncidentIntegrationError>>
pub async fn delete_incident_integration( &self, incident_id: String, integration_metadata_id: String, ) -> Result<(), Error<DeleteIncidentIntegrationError>>
Delete an incident integration metadata.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9
10 // the "incident" has an "incident_integration_metadata"
11 let incident_integration_metadata_data_id =
12 std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
13 let mut configuration = datadog::Configuration::new();
14 configuration.set_unstable_operation_enabled("v2.DeleteIncidentIntegration", true);
15 let api = IncidentsAPI::with_config(configuration);
16 let resp = api
17 .delete_incident_integration(
18 incident_data_id.clone(),
19 incident_integration_metadata_data_id.clone(),
20 )
21 .await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
Sourcepub async fn delete_incident_integration_with_http_info(
&self,
incident_id: String,
integration_metadata_id: String,
) -> Result<ResponseContent<()>, Error<DeleteIncidentIntegrationError>>
pub async fn delete_incident_integration_with_http_info( &self, incident_id: String, integration_metadata_id: String, ) -> Result<ResponseContent<()>, Error<DeleteIncidentIntegrationError>>
Delete an incident integration metadata.
Sourcepub async fn delete_incident_todo(
&self,
incident_id: String,
todo_id: String,
) -> Result<(), Error<DeleteIncidentTodoError>>
pub async fn delete_incident_todo( &self, incident_id: String, todo_id: String, ) -> Result<(), Error<DeleteIncidentTodoError>>
Delete an incident todo.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9
10 // the "incident" has an "incident_todo"
11 let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
12 let mut configuration = datadog::Configuration::new();
13 configuration.set_unstable_operation_enabled("v2.DeleteIncidentTodo", true);
14 let api = IncidentsAPI::with_config(configuration);
15 let resp = api
16 .delete_incident_todo(incident_data_id.clone(), incident_todo_data_id.clone())
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn delete_incident_todo_with_http_info(
&self,
incident_id: String,
todo_id: String,
) -> Result<ResponseContent<()>, Error<DeleteIncidentTodoError>>
pub async fn delete_incident_todo_with_http_info( &self, incident_id: String, todo_id: String, ) -> Result<ResponseContent<()>, Error<DeleteIncidentTodoError>>
Delete an incident todo.
Sourcepub async fn delete_incident_type(
&self,
incident_type_id: String,
) -> Result<(), Error<DeleteIncidentTypeError>>
pub async fn delete_incident_type( &self, incident_type_id: String, ) -> Result<(), Error<DeleteIncidentTypeError>>
Delete an incident type.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident_type" in the system
8 let incident_type_data_id = std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.DeleteIncidentType", true);
11 let api = IncidentsAPI::with_config(configuration);
12 let resp = api
13 .delete_incident_type(incident_type_data_id.clone())
14 .await;
15 if let Ok(value) = resp {
16 println!("{:#?}", value);
17 } else {
18 println!("{:#?}", resp.unwrap_err());
19 }
20}
Sourcepub async fn delete_incident_type_with_http_info(
&self,
incident_type_id: String,
) -> Result<ResponseContent<()>, Error<DeleteIncidentTypeError>>
pub async fn delete_incident_type_with_http_info( &self, incident_type_id: String, ) -> Result<ResponseContent<()>, Error<DeleteIncidentTypeError>>
Delete an incident type.
Sourcepub async fn get_incident(
&self,
incident_id: String,
params: GetIncidentOptionalParams,
) -> Result<IncidentResponse, Error<GetIncidentError>>
pub async fn get_incident( &self, incident_id: String, params: GetIncidentOptionalParams, ) -> Result<IncidentResponse, Error<GetIncidentError>>
Get the details of an incident by incident_id
.
Examples found in repository?
7async fn main() {
8 // there is a valid "incident" in the system
9 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.GetIncident", true);
12 let api = IncidentsAPI::with_config(configuration);
13 let resp = api
14 .get_incident(
15 incident_data_id.clone(),
16 GetIncidentOptionalParams::default(),
17 )
18 .await;
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24}
Sourcepub async fn get_incident_with_http_info(
&self,
incident_id: String,
params: GetIncidentOptionalParams,
) -> Result<ResponseContent<IncidentResponse>, Error<GetIncidentError>>
pub async fn get_incident_with_http_info( &self, incident_id: String, params: GetIncidentOptionalParams, ) -> Result<ResponseContent<IncidentResponse>, Error<GetIncidentError>>
Get the details of an incident by incident_id
.
Sourcepub async fn get_incident_integration(
&self,
incident_id: String,
integration_metadata_id: String,
) -> Result<IncidentIntegrationMetadataResponse, Error<GetIncidentIntegrationError>>
pub async fn get_incident_integration( &self, incident_id: String, integration_metadata_id: String, ) -> Result<IncidentIntegrationMetadataResponse, Error<GetIncidentIntegrationError>>
Get incident integration metadata details.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9
10 // the "incident" has an "incident_integration_metadata"
11 let incident_integration_metadata_data_id =
12 std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
13 let mut configuration = datadog::Configuration::new();
14 configuration.set_unstable_operation_enabled("v2.GetIncidentIntegration", true);
15 let api = IncidentsAPI::with_config(configuration);
16 let resp = api
17 .get_incident_integration(
18 incident_data_id.clone(),
19 incident_integration_metadata_data_id.clone(),
20 )
21 .await;
22 if let Ok(value) = resp {
23 println!("{:#?}", value);
24 } else {
25 println!("{:#?}", resp.unwrap_err());
26 }
27}
Sourcepub async fn get_incident_integration_with_http_info(
&self,
incident_id: String,
integration_metadata_id: String,
) -> Result<ResponseContent<IncidentIntegrationMetadataResponse>, Error<GetIncidentIntegrationError>>
pub async fn get_incident_integration_with_http_info( &self, incident_id: String, integration_metadata_id: String, ) -> Result<ResponseContent<IncidentIntegrationMetadataResponse>, Error<GetIncidentIntegrationError>>
Get incident integration metadata details.
Sourcepub async fn get_incident_todo(
&self,
incident_id: String,
todo_id: String,
) -> Result<IncidentTodoResponse, Error<GetIncidentTodoError>>
pub async fn get_incident_todo( &self, incident_id: String, todo_id: String, ) -> Result<IncidentTodoResponse, Error<GetIncidentTodoError>>
Get incident todo details.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9
10 // the "incident" has an "incident_todo"
11 let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
12 let mut configuration = datadog::Configuration::new();
13 configuration.set_unstable_operation_enabled("v2.GetIncidentTodo", true);
14 let api = IncidentsAPI::with_config(configuration);
15 let resp = api
16 .get_incident_todo(incident_data_id.clone(), incident_todo_data_id.clone())
17 .await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn get_incident_todo_with_http_info(
&self,
incident_id: String,
todo_id: String,
) -> Result<ResponseContent<IncidentTodoResponse>, Error<GetIncidentTodoError>>
pub async fn get_incident_todo_with_http_info( &self, incident_id: String, todo_id: String, ) -> Result<ResponseContent<IncidentTodoResponse>, Error<GetIncidentTodoError>>
Get incident todo details.
Sourcepub async fn get_incident_type(
&self,
incident_type_id: String,
) -> Result<IncidentTypeResponse, Error<GetIncidentTypeError>>
pub async fn get_incident_type( &self, incident_type_id: String, ) -> Result<IncidentTypeResponse, Error<GetIncidentTypeError>>
Get incident type details.
Sourcepub async fn get_incident_type_with_http_info(
&self,
incident_type_id: String,
) -> Result<ResponseContent<IncidentTypeResponse>, Error<GetIncidentTypeError>>
pub async fn get_incident_type_with_http_info( &self, incident_type_id: String, ) -> Result<ResponseContent<IncidentTypeResponse>, Error<GetIncidentTypeError>>
Get incident type details.
Sourcepub async fn list_incident_attachments(
&self,
incident_id: String,
params: ListIncidentAttachmentsOptionalParams,
) -> Result<IncidentAttachmentsResponse, Error<ListIncidentAttachmentsError>>
pub async fn list_incident_attachments( &self, incident_id: String, params: ListIncidentAttachmentsOptionalParams, ) -> Result<IncidentAttachmentsResponse, Error<ListIncidentAttachmentsError>>
Get all attachments for a given incident.
Examples found in repository?
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .list_incident_attachments(
13 "incident_id".to_string(),
14 ListIncidentAttachmentsOptionalParams::default(),
15 )
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
More examples
7async fn main() {
8 // there is a valid "incident" in the system
9 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.ListIncidentAttachments", true);
12 let api = IncidentsAPI::with_config(configuration);
13 let resp = api
14 .list_incident_attachments(
15 incident_data_id.clone(),
16 ListIncidentAttachmentsOptionalParams::default(),
17 )
18 .await;
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24}
Sourcepub async fn list_incident_attachments_with_http_info(
&self,
incident_id: String,
params: ListIncidentAttachmentsOptionalParams,
) -> Result<ResponseContent<IncidentAttachmentsResponse>, Error<ListIncidentAttachmentsError>>
pub async fn list_incident_attachments_with_http_info( &self, incident_id: String, params: ListIncidentAttachmentsOptionalParams, ) -> Result<ResponseContent<IncidentAttachmentsResponse>, Error<ListIncidentAttachmentsError>>
Get all attachments for a given incident.
Sourcepub async fn list_incident_integrations(
&self,
incident_id: String,
) -> Result<IncidentIntegrationMetadataListResponse, Error<ListIncidentIntegrationsError>>
pub async fn list_incident_integrations( &self, incident_id: String, ) -> Result<IncidentIntegrationMetadataListResponse, Error<ListIncidentIntegrationsError>>
Get all integration metadata for an incident.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.ListIncidentIntegrations", true);
11 let api = IncidentsAPI::with_config(configuration);
12 let resp = api
13 .list_incident_integrations(incident_data_id.clone())
14 .await;
15 if let Ok(value) = resp {
16 println!("{:#?}", value);
17 } else {
18 println!("{:#?}", resp.unwrap_err());
19 }
20}
Sourcepub async fn list_incident_integrations_with_http_info(
&self,
incident_id: String,
) -> Result<ResponseContent<IncidentIntegrationMetadataListResponse>, Error<ListIncidentIntegrationsError>>
pub async fn list_incident_integrations_with_http_info( &self, incident_id: String, ) -> Result<ResponseContent<IncidentIntegrationMetadataListResponse>, Error<ListIncidentIntegrationsError>>
Get all integration metadata for an incident.
Sourcepub async fn list_incident_todos(
&self,
incident_id: String,
) -> Result<IncidentTodoListResponse, Error<ListIncidentTodosError>>
pub async fn list_incident_todos( &self, incident_id: String, ) -> Result<IncidentTodoListResponse, Error<ListIncidentTodosError>>
Get all todos for an incident.
Examples found in repository?
6async fn main() {
7 // there is a valid "incident" in the system
8 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
9 let mut configuration = datadog::Configuration::new();
10 configuration.set_unstable_operation_enabled("v2.ListIncidentTodos", true);
11 let api = IncidentsAPI::with_config(configuration);
12 let resp = api.list_incident_todos(incident_data_id.clone()).await;
13 if let Ok(value) = resp {
14 println!("{:#?}", value);
15 } else {
16 println!("{:#?}", resp.unwrap_err());
17 }
18}
Sourcepub async fn list_incident_todos_with_http_info(
&self,
incident_id: String,
) -> Result<ResponseContent<IncidentTodoListResponse>, Error<ListIncidentTodosError>>
pub async fn list_incident_todos_with_http_info( &self, incident_id: String, ) -> Result<ResponseContent<IncidentTodoListResponse>, Error<ListIncidentTodosError>>
Get all todos for an incident.
Sourcepub async fn list_incident_types(
&self,
params: ListIncidentTypesOptionalParams,
) -> Result<IncidentTypeListResponse, Error<ListIncidentTypesError>>
pub async fn list_incident_types( &self, params: ListIncidentTypesOptionalParams, ) -> Result<IncidentTypeListResponse, Error<ListIncidentTypesError>>
Get all incident types.
Examples found in repository?
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.ListIncidentTypes", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .list_incident_types(ListIncidentTypesOptionalParams::default())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub async fn list_incident_types_with_http_info(
&self,
params: ListIncidentTypesOptionalParams,
) -> Result<ResponseContent<IncidentTypeListResponse>, Error<ListIncidentTypesError>>
pub async fn list_incident_types_with_http_info( &self, params: ListIncidentTypesOptionalParams, ) -> Result<ResponseContent<IncidentTypeListResponse>, Error<ListIncidentTypesError>>
Get all incident types.
Sourcepub async fn list_incidents(
&self,
params: ListIncidentsOptionalParams,
) -> Result<IncidentsResponse, Error<ListIncidentsError>>
pub async fn list_incidents( &self, params: ListIncidentsOptionalParams, ) -> Result<IncidentsResponse, Error<ListIncidentsError>>
Get all incidents for the user’s organization.
Examples found in repository?
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.ListIncidents", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .list_incidents(ListIncidentsOptionalParams::default())
13 .await;
14 if let Ok(value) = resp {
15 println!("{:#?}", value);
16 } else {
17 println!("{:#?}", resp.unwrap_err());
18 }
19}
Sourcepub fn list_incidents_with_pagination(
&self,
params: ListIncidentsOptionalParams,
) -> impl Stream<Item = Result<IncidentResponseData, Error<ListIncidentsError>>> + '_
pub fn list_incidents_with_pagination( &self, params: ListIncidentsOptionalParams, ) -> impl Stream<Item = Result<IncidentResponseData, Error<ListIncidentsError>>> + '_
Examples found in repository?
9async fn main() {
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.ListIncidents", true);
12 let api = IncidentsAPI::with_config(configuration);
13 let response =
14 api.list_incidents_with_pagination(ListIncidentsOptionalParams::default().page_size(2));
15 pin_mut!(response);
16 while let Some(resp) = response.next().await {
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22 }
23}
Sourcepub async fn list_incidents_with_http_info(
&self,
params: ListIncidentsOptionalParams,
) -> Result<ResponseContent<IncidentsResponse>, Error<ListIncidentsError>>
pub async fn list_incidents_with_http_info( &self, params: ListIncidentsOptionalParams, ) -> Result<ResponseContent<IncidentsResponse>, Error<ListIncidentsError>>
Get all incidents for the user’s organization.
Sourcepub async fn search_incidents(
&self,
query: String,
params: SearchIncidentsOptionalParams,
) -> Result<IncidentSearchResponse, Error<SearchIncidentsError>>
pub async fn search_incidents( &self, query: String, params: SearchIncidentsOptionalParams, ) -> Result<IncidentSearchResponse, Error<SearchIncidentsError>>
Search for incidents matching a certain query.
Examples found in repository?
7async fn main() {
8 let mut configuration = datadog::Configuration::new();
9 configuration.set_unstable_operation_enabled("v2.SearchIncidents", true);
10 let api = IncidentsAPI::with_config(configuration);
11 let resp = api
12 .search_incidents(
13 "state:(active OR stable OR resolved)".to_string(),
14 SearchIncidentsOptionalParams::default(),
15 )
16 .await;
17 if let Ok(value) = resp {
18 println!("{:#?}", value);
19 } else {
20 println!("{:#?}", resp.unwrap_err());
21 }
22}
Sourcepub fn search_incidents_with_pagination(
&self,
query: String,
params: SearchIncidentsOptionalParams,
) -> impl Stream<Item = Result<IncidentSearchResponseIncidentsData, Error<SearchIncidentsError>>> + '_
pub fn search_incidents_with_pagination( &self, query: String, params: SearchIncidentsOptionalParams, ) -> impl Stream<Item = Result<IncidentSearchResponseIncidentsData, Error<SearchIncidentsError>>> + '_
Examples found in repository?
9async fn main() {
10 let mut configuration = datadog::Configuration::new();
11 configuration.set_unstable_operation_enabled("v2.SearchIncidents", true);
12 let api = IncidentsAPI::with_config(configuration);
13 let response = api.search_incidents_with_pagination(
14 "state:(active OR stable OR resolved)".to_string(),
15 SearchIncidentsOptionalParams::default().page_size(2),
16 );
17 pin_mut!(response);
18 while let Some(resp) = response.next().await {
19 if let Ok(value) = resp {
20 println!("{:#?}", value);
21 } else {
22 println!("{:#?}", resp.unwrap_err());
23 }
24 }
25}
Sourcepub async fn search_incidents_with_http_info(
&self,
query: String,
params: SearchIncidentsOptionalParams,
) -> Result<ResponseContent<IncidentSearchResponse>, Error<SearchIncidentsError>>
pub async fn search_incidents_with_http_info( &self, query: String, params: SearchIncidentsOptionalParams, ) -> Result<ResponseContent<IncidentSearchResponse>, Error<SearchIncidentsError>>
Search for incidents matching a certain query.
Sourcepub async fn update_incident(
&self,
incident_id: String,
body: IncidentUpdateRequest,
params: UpdateIncidentOptionalParams,
) -> Result<IncidentResponse, Error<UpdateIncidentError>>
pub async fn update_incident( &self, incident_id: String, body: IncidentUpdateRequest, params: UpdateIncidentOptionalParams, ) -> Result<IncidentResponse, Error<UpdateIncidentError>>
Updates an incident. Provide only the attributes that should be updated as this request is a partial update.
Examples found in repository?
12async fn main() {
13 // there is a valid "incident" in the system
14 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
15 let body = IncidentUpdateRequest::new(
16 IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
17 IncidentUpdateRelationships::new()
18 .commander_user(Some(NullableRelationshipToUser::new(None))),
19 ),
20 );
21 let mut configuration = datadog::Configuration::new();
22 configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
23 let api = IncidentsAPI::with_config(configuration);
24 let resp = api
25 .update_incident(
26 incident_data_id.clone(),
27 body,
28 UpdateIncidentOptionalParams::default(),
29 )
30 .await;
31 if let Ok(value) = resp {
32 println!("{:#?}", value);
33 } else {
34 println!("{:#?}", resp.unwrap_err());
35 }
36}
More examples
14async fn main() {
15 // there is a valid "incident" in the system
16 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
17
18 // there is a valid "user" in the system
19 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
20 let body = IncidentUpdateRequest::new(
21 IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).relationships(
22 IncidentUpdateRelationships::new().commander_user(Some(
23 NullableRelationshipToUser::new(Some(NullableRelationshipToUserData::new(
24 user_data_id.clone(),
25 UsersType::USERS,
26 ))),
27 )),
28 ),
29 );
30 let mut configuration = datadog::Configuration::new();
31 configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
32 let api = IncidentsAPI::with_config(configuration);
33 let resp = api
34 .update_incident(
35 incident_data_id.clone(),
36 body,
37 UpdateIncidentOptionalParams::default(),
38 )
39 .await;
40 if let Ok(value) = resp {
41 println!("{:#?}", value);
42 } else {
43 println!("{:#?}", resp.unwrap_err());
44 }
45}
15async fn main() {
16 // there is a valid "incident" in the system
17 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
18 let body = IncidentUpdateRequest::new(
19 IncidentUpdateData::new(incident_data_id.clone(), IncidentType::INCIDENTS).attributes(
20 IncidentUpdateAttributes::new()
21 .fields(BTreeMap::from([(
22 "state".to_string(),
23 IncidentFieldAttributes::IncidentFieldAttributesSingleValue(Box::new(
24 IncidentFieldAttributesSingleValue::new()
25 .type_(IncidentFieldAttributesSingleValueType::DROPDOWN)
26 .value(Some("resolved".to_string())),
27 )),
28 )]))
29 .title("A test incident title-updated".to_string()),
30 ),
31 );
32 let mut configuration = datadog::Configuration::new();
33 configuration.set_unstable_operation_enabled("v2.UpdateIncident", true);
34 let api = IncidentsAPI::with_config(configuration);
35 let resp = api
36 .update_incident(
37 incident_data_id.clone(),
38 body,
39 UpdateIncidentOptionalParams::default(),
40 )
41 .await;
42 if let Ok(value) = resp {
43 println!("{:#?}", value);
44 } else {
45 println!("{:#?}", resp.unwrap_err());
46 }
47}
Sourcepub async fn update_incident_with_http_info(
&self,
incident_id: String,
body: IncidentUpdateRequest,
params: UpdateIncidentOptionalParams,
) -> Result<ResponseContent<IncidentResponse>, Error<UpdateIncidentError>>
pub async fn update_incident_with_http_info( &self, incident_id: String, body: IncidentUpdateRequest, params: UpdateIncidentOptionalParams, ) -> Result<ResponseContent<IncidentResponse>, Error<UpdateIncidentError>>
Updates an incident. Provide only the attributes that should be updated as this request is a partial update.
Sourcepub async fn update_incident_attachments(
&self,
incident_id: String,
body: IncidentAttachmentUpdateRequest,
params: UpdateIncidentAttachmentsOptionalParams,
) -> Result<IncidentAttachmentUpdateResponse, Error<UpdateIncidentAttachmentsError>>
pub async fn update_incident_attachments( &self, incident_id: String, body: IncidentAttachmentUpdateRequest, params: UpdateIncidentAttachmentsOptionalParams, ) -> Result<IncidentAttachmentUpdateResponse, Error<UpdateIncidentAttachmentsError>>
The bulk update endpoint for creating, updating, and deleting attachments for a given incident.
Examples found in repository?
14async fn main() {
15 // there is a valid "incident" in the system
16 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
17 let body = IncidentAttachmentUpdateRequest::new(vec![IncidentAttachmentUpdateData::new(
18 IncidentAttachmentType::INCIDENT_ATTACHMENTS,
19 )
20 .attributes(
21 IncidentAttachmentUpdateAttributes::IncidentAttachmentLinkAttributes(Box::new(
22 IncidentAttachmentLinkAttributes::new(
23 IncidentAttachmentLinkAttributesAttachmentObject::new(
24 "https://www.example.com/doc".to_string(),
25 "Example-Incident".to_string(),
26 ),
27 IncidentAttachmentLinkAttachmentType::LINK,
28 ),
29 )),
30 )]);
31 let mut configuration = datadog::Configuration::new();
32 configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachments", true);
33 let api = IncidentsAPI::with_config(configuration);
34 let resp = api
35 .update_incident_attachments(
36 incident_data_id.clone(),
37 body,
38 UpdateIncidentAttachmentsOptionalParams::default(),
39 )
40 .await;
41 if let Ok(value) = resp {
42 println!("{:#?}", value);
43 } else {
44 println!("{:#?}", resp.unwrap_err());
45 }
46}
More examples
17async fn main() {
18 let body = IncidentAttachmentUpdateRequest::new(vec![
19 IncidentAttachmentUpdateData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS)
20 .attributes(
21 IncidentAttachmentUpdateAttributes::IncidentAttachmentPostmortemAttributes(
22 Box::new(IncidentAttachmentPostmortemAttributes::new(
23 IncidentAttachmentsPostmortemAttributesAttachmentObject::new(
24 "https://app.datadoghq.com/notebook/123".to_string(),
25 "Postmortem IR-123".to_string(),
26 ),
27 IncidentAttachmentPostmortemAttachmentType::POSTMORTEM,
28 )),
29 ),
30 )
31 .id("00000000-abcd-0002-0000-000000000000".to_string()),
32 IncidentAttachmentUpdateData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS).attributes(
33 IncidentAttachmentUpdateAttributes::IncidentAttachmentLinkAttributes(Box::new(
34 IncidentAttachmentLinkAttributes::new(
35 IncidentAttachmentLinkAttributesAttachmentObject::new(
36 "https://www.example.com/webstore-failure-runbook".to_string(),
37 "Runbook for webstore service failures".to_string(),
38 ),
39 IncidentAttachmentLinkAttachmentType::LINK,
40 ),
41 )),
42 ),
43 IncidentAttachmentUpdateData::new(IncidentAttachmentType::INCIDENT_ATTACHMENTS)
44 .id("00000000-abcd-0003-0000-000000000000".to_string()),
45 ]);
46 let mut configuration = datadog::Configuration::new();
47 configuration.set_unstable_operation_enabled("v2.UpdateIncidentAttachments", true);
48 let api = IncidentsAPI::with_config(configuration);
49 let resp = api
50 .update_incident_attachments(
51 "incident_id".to_string(),
52 body,
53 UpdateIncidentAttachmentsOptionalParams::default(),
54 )
55 .await;
56 if let Ok(value) = resp {
57 println!("{:#?}", value);
58 } else {
59 println!("{:#?}", resp.unwrap_err());
60 }
61}
Sourcepub async fn update_incident_attachments_with_http_info(
&self,
incident_id: String,
body: IncidentAttachmentUpdateRequest,
params: UpdateIncidentAttachmentsOptionalParams,
) -> Result<ResponseContent<IncidentAttachmentUpdateResponse>, Error<UpdateIncidentAttachmentsError>>
pub async fn update_incident_attachments_with_http_info( &self, incident_id: String, body: IncidentAttachmentUpdateRequest, params: UpdateIncidentAttachmentsOptionalParams, ) -> Result<ResponseContent<IncidentAttachmentUpdateResponse>, Error<UpdateIncidentAttachmentsError>>
The bulk update endpoint for creating, updating, and deleting attachments for a given incident.
Sourcepub async fn update_incident_integration(
&self,
incident_id: String,
integration_metadata_id: String,
body: IncidentIntegrationMetadataPatchRequest,
) -> Result<IncidentIntegrationMetadataResponse, Error<UpdateIncidentIntegrationError>>
pub async fn update_incident_integration( &self, incident_id: String, integration_metadata_id: String, body: IncidentIntegrationMetadataPatchRequest, ) -> Result<IncidentIntegrationMetadataResponse, Error<UpdateIncidentIntegrationError>>
Update an existing incident integration metadata.
Examples found in repository?
13async fn main() {
14 // there is a valid "incident" in the system
15 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
16
17 // the "incident" has an "incident_integration_metadata"
18 let incident_integration_metadata_data_id =
19 std::env::var("INCIDENT_INTEGRATION_METADATA_DATA_ID").unwrap();
20 let body =
21 IncidentIntegrationMetadataPatchRequest::new(IncidentIntegrationMetadataPatchData::new(
22 IncidentIntegrationMetadataAttributes::new(
23 1,
24 IncidentIntegrationMetadataMetadata::SlackIntegrationMetadata(Box::new(
25 SlackIntegrationMetadata::new(vec![SlackIntegrationMetadataChannelItem::new(
26 "C0123456789".to_string(),
27 "#updated-channel-name".to_string(),
28 "https://slack.com/app_redirect?channel=C0123456789&team=T01234567"
29 .to_string(),
30 )
31 .team_id("T01234567".to_string())]),
32 )),
33 )
34 .incident_id(incident_data_id.clone()),
35 IncidentIntegrationMetadataType::INCIDENT_INTEGRATIONS,
36 ));
37 let mut configuration = datadog::Configuration::new();
38 configuration.set_unstable_operation_enabled("v2.UpdateIncidentIntegration", true);
39 let api = IncidentsAPI::with_config(configuration);
40 let resp = api
41 .update_incident_integration(
42 incident_data_id.clone(),
43 incident_integration_metadata_data_id.clone(),
44 body,
45 )
46 .await;
47 if let Ok(value) = resp {
48 println!("{:#?}", value);
49 } else {
50 println!("{:#?}", resp.unwrap_err());
51 }
52}
Sourcepub async fn update_incident_integration_with_http_info(
&self,
incident_id: String,
integration_metadata_id: String,
body: IncidentIntegrationMetadataPatchRequest,
) -> Result<ResponseContent<IncidentIntegrationMetadataResponse>, Error<UpdateIncidentIntegrationError>>
pub async fn update_incident_integration_with_http_info( &self, incident_id: String, integration_metadata_id: String, body: IncidentIntegrationMetadataPatchRequest, ) -> Result<ResponseContent<IncidentIntegrationMetadataResponse>, Error<UpdateIncidentIntegrationError>>
Update an existing incident integration metadata.
Sourcepub async fn update_incident_todo(
&self,
incident_id: String,
todo_id: String,
body: IncidentTodoPatchRequest,
) -> Result<IncidentTodoResponse, Error<UpdateIncidentTodoError>>
pub async fn update_incident_todo( &self, incident_id: String, todo_id: String, body: IncidentTodoPatchRequest, ) -> Result<IncidentTodoResponse, Error<UpdateIncidentTodoError>>
Update an incident todo.
Examples found in repository?
11async fn main() {
12 // there is a valid "incident" in the system
13 let incident_data_id = std::env::var("INCIDENT_DATA_ID").unwrap();
14
15 // the "incident" has an "incident_todo"
16 let incident_todo_data_id = std::env::var("INCIDENT_TODO_DATA_ID").unwrap();
17 let body = IncidentTodoPatchRequest::new(IncidentTodoPatchData::new(
18 IncidentTodoAttributes::new(
19 vec![IncidentTodoAssignee::IncidentTodoAssigneeHandle(
20 "@test.user@test.com".to_string(),
21 )],
22 "Restore lost data.".to_string(),
23 )
24 .completed(Some("2023-03-06T22:00:00.000000+00:00".to_string()))
25 .due_date(Some("2023-07-10T05:00:00.000000+00:00".to_string())),
26 IncidentTodoType::INCIDENT_TODOS,
27 ));
28 let mut configuration = datadog::Configuration::new();
29 configuration.set_unstable_operation_enabled("v2.UpdateIncidentTodo", true);
30 let api = IncidentsAPI::with_config(configuration);
31 let resp = api
32 .update_incident_todo(
33 incident_data_id.clone(),
34 incident_todo_data_id.clone(),
35 body,
36 )
37 .await;
38 if let Ok(value) = resp {
39 println!("{:#?}", value);
40 } else {
41 println!("{:#?}", resp.unwrap_err());
42 }
43}
Sourcepub async fn update_incident_todo_with_http_info(
&self,
incident_id: String,
todo_id: String,
body: IncidentTodoPatchRequest,
) -> Result<ResponseContent<IncidentTodoResponse>, Error<UpdateIncidentTodoError>>
pub async fn update_incident_todo_with_http_info( &self, incident_id: String, todo_id: String, body: IncidentTodoPatchRequest, ) -> Result<ResponseContent<IncidentTodoResponse>, Error<UpdateIncidentTodoError>>
Update an incident todo.
Sourcepub async fn update_incident_type(
&self,
incident_type_id: String,
body: IncidentTypePatchRequest,
) -> Result<IncidentTypeResponse, Error<UpdateIncidentTypeError>>
pub async fn update_incident_type( &self, incident_type_id: String, body: IncidentTypePatchRequest, ) -> Result<IncidentTypeResponse, Error<UpdateIncidentTypeError>>
Update an incident type.
Examples found in repository?
10async fn main() {
11 // there is a valid "incident_type" in the system
12 let incident_type_data_id = std::env::var("INCIDENT_TYPE_DATA_ID").unwrap();
13 let body = IncidentTypePatchRequest::new(IncidentTypePatchData::new(
14 IncidentTypeUpdateAttributes::new().name("Security Incident-updated".to_string()),
15 incident_type_data_id.clone(),
16 IncidentTypeType::INCIDENT_TYPES,
17 ));
18 let mut configuration = datadog::Configuration::new();
19 configuration.set_unstable_operation_enabled("v2.UpdateIncidentType", true);
20 let api = IncidentsAPI::with_config(configuration);
21 let resp = api
22 .update_incident_type(incident_type_data_id.clone(), body)
23 .await;
24 if let Ok(value) = resp {
25 println!("{:#?}", value);
26 } else {
27 println!("{:#?}", resp.unwrap_err());
28 }
29}
Sourcepub async fn update_incident_type_with_http_info(
&self,
incident_type_id: String,
body: IncidentTypePatchRequest,
) -> Result<ResponseContent<IncidentTypeResponse>, Error<UpdateIncidentTypeError>>
pub async fn update_incident_type_with_http_info( &self, incident_type_id: String, body: IncidentTypePatchRequest, ) -> Result<ResponseContent<IncidentTypeResponse>, Error<UpdateIncidentTypeError>>
Update an incident type.
Trait Implementations§
Source§impl Clone for IncidentsAPI
impl Clone for IncidentsAPI
Source§fn clone(&self) -> IncidentsAPI
fn clone(&self) -> IncidentsAPI
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more