async_openai_alt/
audit_logs.rs

1use serde::Serialize;
2
3use crate::{config::Config, error::OpenAIError, types::ListAuditLogsResponse, Client};
4
5/// Logs of user actions and configuration changes within this organization.
6/// To log events, you must activate logging in the [Organization Settings](https://platform.openai.com/settings/organization/general).
7/// Once activated, for security reasons, logging cannot be deactivated.
8pub struct AuditLogs<'c, C: Config> {
9    client: &'c Client<C>,
10}
11
12impl<'c, C: Config> AuditLogs<'c, C> {
13    pub fn new(client: &'c Client<C>) -> Self {
14        Self { client }
15    }
16
17    /// List user actions and configuration changes within this organization.
18    pub async fn get<Q>(&self, query: &Q) -> Result<ListAuditLogsResponse, OpenAIError>
19    where
20        Q: Serialize + ?Sized,
21    {
22        self.client
23            .get_with_query("/organization/audit_logs", query)
24            .await
25    }
26}