export type CreateApiV1QuestionnaireStatusChangedArgs = {body: {questionnaire: {id: string, status: 'APPROVED' | 'COMPLETE' | 'ERROR' | 'IN_PROGRESS' | 'IN_REVIEW' | 'EXTRACTING_QUESTIONS' | 'QUEUED_FOR_EXTRACTION' | 'PROCESSING' | 'QUEUED_FOR_PROCESSING' | 'READY_FOR_REVIEW' | 'WAITING_ON_ANSWERS' | 'WAITING_ON_COLUMN_SELECTION' | 'WAITING_ON_COLUMN_APPROVAL' | 'QUEUED_FOR_COLUMN_DETECTION' | 'DETECTING_COLUMNS' | 'ON_HOLD' | 'NO_LONGER_NEEDED'}}}; export type CreateApiV1QuestionnaireStatusChangedOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Questionnaire status changed * * POST /v1.questionnaire.status-changed */ export const createApiV1QuestionnaireStatusChanged = async (args: CreateApiV1QuestionnaireStatusChangedArgs, options?: CreateApiV1QuestionnaireStatusChangedOptions) => { 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.questionnaire.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 };