export type GetApiApiV1ServersIdAuditArgs = {id: unknown, start?: number | undefined, limit?: number | undefined}; export type GetApiApiV1ServersIdAuditOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Get Server Audit Log * * GET /api/v1/servers/{id}/audit */ export const getApiApiV1ServersIdAudit = async (args: GetApiApiV1ServersIdAuditArgs, options: GetApiApiV1ServersIdAuditOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.start != null) query.append("start", String(args.start)) if (args.limit != null) query.append("limit", String(args.limit)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/servers/${encodeURIComponent(String(args.id))}/audit${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };