export type GetApiResourceA1A2A3A4A5Args = {a1: string, a2: string, a3: string, a4: string, a5: string}; export type GetApiResourceA1A2A3A4A5Options = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Return the contents of release-note-assets s3 bucket * * GET /resource/{a1}/{a2}/{a3}/{a4}/{a5} */ export const getApiResourceA1A2A3A4A5 = async (args: GetApiResourceA1A2A3A4A5Args, options: GetApiResourceA1A2A3A4A5Options) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/resource/${encodeURIComponent(String(args.a1))}/${encodeURIComponent(String(args.a2))}/${encodeURIComponent(String(args.a3))}/${encodeURIComponent(String(args.a4))}/${encodeURIComponent(String(args.a5))}${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 };