export type PatchApiControllerWiegandConnectionsIdArgs = {id: number, body: {controller_wiegand_connection: {name?: (string | null) | undefined, virtual_card_format_name?: ('null' | 'hid_h10301' | 'hid_h10302' | 'hid_h10304' | 'em_410x_26' | 'em_410x_32_34' | 'keyscan_c15001' | 'hid_d10202' | null) | undefined, virtual_card_card_number?: (number | null) | undefined, virtual_card_facility_code?: (number | null) | undefined, virtual_card_card_id?: (number | null) | undefined, virtual_card_oem?: (number | null) | undefined, virtual_card_uid?: (string | null) | undefined, virtual_card_length?: (number | null) | undefined}}}; export type PatchApiControllerWiegandConnectionsIdOptions = {baseUrl?: string | undefined, KisiLogin?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a controller wiegand connection * * PATCH /controller_wiegand_connections/{id} * * Also accepts auth: OAuth2 */ export const patchApiControllerWiegandConnectionsId = async (args: PatchApiControllerWiegandConnectionsIdArgs, options?: PatchApiControllerWiegandConnectionsIdOptions) => { const {baseUrl = "https://api.kisi.io", fetch: fetchFn = fetch, KisiLogin} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (KisiLogin !== undefined) headers.set("Authorization", KisiLogin) const url = `${baseUrl.replace(/\/+$/, '')}/controller_wiegand_connections/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };