Skip to main content

unifly_api/integration/client/
reference.rs

1use uuid::Uuid;
2
3use super::{Error, IntegrationClient, types};
4
5impl IntegrationClient {
6    // ── VPN (read-only) ──────────────────────────────────────────────
7
8    pub async fn list_vpn_servers(
9        &self,
10        site_id: &Uuid,
11        offset: i64,
12        limit: i32,
13    ) -> Result<types::Page<types::VpnServerResponse>, Error> {
14        self.get_with_params(
15            &format!("v1/sites/{site_id}/vpn/servers"),
16            &[("offset", offset.to_string()), ("limit", limit.to_string())],
17        )
18        .await
19    }
20
21    pub async fn list_vpn_tunnels(
22        &self,
23        site_id: &Uuid,
24        offset: i64,
25        limit: i32,
26    ) -> Result<types::Page<types::VpnTunnelResponse>, Error> {
27        self.get_with_params(
28            &format!("v1/sites/{site_id}/vpn/site-to-site-tunnels"),
29            &[("offset", offset.to_string()), ("limit", limit.to_string())],
30        )
31        .await
32    }
33
34    // ── WAN (read-only) ──────────────────────────────────────────────
35
36    pub async fn list_wans(
37        &self,
38        site_id: &Uuid,
39        offset: i64,
40        limit: i32,
41    ) -> Result<types::Page<types::WanResponse>, Error> {
42        self.get_with_params(
43            &format!("v1/sites/{site_id}/wans"),
44            &[("offset", offset.to_string()), ("limit", limit.to_string())],
45        )
46        .await
47    }
48
49    // ── DPI (read-only) ──────────────────────────────────────────────
50
51    pub async fn list_dpi_categories(
52        &self,
53        _site_id: &Uuid,
54        offset: i64,
55        limit: i32,
56    ) -> Result<types::Page<types::DpiCategoryResponse>, Error> {
57        self.get_with_params(
58            "v1/dpi/categories",
59            &[("offset", offset.to_string()), ("limit", limit.to_string())],
60        )
61        .await
62    }
63
64    pub async fn list_dpi_applications(
65        &self,
66        _site_id: &Uuid,
67        offset: i64,
68        limit: i32,
69    ) -> Result<types::Page<types::DpiApplicationResponse>, Error> {
70        self.get_with_params(
71            "v1/dpi/applications",
72            &[("offset", offset.to_string()), ("limit", limit.to_string())],
73        )
74        .await
75    }
76
77    // ── RADIUS (read-only) ───────────────────────────────────────────
78
79    pub async fn list_radius_profiles(
80        &self,
81        site_id: &Uuid,
82        offset: i64,
83        limit: i32,
84    ) -> Result<types::Page<types::RadiusProfileResponse>, Error> {
85        self.get_with_params(
86            &format!("v1/sites/{site_id}/radius/profiles"),
87            &[("offset", offset.to_string()), ("limit", limit.to_string())],
88        )
89        .await
90    }
91
92    // ── Countries (no site scope) ────────────────────────────────────
93
94    pub async fn list_countries(
95        &self,
96        offset: i64,
97        limit: i32,
98    ) -> Result<types::Page<types::CountryResponse>, Error> {
99        self.get_with_params(
100            "v1/countries",
101            &[("offset", offset.to_string()), ("limit", limit.to_string())],
102        )
103        .await
104    }
105}