export type SendOpenBankingEmailOpsPayload = {offer_id: unknown}; export type CreateApiOpsEndCustomersSendOpenBankingEmailArgs = {body: SendOpenBankingEmailOpsPayload}; export type CreateApiOpsEndCustomersSendOpenBankingEmailOptions = {baseUrl?: string | undefined, OAuth2TopiHeaderAuthorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send the open banking email * * POST /ops/end-customers/send-open-banking-email */ export const createApiOpsEndCustomersSendOpenBankingEmail = async (args: CreateApiOpsEndCustomersSendOpenBankingEmailArgs, options?: CreateApiOpsEndCustomersSendOpenBankingEmailOptions) => { const {baseUrl = "https://api.topi-staging.eu", fetch: fetchFn = fetch, OAuth2TopiHeaderAuthorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (OAuth2TopiHeaderAuthorization !== undefined) headers.set('authorization', `Bearer ${OAuth2TopiHeaderAuthorization}`) const url = `${baseUrl.replace(/\/+$/, '')}/ops/end-customers/send-open-banking-email${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };