export type CreateApiManagementUsersIdResetDeviceArgs = {id: string, 'Idempotency-Key'?: string | undefined}; export type CreateApiManagementUsersIdResetDeviceOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Resets device * * POST /management/users/{id}/reset_device */ export const createApiManagementUsersIdResetDevice = async (args: CreateApiManagementUsersIdResetDeviceArgs, options?: CreateApiManagementUsersIdResetDeviceOptions) => { const {baseUrl = "https://api.fireblocks.io/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['Idempotency-Key'] != null) headers.set("Idempotency-Key", String(args['Idempotency-Key'])) const url = `${baseUrl.replace(/\/+$/, '')}/management/users/${encodeURIComponent(String(args.id))}/reset_device${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 };