uptrakit_openapi_client/
autodiscovery.rs1use crate::Result;
4use crate::UptrakitClient;
5use crate::types_impl::autodiscovery::{
6 CreateSoftwareIgnoreRequest, SoftwareIgnoreResponse, TriggerDiscoveryResponse,
7};
8use crate::types_impl::batch_actions::{BatchActionRequest, BatchActionResponse};
9use crate::types_impl::pagination::PaginatedResponse;
10use crate::types_impl::software_items::SoftwareItemResponse;
11use uuid::Uuid;
12
13#[derive(serde::Serialize)]
15pub struct ListIgnoresParams {
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub page: Option<u64>,
18 #[serde(skip_serializing_if = "Option::is_none")]
19 pub per_page: Option<u64>,
20}
21
22impl UptrakitClient {
23 pub async fn approve_software_item(&self, id: &Uuid) -> Result<SoftwareItemResponse> {
27 self.post_empty(&crate::paths::software_items::approve(id))
28 .await
29 }
30
31 pub async fn discover_host(&self, host_id: &Uuid) -> Result<TriggerDiscoveryResponse> {
33 self.post_empty(&crate::paths::hosts::discover(host_id))
34 .await
35 }
36
37 pub async fn discover_plugin_config(&self, id: &Uuid) -> Result<TriggerDiscoveryResponse> {
39 self.post_empty(&crate::paths::plugin_configs::discover(id))
40 .await
41 }
42
43 pub async fn list_software_ignores(
45 &self,
46 params: &ListIgnoresParams,
47 ) -> Result<PaginatedResponse<SoftwareIgnoreResponse>> {
48 self.get_with_query(crate::paths::autodiscovery::IGNORES, params)
49 .await
50 }
51
52 pub async fn create_software_ignore(
54 &self,
55 req: &CreateSoftwareIgnoreRequest,
56 ) -> Result<SoftwareIgnoreResponse> {
57 self.post_json(crate::paths::autodiscovery::IGNORES, req)
58 .await
59 }
60
61 pub async fn delete_software_ignore(&self, id: &Uuid) -> Result<()> {
63 self.delete(&crate::paths::autodiscovery::ignore_by_id(id))
64 .await
65 }
66
67 pub async fn batch_software_ignores(
71 &self,
72 req: &BatchActionRequest,
73 ) -> Result<BatchActionResponse> {
74 self.post_json(crate::paths::autodiscovery::BATCH, req)
75 .await
76 }
77}