Skip to main content

systemprompt_cloud/api_client/
endpoints.rs

1//! Top-level API endpoints not specific to tenants.
2//!
3//! Copyright (c) systemprompt.io — Business Source License 1.1.
4//! See <https://systemprompt.io> for licensing details.
5
6use systemprompt_models::modules::ApiPaths;
7
8use super::CloudApiClient;
9use super::types::{ListResponse, Tenant, UserMeResponse};
10use crate::error::CloudResult;
11
12impl CloudApiClient {
13    pub async fn get_user(&self) -> CloudResult<UserMeResponse> {
14        self.get(ApiPaths::AUTH_ME).await
15    }
16
17    pub async fn list_tenants(&self) -> CloudResult<Vec<Tenant>> {
18        let response: ListResponse<Tenant> = self.get(ApiPaths::CLOUD_TENANTS).await?;
19        Ok(response.data)
20    }
21}