Skip to main content

busbar_sf_rest/client/
limits.rs

1use tracing::instrument;
2
3use crate::error::Result;
4
5impl super::SalesforceRestClient {
6    /// Get API limits for the org.
7    #[instrument(skip(self))]
8    pub async fn limits(&self) -> Result<serde_json::Value> {
9        self.client.rest_get("limits").await.map_err(Into::into)
10    }
11
12    /// Get available API versions.
13    #[instrument(skip(self))]
14    pub async fn versions(&self) -> Result<Vec<super::ApiVersion>> {
15        let url = format!("{}/services/data", self.client.instance_url());
16        self.client.get_json(&url).await.map_err(Into::into)
17    }
18}