export type CreateApiV1MeCardsCardIdUnblockArgs = {cardId: number}; export type CreateApiV1MeCardsCardIdUnblockOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unblock a Fire debit card * * POST /v1/me/cards/{cardId}/unblock */ export const createApiV1MeCardsCardIdUnblock = async (args: CreateApiV1MeCardsCardIdUnblockArgs, options?: CreateApiV1MeCardsCardIdUnblockOptions) => { const {baseUrl = "https://api.fire.com/business", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/me/cards/${encodeURIComponent(String(args.cardId))}/unblock${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };