pub struct ApiClient { /* private fields */ }Implementations§
Source§impl ApiClient
impl ApiClient
pub fn new(base_url: &str, api_key: Option<&str>) -> Self
pub async fn register_repo( &self, org_slug: &str, req: RegisterRepoRequest, ) -> Result<RegisterRepoResponse, Box<dyn Error>>
pub async fn device_start(&self) -> Result<DeviceAuthResponse, Box<dyn Error>>
pub async fn device_status( &self, token: &str, ) -> Result<DeviceStatusResponse, Box<dyn Error>>
pub async fn logout(&self) -> Result<(), Box<dyn Error>>
Sourcepub async fn get_me(&self) -> Result<MeResponse, GetMeError>
pub async fn get_me(&self) -> Result<MeResponse, GetMeError>
GET /api/v1/auth/me — validates the bearer token and returns user
identity. Used by tracevault status to distinguish “logged out”,
“expired token”, and “server unreachable”.
Sourcepub async fn list_my_orgs(&self) -> Result<Vec<OrgMembership>, GetMeError>
pub async fn list_my_orgs(&self) -> Result<Vec<OrgMembership>, GetMeError>
List the orgs the authenticated credential belongs to.
GET /api/v1/me/orgs. For a service-account key this is the service
user’s memberships; for a user session, the user’s orgs; for an
org-scoped key, an empty list.
pub async fn list_repos( &self, org_slug: &str, ) -> Result<Vec<RepoListItem>, Box<dyn Error>>
pub async fn get_agent_instructions( &self, org_slug: &str, repo_id: &Uuid, ) -> Result<AgentInstructionsResponse, Box<dyn Error>>
pub async fn verify_commits( &self, org_slug: &str, repo_id: &Uuid, req: CiVerifyRequest, ) -> Result<CiVerifyResponse, Box<dyn Error>>
pub async fn push_commit( &self, org_slug: &str, repo_id: &str, req: &CommitPushRequest, ) -> Result<CommitPushResponse, Box<dyn Error>>
pub async fn stream_event( &self, org_slug: &str, repo_id: &str, req: &StreamEventRequest, ) -> Result<StreamEventResponse, Box<dyn Error>>
pub async fn check_policies( &self, org_slug: &str, repo_id: &Uuid, req: CheckPoliciesRequest, ) -> Result<CheckPoliciesResponse, Box<dyn Error>>
Sourcepub async fn resolve_repo(
&self,
org_slug: &str,
git_url: &str,
) -> Result<Option<Uuid>, Box<dyn Error>>
pub async fn resolve_repo( &self, org_slug: &str, git_url: &str, ) -> Result<Option<Uuid>, Box<dyn Error>>
Resolve a git remote URL to a registered repo id within org_slug.
Ok(None) when the server has no matching repo (404). Used by
workspace/detached mode, which has no pinned repo_id in config.
Auto Trait Implementations§
impl !RefUnwindSafe for ApiClient
impl !UnwindSafe for ApiClient
impl Freeze for ApiClient
impl Send for ApiClient
impl Sync for ApiClient
impl Unpin for ApiClient
impl UnsafeUnpin for ApiClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more