export type DeleteApiCardsCardIdArgs = {cardId: string, 'X-Amzn-Trace-Id'?: string | undefined}; export type DeleteApiCardsCardIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a card * * DELETE /cards/{cardId} */ export const deleteApiCardsCardId = async (args: DeleteApiCardsCardIdArgs, options?: DeleteApiCardsCardIdOptions) => { const {baseUrl = "https://api.test.bictorys.com/pay/v1", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Amzn-Trace-Id'] != null) headers.set("X-Amzn-Trace-Id", String(args['X-Amzn-Trace-Id'])) if (ApiKeyAuth !== undefined) headers.set("X-API-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/cards/${encodeURIComponent(String(args.cardId))}${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 };