1use crate::client::EeroClient;
2use crate::error::Result;
3use crate::types::profile::{Profile, ProfileUpdate};
4
5impl EeroClient {
6 #[tracing::instrument(skip(self))]
8 pub async fn get_profiles(&self, network_id: u64) -> Result<Vec<Profile>> {
9 let url = self.url(&format!("/networks/{network_id}/profiles"));
10 self.get(&url).await
11 }
12
13 #[tracing::instrument(skip(self))]
15 pub async fn get_profile(&self, profile_url: &str) -> Result<Profile> {
16 let url = self.resource_url(profile_url);
17 self.get(&url).await
18 }
19
20 #[tracing::instrument(skip(self, update))]
22 pub async fn update_profile(
23 &self,
24 profile_url: &str,
25 update: &ProfileUpdate,
26 ) -> Result<Profile> {
27 let url = self.resource_url(profile_url);
28 self.put(&url, update).await
29 }
30}