import { WorkspaceScopedResource, extractData } from './base.js';
export class AuditResource extends WorkspaceScopedResource {
    async list(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/audit', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    listAutoPaging(params) {
        return this.iterateOffsetPaginatedList((pageParams) => this.list(pageParams), (page) => page.events, params);
    }
    async getSummary(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/audit/summary', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    async getPhiAccess(params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/audit/phi-access', {
            params: { path: { workspace_id: this.workspaceId }, query: params },
        }));
    }
    getPhiAccessAutoPaging(params) {
        return this.iterateOffsetPaginatedList((pageParams) => this.getPhiAccess(pageParams), (page) => page.events, params);
    }
    async createExport(body) {
        return extractData(await this.client.POST('/v1/{workspace_id}/audit/export', {
            params: { path: { workspace_id: this.workspaceId } },
            body,
        }));
    }
    async listExports() {
        return extractData(await this.client.GET('/v1/{workspace_id}/audit/exports', {
            params: { path: { workspace_id: this.workspaceId } },
        }));
    }
    async getEntityAccessLog(entityId, params) {
        return extractData(await this.client.GET('/v1/{workspace_id}/audit/entity/{entity_id}/access-log', {
            params: { path: { workspace_id: this.workspaceId, entity_id: entityId }, query: params },
        }));
    }
    getEntityAccessLogAutoPaging(entityId, params) {
        return this.iterateOffsetPaginatedList((pageParams) => this.getEntityAccessLog(entityId, pageParams), (page) => page.events, params);
    }
}
//# sourceMappingURL=audit.js.map