export type CreateApiV1InformationRequestStatusChangedArgs = {body: {informationRequest: {id: string, auditId: string, oldStatus: 'NEEDS_EVIDENCE' | 'READY_FOR_AUDIT' | 'AUDITOR_APPROVED' | 'AUDITOR_FLAGGED', newStatus: 'NEEDS_EVIDENCE' | 'READY_FOR_AUDIT' | 'AUDITOR_APPROVED' | 'AUDITOR_FLAGGED'}}}; export type CreateApiV1InformationRequestStatusChangedOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Information request status changed * * POST /v1.information-request.status-changed */ export const createApiV1InformationRequestStatusChanged = async (args: CreateApiV1InformationRequestStatusChangedArgs, options?: CreateApiV1InformationRequestStatusChangedOptions) => { 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.information-request.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 };