export type ReportContentFormat = 'raw' | 'atlar.camt.053.001.02' | 'atlar.camt.053.001.03' | 'atlar.camt.053.001.04' | 'atlar.camt.053.001.08' | 'atlar.camt.053'; export type GetApiConnectivityV2betaConnectionsCidReportsIdContentArgs = {cid: string, id: string, format?: ReportContentFormat | undefined, externalIdAsEndToEndId?: boolean | undefined, forceStrict?: boolean | undefined}; export type GetApiConnectivityV2betaConnectionsCidReportsIdContentOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Get report content * * GET /connectivity/v2beta/connections/{cid}/reports/{id}/content */ export const getApiConnectivityV2betaConnectionsCidReportsIdContent = async (args: GetApiConnectivityV2betaConnectionsCidReportsIdContentArgs, options?: GetApiConnectivityV2betaConnectionsCidReportsIdContentOptions) => { const {baseUrl = "https://api.atlar.com", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/octet-stream") if (args.format != null) query.append("format", String(args.format)) if (args.externalIdAsEndToEndId != null) query.append("externalIdAsEndToEndId", String(args.externalIdAsEndToEndId)) if (args.forceStrict != null) query.append("forceStrict", String(args.forceStrict)) if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/connectivity/v2beta/connections/${encodeURIComponent(String(args.cid))}/reports/${encodeURIComponent(String(args.id))}/content${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 res.blob() };