export type CreateApiResourcesApplicantsApplicantIdStatusTestCompletedArgs = {applicantId: string, body: {reviewAnswer: 'GREEN' | 'RED', rejectLabels?: Array | undefined, reviewRejectType?: ('RETRY' | 'FINAL') | undefined, clientComment?: string | undefined, moderationComment?: string | undefined}}; export type CreateApiResourcesApplicantsApplicantIdStatusTestCompletedOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Simulate review response in Sandbox * * POST /resources/applicants/{applicantId}/status/testCompleted */ export const createApiResourcesApplicantsApplicantIdStatusTestCompleted = async (args: CreateApiResourcesApplicantsApplicantIdStatusTestCompletedArgs, options?: CreateApiResourcesApplicantsApplicantIdStatusTestCompletedOptions) => { const {baseUrl = "https://api.sumsub.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (sec0 !== undefined) headers.set("X-App-Token", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/resources/applicants/${encodeURIComponent(String(args.applicantId))}/status/testCompleted${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 };