pub struct CaseManagementAPI { /* private fields */ }
Expand description
View and manage cases and projects within Case Management. See the Case Management page for more information.
Implementations§
Source§impl CaseManagementAPI
impl CaseManagementAPI
pub fn new() -> Self
Sourcepub fn with_config(config: Configuration) -> Self
pub fn with_config(config: Configuration) -> Self
Examples found in repository?
More examples
examples/v2_case-management_GetCase.rs (line 10)
6async fn main() {
7 // there is a valid "case" in the system
8 let case_id = std::env::var("CASE_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = CaseManagementAPI::with_config(configuration);
11 let resp = api.get_case(case_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
examples/v2_case-management_SearchCases_3433960044.rs (line 11)
9async fn main() {
10 let configuration = datadog::Configuration::new();
11 let api = CaseManagementAPI::with_config(configuration);
12 let response = api.search_cases_with_pagination(SearchCasesOptionalParams::default());
13 pin_mut!(response);
14 while let Some(resp) = response.next().await {
15 if let Ok(value) = resp {
16 println!("{:#?}", value);
17 } else {
18 println!("{:#?}", resp.unwrap_err());
19 }
20 }
21}
Additional examples can be found in:
- examples/v2_case-management_ArchiveCase.rs
- examples/v2_case-management_UnassignCase.rs
- examples/v2_case-management_UnarchiveCase.rs
- examples/v2_case-management_CreateProject.rs
- examples/v2_case-management_UpdateStatus.rs
- examples/v2_case-management_UpdatePriority.rs
- examples/v2_case-management_AssignCase.rs
- examples/v2_case-management_CreateCase.rs
pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self
Sourcepub async fn archive_case(
&self,
case_id: String,
body: CaseEmptyRequest,
) -> Result<CaseResponse, Error<ArchiveCaseError>>
pub async fn archive_case( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<CaseResponse, Error<ArchiveCaseError>>
Archive case
Examples found in repository?
examples/v2_case-management_ArchiveCase.rs (line 15)
9async fn main() {
10 // there is a valid "case" in the system
11 let case_id = std::env::var("CASE_ID").unwrap();
12 let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
13 let configuration = datadog::Configuration::new();
14 let api = CaseManagementAPI::with_config(configuration);
15 let resp = api.archive_case(case_id.clone(), body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn archive_case_with_http_info(
&self,
case_id: String,
body: CaseEmptyRequest,
) -> Result<ResponseContent<CaseResponse>, Error<ArchiveCaseError>>
pub async fn archive_case_with_http_info( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<ResponseContent<CaseResponse>, Error<ArchiveCaseError>>
Archive case
Sourcepub async fn assign_case(
&self,
case_id: String,
body: CaseAssignRequest,
) -> Result<CaseResponse, Error<AssignCaseError>>
pub async fn assign_case( &self, case_id: String, body: CaseAssignRequest, ) -> Result<CaseResponse, Error<AssignCaseError>>
Assign case to a user
Examples found in repository?
examples/v2_case-management_AssignCase.rs (line 22)
10async fn main() {
11 // there is a valid "case" in the system
12 let case_id = std::env::var("CASE_ID").unwrap();
13
14 // there is a valid "user" in the system
15 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
16 let body = CaseAssignRequest::new(CaseAssign::new(
17 CaseAssignAttributes::new(user_data_id.clone()),
18 CaseResourceType::CASE,
19 ));
20 let configuration = datadog::Configuration::new();
21 let api = CaseManagementAPI::with_config(configuration);
22 let resp = api.assign_case(case_id.clone(), body).await;
23 if let Ok(value) = resp {
24 println!("{:#?}", value);
25 } else {
26 println!("{:#?}", resp.unwrap_err());
27 }
28}
Sourcepub async fn assign_case_with_http_info(
&self,
case_id: String,
body: CaseAssignRequest,
) -> Result<ResponseContent<CaseResponse>, Error<AssignCaseError>>
pub async fn assign_case_with_http_info( &self, case_id: String, body: CaseAssignRequest, ) -> Result<ResponseContent<CaseResponse>, Error<AssignCaseError>>
Assign case to a user
Sourcepub async fn create_case(
&self,
body: CaseCreateRequest,
) -> Result<CaseResponse, Error<CreateCaseError>>
pub async fn create_case( &self, body: CaseCreateRequest, ) -> Result<CaseResponse, Error<CreateCaseError>>
Create a Case
Examples found in repository?
examples/v2_case-management_CreateCase.rs (line 43)
19async fn main() {
20 // there is a valid "user" in the system
21 let user_data_id = std::env::var("USER_DATA_ID").unwrap();
22 let body = CaseCreateRequest::new(
23 CaseCreate::new(
24 CaseCreateAttributes::new(
25 "Security breach investigation in 0cfbc5cbc676ee71".to_string(),
26 CaseType::STANDARD,
27 )
28 .priority(CasePriority::NOT_DEFINED),
29 CaseResourceType::CASE,
30 )
31 .relationships(
32 CaseCreateRelationships::new(ProjectRelationship::new(ProjectRelationshipData::new(
33 "d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(),
34 ProjectResourceType::PROJECT,
35 )))
36 .assignee(Some(NullableUserRelationship::new(Some(
37 NullableUserRelationshipData::new(user_data_id.clone(), UserResourceType::USER),
38 )))),
39 ),
40 );
41 let configuration = datadog::Configuration::new();
42 let api = CaseManagementAPI::with_config(configuration);
43 let resp = api.create_case(body).await;
44 if let Ok(value) = resp {
45 println!("{:#?}", value);
46 } else {
47 println!("{:#?}", resp.unwrap_err());
48 }
49}
Sourcepub async fn create_case_with_http_info(
&self,
body: CaseCreateRequest,
) -> Result<ResponseContent<CaseResponse>, Error<CreateCaseError>>
pub async fn create_case_with_http_info( &self, body: CaseCreateRequest, ) -> Result<ResponseContent<CaseResponse>, Error<CreateCaseError>>
Create a Case
Sourcepub async fn create_project(
&self,
body: ProjectCreateRequest,
) -> Result<ProjectResponse, Error<CreateProjectError>>
pub async fn create_project( &self, body: ProjectCreateRequest, ) -> Result<ProjectResponse, Error<CreateProjectError>>
Create a project.
Examples found in repository?
examples/v2_case-management_CreateProject.rs (line 17)
10async fn main() {
11 let body = ProjectCreateRequest::new(ProjectCreate::new(
12 ProjectCreateAttributes::new("SEC".to_string(), "Security Investigation".to_string()),
13 ProjectResourceType::PROJECT,
14 ));
15 let configuration = datadog::Configuration::new();
16 let api = CaseManagementAPI::with_config(configuration);
17 let resp = api.create_project(body).await;
18 if let Ok(value) = resp {
19 println!("{:#?}", value);
20 } else {
21 println!("{:#?}", resp.unwrap_err());
22 }
23}
Sourcepub async fn create_project_with_http_info(
&self,
body: ProjectCreateRequest,
) -> Result<ResponseContent<ProjectResponse>, Error<CreateProjectError>>
pub async fn create_project_with_http_info( &self, body: ProjectCreateRequest, ) -> Result<ResponseContent<ProjectResponse>, Error<CreateProjectError>>
Create a project.
Sourcepub async fn delete_project(
&self,
project_id: String,
) -> Result<(), Error<DeleteProjectError>>
pub async fn delete_project( &self, project_id: String, ) -> Result<(), Error<DeleteProjectError>>
Remove a project using the project’s id
.
Sourcepub async fn delete_project_with_http_info(
&self,
project_id: String,
) -> Result<ResponseContent<()>, Error<DeleteProjectError>>
pub async fn delete_project_with_http_info( &self, project_id: String, ) -> Result<ResponseContent<()>, Error<DeleteProjectError>>
Remove a project using the project’s id
.
Sourcepub async fn get_case(
&self,
case_id: String,
) -> Result<CaseResponse, Error<GetCaseError>>
pub async fn get_case( &self, case_id: String, ) -> Result<CaseResponse, Error<GetCaseError>>
Get the details of case by case_id
Examples found in repository?
examples/v2_case-management_GetCase.rs (line 11)
6async fn main() {
7 // there is a valid "case" in the system
8 let case_id = std::env::var("CASE_ID").unwrap();
9 let configuration = datadog::Configuration::new();
10 let api = CaseManagementAPI::with_config(configuration);
11 let resp = api.get_case(case_id.clone()).await;
12 if let Ok(value) = resp {
13 println!("{:#?}", value);
14 } else {
15 println!("{:#?}", resp.unwrap_err());
16 }
17}
Sourcepub async fn get_case_with_http_info(
&self,
case_id: String,
) -> Result<ResponseContent<CaseResponse>, Error<GetCaseError>>
pub async fn get_case_with_http_info( &self, case_id: String, ) -> Result<ResponseContent<CaseResponse>, Error<GetCaseError>>
Get the details of case by case_id
Sourcepub async fn get_project(
&self,
project_id: String,
) -> Result<ProjectResponse, Error<GetProjectError>>
pub async fn get_project( &self, project_id: String, ) -> Result<ProjectResponse, Error<GetProjectError>>
Get the details of a project by project_id
.
Sourcepub async fn get_project_with_http_info(
&self,
project_id: String,
) -> Result<ResponseContent<ProjectResponse>, Error<GetProjectError>>
pub async fn get_project_with_http_info( &self, project_id: String, ) -> Result<ResponseContent<ProjectResponse>, Error<GetProjectError>>
Get the details of a project by project_id
.
Sourcepub async fn get_projects(
&self,
) -> Result<ProjectsResponse, Error<GetProjectsError>>
pub async fn get_projects( &self, ) -> Result<ProjectsResponse, Error<GetProjectsError>>
Get all projects.
Sourcepub async fn get_projects_with_http_info(
&self,
) -> Result<ResponseContent<ProjectsResponse>, Error<GetProjectsError>>
pub async fn get_projects_with_http_info( &self, ) -> Result<ResponseContent<ProjectsResponse>, Error<GetProjectsError>>
Get all projects.
Sourcepub async fn search_cases(
&self,
params: SearchCasesOptionalParams,
) -> Result<CasesResponse, Error<SearchCasesError>>
pub async fn search_cases( &self, params: SearchCasesOptionalParams, ) -> Result<CasesResponse, Error<SearchCasesError>>
Search cases.
Sourcepub fn search_cases_with_pagination(
&self,
params: SearchCasesOptionalParams,
) -> impl Stream<Item = Result<Case, Error<SearchCasesError>>> + '_
pub fn search_cases_with_pagination( &self, params: SearchCasesOptionalParams, ) -> impl Stream<Item = Result<Case, Error<SearchCasesError>>> + '_
Examples found in repository?
examples/v2_case-management_SearchCases_3433960044.rs (line 12)
9async fn main() {
10 let configuration = datadog::Configuration::new();
11 let api = CaseManagementAPI::with_config(configuration);
12 let response = api.search_cases_with_pagination(SearchCasesOptionalParams::default());
13 pin_mut!(response);
14 while let Some(resp) = response.next().await {
15 if let Ok(value) = resp {
16 println!("{:#?}", value);
17 } else {
18 println!("{:#?}", resp.unwrap_err());
19 }
20 }
21}
Sourcepub async fn search_cases_with_http_info(
&self,
params: SearchCasesOptionalParams,
) -> Result<ResponseContent<CasesResponse>, Error<SearchCasesError>>
pub async fn search_cases_with_http_info( &self, params: SearchCasesOptionalParams, ) -> Result<ResponseContent<CasesResponse>, Error<SearchCasesError>>
Search cases.
Sourcepub async fn unarchive_case(
&self,
case_id: String,
body: CaseEmptyRequest,
) -> Result<CaseResponse, Error<UnarchiveCaseError>>
pub async fn unarchive_case( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<CaseResponse, Error<UnarchiveCaseError>>
Unarchive case
Examples found in repository?
examples/v2_case-management_UnarchiveCase.rs (line 15)
9async fn main() {
10 // there is a valid "case" in the system
11 let case_id = std::env::var("CASE_ID").unwrap();
12 let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
13 let configuration = datadog::Configuration::new();
14 let api = CaseManagementAPI::with_config(configuration);
15 let resp = api.unarchive_case(case_id.clone(), body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn unarchive_case_with_http_info(
&self,
case_id: String,
body: CaseEmptyRequest,
) -> Result<ResponseContent<CaseResponse>, Error<UnarchiveCaseError>>
pub async fn unarchive_case_with_http_info( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<ResponseContent<CaseResponse>, Error<UnarchiveCaseError>>
Unarchive case
Sourcepub async fn unassign_case(
&self,
case_id: String,
body: CaseEmptyRequest,
) -> Result<CaseResponse, Error<UnassignCaseError>>
pub async fn unassign_case( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<CaseResponse, Error<UnassignCaseError>>
Unassign case
Examples found in repository?
examples/v2_case-management_UnassignCase.rs (line 15)
9async fn main() {
10 // there is a valid "case" in the system
11 let case_id = std::env::var("CASE_ID").unwrap();
12 let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
13 let configuration = datadog::Configuration::new();
14 let api = CaseManagementAPI::with_config(configuration);
15 let resp = api.unassign_case(case_id.clone(), body).await;
16 if let Ok(value) = resp {
17 println!("{:#?}", value);
18 } else {
19 println!("{:#?}", resp.unwrap_err());
20 }
21}
Sourcepub async fn unassign_case_with_http_info(
&self,
case_id: String,
body: CaseEmptyRequest,
) -> Result<ResponseContent<CaseResponse>, Error<UnassignCaseError>>
pub async fn unassign_case_with_http_info( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<ResponseContent<CaseResponse>, Error<UnassignCaseError>>
Unassign case
Sourcepub async fn update_priority(
&self,
case_id: String,
body: CaseUpdatePriorityRequest,
) -> Result<CaseResponse, Error<UpdatePriorityError>>
pub async fn update_priority( &self, case_id: String, body: CaseUpdatePriorityRequest, ) -> Result<CaseResponse, Error<UpdatePriorityError>>
Update case priority
Examples found in repository?
examples/v2_case-management_UpdatePriority.rs (line 20)
11async fn main() {
12 // there is a valid "case" in the system
13 let case_id = std::env::var("CASE_ID").unwrap();
14 let body = CaseUpdatePriorityRequest::new(CaseUpdatePriority::new(
15 CaseUpdatePriorityAttributes::new(CasePriority::P3),
16 CaseResourceType::CASE,
17 ));
18 let configuration = datadog::Configuration::new();
19 let api = CaseManagementAPI::with_config(configuration);
20 let resp = api.update_priority(case_id.clone(), body).await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub async fn update_priority_with_http_info(
&self,
case_id: String,
body: CaseUpdatePriorityRequest,
) -> Result<ResponseContent<CaseResponse>, Error<UpdatePriorityError>>
pub async fn update_priority_with_http_info( &self, case_id: String, body: CaseUpdatePriorityRequest, ) -> Result<ResponseContent<CaseResponse>, Error<UpdatePriorityError>>
Update case priority
Sourcepub async fn update_status(
&self,
case_id: String,
body: CaseUpdateStatusRequest,
) -> Result<CaseResponse, Error<UpdateStatusError>>
pub async fn update_status( &self, case_id: String, body: CaseUpdateStatusRequest, ) -> Result<CaseResponse, Error<UpdateStatusError>>
Update case status
Examples found in repository?
examples/v2_case-management_UpdateStatus.rs (line 20)
11async fn main() {
12 // there is a valid "case" in the system
13 let case_id = std::env::var("CASE_ID").unwrap();
14 let body = CaseUpdateStatusRequest::new(CaseUpdateStatus::new(
15 CaseUpdateStatusAttributes::new(CaseStatus::IN_PROGRESS),
16 CaseResourceType::CASE,
17 ));
18 let configuration = datadog::Configuration::new();
19 let api = CaseManagementAPI::with_config(configuration);
20 let resp = api.update_status(case_id.clone(), body).await;
21 if let Ok(value) = resp {
22 println!("{:#?}", value);
23 } else {
24 println!("{:#?}", resp.unwrap_err());
25 }
26}
Sourcepub async fn update_status_with_http_info(
&self,
case_id: String,
body: CaseUpdateStatusRequest,
) -> Result<ResponseContent<CaseResponse>, Error<UpdateStatusError>>
pub async fn update_status_with_http_info( &self, case_id: String, body: CaseUpdateStatusRequest, ) -> Result<ResponseContent<CaseResponse>, Error<UpdateStatusError>>
Update case status
Trait Implementations§
Source§impl Clone for CaseManagementAPI
impl Clone for CaseManagementAPI
Source§fn clone(&self) -> CaseManagementAPI
fn clone(&self) -> CaseManagementAPI
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CaseManagementAPI
impl Debug for CaseManagementAPI
Auto Trait Implementations§
impl Freeze for CaseManagementAPI
impl !RefUnwindSafe for CaseManagementAPI
impl Send for CaseManagementAPI
impl Sync for CaseManagementAPI
impl Unpin for CaseManagementAPI
impl !UnwindSafe for CaseManagementAPI
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more