export type CreateApiV1EvidenceStatusChangedArgs = {body: {evidence: {id: string, auditId: string, oldStatus: 'ACCEPTED' | 'FLAGGED' | 'INITIALIZED' | 'NA' | 'NOT_READY_FOR_AUDIT' | 'READY_FOR_AUDIT', newStatus: 'ACCEPTED' | 'FLAGGED' | 'INITIALIZED' | 'NA' | 'NOT_READY_FOR_AUDIT' | 'READY_FOR_AUDIT'}}}; export type CreateApiV1EvidenceStatusChangedOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Evidence status changed * * POST /v1.evidence.status-changed */ export const createApiV1EvidenceStatusChanged = async (args: CreateApiV1EvidenceStatusChangedArgs, options?: CreateApiV1EvidenceStatusChangedOptions) => { const {baseUrl = "https://api.vanta.com", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1.evidence.status-changed${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };