export type UpdateApiCardsCardIdUnblockArgs = {cardId: string, 'Accept-Version': string}; export type UpdateApiCardsCardIdUnblockOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unblock card * * PUT /cards/{cardId}/unblock */ export const updateApiCardsCardIdUnblock = async (args: UpdateApiCardsCardIdUnblockArgs, options?: UpdateApiCardsCardIdUnblockOptions) => { const {baseUrl = "https://sandbox.api.caas.reap.global", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Accept-Version'] != null) headers.set("Accept-Version", String(args['Accept-Version'])) if (ApiKeyAuth !== undefined) headers.set("x-reap-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/cards/${encodeURIComponent(String(args.cardId))}/unblock${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };