use crate::Result;
use crate::UptrakitClient;
use crate::types_impl::discovery_allowlist::{
CreateDiscoveryAllowlistEntryRequest, HostDiscoveryAllowlistEntry,
TenantDiscoveryAllowlistEntry,
};
use uuid::Uuid;
impl UptrakitClient {
pub async fn list_discovery_allowlist(&self) -> Result<Vec<TenantDiscoveryAllowlistEntry>> {
self.get(crate::paths::discovery_allowlist::BASE).await
}
pub async fn add_discovery_allowlist_entry(
&self,
req: &CreateDiscoveryAllowlistEntryRequest,
) -> Result<TenantDiscoveryAllowlistEntry> {
self.post_json(crate::paths::discovery_allowlist::BASE, req)
.await
}
pub async fn remove_discovery_allowlist_entry(&self, id: &Uuid) -> Result<()> {
self.delete(&crate::paths::discovery_allowlist::by_id(id))
.await
}
pub async fn list_host_discovery_allowlist(
&self,
host_id: &Uuid,
) -> Result<Vec<HostDiscoveryAllowlistEntry>> {
self.get(&crate::paths::discovery_allowlist::host_base(host_id))
.await
}
pub async fn add_host_discovery_allowlist_entry(
&self,
host_id: &Uuid,
req: &CreateDiscoveryAllowlistEntryRequest,
) -> Result<HostDiscoveryAllowlistEntry> {
self.post_json(&crate::paths::discovery_allowlist::host_base(host_id), req)
.await
}
pub async fn remove_host_discovery_allowlist_entry(
&self,
host_id: &Uuid,
entry_id: &Uuid,
) -> Result<()> {
self.delete(&crate::paths::discovery_allowlist::host_entry(
host_id, entry_id,
))
.await
}
}