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

source

pub fn new() -> Self

source

pub fn with_config(config: Configuration) -> Self

Examples found in repository?
examples/v2_case-management_GetProjects.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_projects().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
More examples
Hide additional examples
examples/v2_case-management_GetProject.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_project("project_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v2_case-management_DeleteProject.rs (line 8)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.delete_project("project_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v2_case-management_SearchCases.rs (line 9)
7
8
9
10
11
12
13
14
15
16
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.search_cases(SearchCasesOptionalParams::default()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v2_case-management_GetCase.rs (line 10)
6
7
8
9
10
11
12
13
14
15
16
17
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_case(case_id.clone()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
examples/v2_case-management_SearchCases_3433960044.rs (line 11)
9
10
11
12
13
14
15
16
17
18
19
20
21
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let response = api.search_cases_with_pagination(SearchCasesOptionalParams::default());
    pin_mut!(response);
    while let Some(resp) = response.next().await {
        if let Ok(value) = resp {
            println!("{:#?}", value);
        } else {
            println!("{:#?}", resp.unwrap_err());
        }
    }
}
source

pub fn with_client_and_config( config: Configuration, client: ClientWithMiddleware, ) -> Self

source

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)
9
10
11
12
13
14
15
16
17
18
19
20
21
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.archive_case(case_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn archive_case_with_http_info( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<ResponseContent<CaseResponse>, Error<ArchiveCaseError>>

Archive case

source

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)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();

    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = CaseAssignRequest::new(CaseAssign::new(
        CaseAssignAttributes::new(user_data_id.clone()),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.assign_case(case_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn assign_case_with_http_info( &self, case_id: String, body: CaseAssignRequest, ) -> Result<ResponseContent<CaseResponse>, Error<AssignCaseError>>

Assign case to a user

source

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)
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
async fn main() {
    // there is a valid "user" in the system
    let user_data_id = std::env::var("USER_DATA_ID").unwrap();
    let body = CaseCreateRequest::new(
        CaseCreate::new(
            CaseCreateAttributes::new(
                "Security breach investigation in 0cfbc5cbc676ee71".to_string(),
                CaseType::STANDARD,
            )
            .priority(CasePriority::NOT_DEFINED),
            CaseResourceType::CASE,
        )
        .relationships(
            CaseCreateRelationships::new(ProjectRelationship::new(ProjectRelationshipData::new(
                "d4bbe1af-f36e-42f1-87c1-493ca35c320e".to_string(),
                ProjectResourceType::PROJECT,
            )))
            .assignee(Some(NullableUserRelationship::new(Some(
                NullableUserRelationshipData::new(user_data_id.clone(), UserResourceType::USER),
            )))),
        ),
    );
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.create_case(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn create_case_with_http_info( &self, body: CaseCreateRequest, ) -> Result<ResponseContent<CaseResponse>, Error<CreateCaseError>>

Create a Case

source

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)
10
11
12
13
14
15
16
17
18
19
20
21
22
23
async fn main() {
    let body = ProjectCreateRequest::new(ProjectCreate::new(
        ProjectCreateAttributes::new("SEC".to_string(), "Security Investigation".to_string()),
        ProjectResourceType::PROJECT,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.create_project(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn create_project_with_http_info( &self, body: ProjectCreateRequest, ) -> Result<ResponseContent<ProjectResponse>, Error<CreateProjectError>>

Create a project.

source

pub async fn delete_project( &self, project_id: String, ) -> Result<(), Error<DeleteProjectError>>

Remove a project using the project’s id.

Examples found in repository?
examples/v2_case-management_DeleteProject.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.delete_project("project_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn delete_project_with_http_info( &self, project_id: String, ) -> Result<ResponseContent<()>, Error<DeleteProjectError>>

Remove a project using the project’s id.

source

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)
6
7
8
9
10
11
12
13
14
15
16
17
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_case(case_id.clone()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

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

source

pub async fn get_project( &self, project_id: String, ) -> Result<ProjectResponse, Error<GetProjectError>>

Get the details of a project by project_id.

Examples found in repository?
examples/v2_case-management_GetProject.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_project("project_id".to_string()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

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.

source

pub async fn get_projects( &self, ) -> Result<ProjectsResponse, Error<GetProjectsError>>

Get all projects.

Examples found in repository?
examples/v2_case-management_GetProjects.rs (line 9)
6
7
8
9
10
11
12
13
14
15
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.get_projects().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn get_projects_with_http_info( &self, ) -> Result<ResponseContent<ProjectsResponse>, Error<GetProjectsError>>

Get all projects.

source

pub async fn search_cases( &self, params: SearchCasesOptionalParams, ) -> Result<CasesResponse, Error<SearchCasesError>>

Search cases.

Examples found in repository?
examples/v2_case-management_SearchCases.rs (line 10)
7
8
9
10
11
12
13
14
15
16
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.search_cases(SearchCasesOptionalParams::default()).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

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)
9
10
11
12
13
14
15
16
17
18
19
20
21
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let response = api.search_cases_with_pagination(SearchCasesOptionalParams::default());
    pin_mut!(response);
    while let Some(resp) = response.next().await {
        if let Ok(value) = resp {
            println!("{:#?}", value);
        } else {
            println!("{:#?}", resp.unwrap_err());
        }
    }
}
source

pub async fn search_cases_with_http_info( &self, params: SearchCasesOptionalParams, ) -> Result<ResponseContent<CasesResponse>, Error<SearchCasesError>>

Search cases.

source

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)
9
10
11
12
13
14
15
16
17
18
19
20
21
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.unarchive_case(case_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn unarchive_case_with_http_info( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<ResponseContent<CaseResponse>, Error<UnarchiveCaseError>>

Unarchive case

source

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)
9
10
11
12
13
14
15
16
17
18
19
20
21
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseEmptyRequest::new(CaseEmpty::new(CaseResourceType::CASE));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.unassign_case(case_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn unassign_case_with_http_info( &self, case_id: String, body: CaseEmptyRequest, ) -> Result<ResponseContent<CaseResponse>, Error<UnassignCaseError>>

Unassign case

source

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)
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseUpdatePriorityRequest::new(CaseUpdatePriority::new(
        CaseUpdatePriorityAttributes::new(CasePriority::P3),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.update_priority(case_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

pub async fn update_priority_with_http_info( &self, case_id: String, body: CaseUpdatePriorityRequest, ) -> Result<ResponseContent<CaseResponse>, Error<UpdatePriorityError>>

Update case priority

source

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)
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
async fn main() {
    // there is a valid "case" in the system
    let case_id = std::env::var("CASE_ID").unwrap();
    let body = CaseUpdateStatusRequest::new(CaseUpdateStatus::new(
        CaseUpdateStatusAttributes::new(CaseStatus::IN_PROGRESS),
        CaseResourceType::CASE,
    ));
    let configuration = datadog::Configuration::new();
    let api = CaseManagementAPI::with_config(configuration);
    let resp = api.update_status(case_id.clone(), body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}
source

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

source§

fn clone(&self) -> CaseManagementAPI

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CaseManagementAPI

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CaseManagementAPI

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more