Struct CaseManagementAPI

Source
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)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CaseManagementAPI::with_config(configuration);
9    let resp = api.get_projects().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
More examples
Hide additional examples
examples/v2_case-management_GetProject.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CaseManagementAPI::with_config(configuration);
9    let resp = api.get_project("project_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_case-management_DeleteProject.rs (line 8)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CaseManagementAPI::with_config(configuration);
9    let resp = api.delete_project("project_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
examples/v2_case-management_SearchCases.rs (line 9)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = CaseManagementAPI::with_config(configuration);
10    let resp = api.search_cases(SearchCasesOptionalParams::default()).await;
11    if let Ok(value) = resp {
12        println!("{:#?}", value);
13    } else {
14        println!("{:#?}", resp.unwrap_err());
15    }
16}
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}
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)
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}
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)
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}
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)
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}
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)
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}
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)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CaseManagementAPI::with_config(configuration);
9    let resp = api.delete_project("project_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
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)
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}
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)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CaseManagementAPI::with_config(configuration);
9    let resp = api.get_project("project_id".to_string()).await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
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)
6async fn main() {
7    let configuration = datadog::Configuration::new();
8    let api = CaseManagementAPI::with_config(configuration);
9    let resp = api.get_projects().await;
10    if let Ok(value) = resp {
11        println!("{:#?}", value);
12    } else {
13        println!("{:#?}", resp.unwrap_err());
14    }
15}
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)
7async fn main() {
8    let configuration = datadog::Configuration::new();
9    let api = CaseManagementAPI::with_config(configuration);
10    let resp = api.search_cases(SearchCasesOptionalParams::default()).await;
11    if let Ok(value) = resp {
12        println!("{:#?}", value);
13    } else {
14        println!("{:#?}", resp.unwrap_err());
15    }
16}
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)
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}
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)
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}
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)
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}
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)
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}
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)
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}
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 duplicate 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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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
Source§

impl<T> ErasedDestructor for T
where T: 'static,