export type TokenTypeValue = {type: string, value: string}; export type DeleteApiAccountsAidCustomersTokensEventsArgs = {aid: unknown, body: {token: TokenTypeValue, event?: ({event?: string | undefined, metadata?: Record | undefined}) | undefined}}; export type DeleteApiAccountsAidCustomersTokensEventsOptions = {baseUrl?: string | undefined, JWT?: string | undefined, fetch?: typeof fetch | undefined}; /** * aid_customers_tokens_events_delete * * DELETE /accounts/{aid}/customers/tokens/events */ export const deleteApiAccountsAidCustomersTokensEvents = async (args: DeleteApiAccountsAidCustomersTokensEventsArgs, options?: DeleteApiAccountsAidCustomersTokensEventsOptions) => { const {baseUrl = "https://api.dintero.com/v1", fetch: fetchFn = fetch, JWT} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (JWT !== undefined) headers.set('authorization', `Bearer ${JWT}`) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/${encodeURIComponent(String(args.aid))}/customers/tokens/events${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };