export type GetApiApiV2EmailsExpertReportEmailIdArgs = {Authorization?: string | undefined, 'email-id': string}; export type GetApiApiV2EmailsExpertReportEmailIdOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Expert Report (Laudo Pericial) * * GET /api/v2/emails/expert-report/{email-id} */ export const getApiApiV2EmailsExpertReportEmailId = async (args: GetApiApiV2EmailsExpertReportEmailIdArgs, options?: GetApiApiV2EmailsExpertReportEmailIdOptions) => { const {baseUrl = "https://cloud-hom.bry.com.br", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/emails/expert-report/${encodeURIComponent(String(args['email-id']))}${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 (await res.json()) as unknown };