export type GetApiOpenDataSubmissionsSCH000003589Args = {'x-api-key'?: string | undefined, jwt?: string | undefined}; export type GetApiOpenDataSubmissionsSCH000003589Options = {baseUrl: string, apikeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * All Submissions * * GET /open-data/submissions/SCH-000003589 */ export const getApiOpenDataSubmissionsSCH000003589 = async (args: GetApiOpenDataSubmissionsSCH000003589Args, options: GetApiOpenDataSubmissionsSCH000003589Options) => { const {baseUrl, fetch: fetchFn = fetch, apikeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) if (args.jwt != null) headers.set("jwt", String(args.jwt)) if (apikeyAuth !== undefined) headers.set('authorization', `apikey ${apikeyAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/open-data/submissions/SCH-000003589${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 };