export type GetApiResourcesApplicantsApplicantIdInfoIdDocsArgs = {applicantId: string, forApprovedImages?: boolean | undefined, withDeletedImages?: boolean | undefined}; export type GetApiResourcesApplicantsApplicantIdInfoIdDocsOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get ID verification results * * GET /resources/applicants/{applicantId}/info/idDocs */ export const getApiResourcesApplicantsApplicantIdInfoIdDocs = async (args: GetApiResourcesApplicantsApplicantIdInfoIdDocsArgs, options?: GetApiResourcesApplicantsApplicantIdInfoIdDocsOptions) => { const {baseUrl = "https://api.sumsub.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.forApprovedImages != null) query.append("forApprovedImages", String(args.forApprovedImages)) if (args.withDeletedImages != null) query.append("withDeletedImages", String(args.withDeletedImages)) if (sec0 !== undefined) headers.set("X-App-Token", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/resources/applicants/${encodeURIComponent(String(args.applicantId))}/info/idDocs${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 undefined };