export type DeleteApiPaymentsCardsCardIdArgs = {card_id: string}; export type DeleteApiPaymentsCardsCardIdOptions = {baseUrl?: string | undefined, ApiKey?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete a Card * * DELETE /payments/cards/{card_id} */ export const deleteApiPaymentsCardsCardId = async (args: DeleteApiPaymentsCardsCardIdArgs, options?: DeleteApiPaymentsCardsCardIdOptions) => { const {baseUrl = "https://api.evervault.com", fetch: fetchFn = fetch, ApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (ApiKey !== undefined) headers.set('authorization', `Basic ${btoa(`${ApiKey.username}:${ApiKey.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/payments/cards/${encodeURIComponent(String(args.card_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };