Skip to main content

async_openai/admin/
admin_.rs

1use crate::{
2    config::Config, AdminAPIKeys, AuditLogs, Certificates, Client, Groups, Invites,
3    OrganizationDataRetentions, OrganizationSpendAlerts, OrganizationSpendLimit, Projects, Roles,
4    Usage, Users,
5};
6
7/// Admin group for all administration APIs.
8/// This groups together admin API keys, invites, users, projects, audit logs, certificates, roles, and groups.
9pub struct Admin<'c, C: Config> {
10    client: &'c Client<C>,
11}
12
13impl<'c, C: Config> Admin<'c, C> {
14    /// Manage organization external encryption and decryption keys.
15    pub fn external_keys(&self) -> super::ExternalKeys<'_, C> {
16        super::ExternalKeys::new(self.client)
17    }
18    /// Manage customer-managed external storage.
19    pub fn external_storage(&self) -> super::ExternalStorage<'_, C> {
20        super::ExternalStorage::new(self.client)
21    }
22    pub(crate) fn new(client: &'c Client<C>) -> Self {
23        Self { client }
24    }
25
26    /// To call [AdminAPIKeys] group related APIs using this client.
27    pub fn api_keys(&self) -> AdminAPIKeys<'_, C> {
28        AdminAPIKeys::new(self.client)
29    }
30
31    /// To call [Invites] group related APIs using this client.
32    pub fn invites(&self) -> Invites<'_, C> {
33        Invites::new(self.client)
34    }
35
36    /// To call [Users] group related APIs using this client.
37    pub fn users(&self) -> Users<'_, C> {
38        Users::new(self.client)
39    }
40
41    /// To call [Projects] group related APIs using this client.
42    pub fn projects(&self) -> Projects<'_, C> {
43        Projects::new(self.client)
44    }
45
46    /// To call [AuditLogs] group related APIs using this client.
47    pub fn audit_logs(&self) -> AuditLogs<'_, C> {
48        AuditLogs::new(self.client)
49    }
50
51    /// To call [Certificates] group related APIs using this client.
52    pub fn certificates(&self) -> Certificates<'_, C> {
53        Certificates::new(self.client)
54    }
55
56    /// To call [Roles] group related APIs using this client.
57    pub fn roles(&self) -> Roles<'_, C> {
58        Roles::new(self.client)
59    }
60
61    /// To call [Groups] group related APIs using this client.
62    pub fn groups(&self) -> Groups<'_, C> {
63        Groups::new(self.client)
64    }
65
66    /// To call [Usage] group related APIs using this client.
67    pub fn usage(&self) -> Usage<'_, C> {
68        Usage::new(self.client)
69    }
70
71    /// Access data retention endpoints.
72    pub fn data_retention(&self) -> OrganizationDataRetentions<'_, C> {
73        OrganizationDataRetentions::new(self.client)
74    }
75
76    /// Access spend alerts endpoints.
77    pub fn spend_alerts(&self) -> OrganizationSpendAlerts<'_, C> {
78        OrganizationSpendAlerts::new(self.client)
79    }
80
81    /// Access spend limit endpoints.
82    pub fn spend_limit(&self) -> OrganizationSpendLimit<'_, C> {
83        OrganizationSpendLimit::new(self.client)
84    }
85}