export type DeleteApiUsersUserIdCardsCardIdArgs = {user_id: number, card_id: number, replacement_id?: number | undefined}; export type DeleteApiUsersUserIdCardsCardIdOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve user cards * * DELETE /users/{user_id}/cards/{card_id} * * Also accepts auth: API-Key */ export const deleteApiUsersUserIdCardsCardId = async (args: DeleteApiUsersUserIdCardsCardIdArgs, options: DeleteApiUsersUserIdCardsCardIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.replacement_id != null) query.append("replacement_id", String(args.replacement_id)) if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/users/${encodeURIComponent(String(args.user_id))}/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 undefined };