uptrakit_openapi_client/
access_grants.rs1use crate::Result;
2use crate::UptrakitClient;
3use crate::types_impl::access_grants::{
4 AccessGrantResponse, CreateAccessGrantRequest, ListAccessGrantsQuery, UpdateAccessGrantRequest,
5};
6
7impl UptrakitClient {
8 pub async fn list_access_grants(
10 &self,
11 query: &ListAccessGrantsQuery,
12 ) -> Result<Vec<AccessGrantResponse>> {
13 self.get_with_query(crate::paths::access_grants::BASE, query)
14 .await
15 }
16
17 pub async fn get_access_grant(&self, id: &crate::Uuid) -> Result<AccessGrantResponse> {
19 self.get(&crate::paths::access_grants::by_id(id)).await
20 }
21
22 pub async fn create_access_grant(
24 &self,
25 req: &CreateAccessGrantRequest,
26 ) -> Result<AccessGrantResponse> {
27 self.post_json(crate::paths::access_grants::BASE, req).await
28 }
29
30 pub async fn update_access_grant(
32 &self,
33 id: &crate::Uuid,
34 req: &UpdateAccessGrantRequest,
35 ) -> Result<AccessGrantResponse> {
36 self.put_json(&crate::paths::access_grants::by_id(id), req)
37 .await
38 }
39
40 pub async fn delete_access_grant(&self, id: &crate::Uuid) -> Result<()> {
42 self.delete(&crate::paths::access_grants::by_id(id)).await
43 }
44}