export type GetApiGatewaysFundCreationFormArgs = {gateway_type?: string | undefined, auth_mode?: string | undefined, fund_id?: number | undefined}; export type GetApiGatewaysFundCreationFormOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get gateway creation form * * GET /gateways/fund_creation_form * * Also accepts auth: API-Key */ export const getApiGatewaysFundCreationForm = async (args: GetApiGatewaysFundCreationFormArgs, options: GetApiGatewaysFundCreationFormOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.gateway_type != null) query.append("gateway_type", String(args.gateway_type)) if (args.auth_mode != null) query.append("auth_mode", String(args.auth_mode)) if (args.fund_id != null) query.append("fund_id", String(args.fund_id)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/gateways/fund_creation_form${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 };