export type GetApiWorkspacesAuditLogsByWorkspaceWorkspaceIdArgs = {workspaceId: string, from?: number | undefined, to?: number | undefined}; export type GetApiWorkspacesAuditLogsByWorkspaceWorkspaceIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /workspaces/audit-logs/by-workspace/{workspaceId} */ export const getApiWorkspacesAuditLogsByWorkspaceWorkspaceId = async (args: GetApiWorkspacesAuditLogsByWorkspaceWorkspaceIdArgs, options?: GetApiWorkspacesAuditLogsByWorkspaceWorkspaceIdOptions) => { const {baseUrl = "https://api.octoperf.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.from != null) query.append("from", String(args.from)) if (args.to != null) query.append("to", String(args.to)) const url = `${baseUrl.replace(/\/+$/, '')}/workspaces/audit-logs/by-workspace/${encodeURIComponent(String(args.workspaceId))}${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 res.blob() };