Skip to main content

uptrakit_openapi_client/
oauth_consents.rs

1//! End-user OAuth authorized-apps management (`/api/oauth/consents`).
2
3use crate::Result;
4use crate::UptrakitClient;
5use crate::types_impl::oauth::OAuthConsentResponse;
6use uuid::Uuid;
7
8impl UptrakitClient {
9    /// List the current user's active OAuth consents (newest-granted first).
10    pub async fn list_consents(&self) -> Result<Vec<OAuthConsentResponse>> {
11        self.get(crate::paths::oauth::CONSENTS).await
12    }
13
14    /// Revoke one of the current user's OAuth consents.
15    pub async fn revoke_consent(&self, id: &Uuid) -> Result<()> {
16        self.delete(&crate::paths::oauth::consent_by_id(id)).await
17    }
18}