export type Location = {city?: (string | null) | undefined, state?: (string | null) | undefined, county?: (string | null) | undefined, country?: (string | null) | undefined, postal_code?: (string | null) | undefined, address?: (string | null) | undefined, latitude?: (number | null) | undefined, longitude?: (number | null) | undefined, venue_id?: (number | null) | undefined}; export type Beacon = {distance?: (number | null) | undefined, calibration?: (number | null) | undefined, phone?: (string | null) | undefined, emailAddress?: (string | null) | undefined, website?: (string | null) | undefined, devices?: (Array | null) | undefined, rating?: (number | null) | undefined, uuid?: (string | null) | undefined, major?: (string | null) | undefined, minor?: (string | null) | undefined, notification_delay?: (number | null) | undefined, instance_id?: (string | null) | undefined, namespace?: (string | null) | undefined}; export type DeviceRequest = {name?: (string | null) | undefined, tags?: (string | null) | undefined, timeZone?: (string | null) | undefined, language_code?: (string | null) | undefined, group_id?: (string | null) | undefined, last_service?: (string | null) | undefined, mac_address?: (string | null) | undefined, location?: Location | undefined, beacon?: Beacon | undefined, notes?: (string | null) | undefined, serial_number?: (string | null) | undefined, screen_orientation?: (number | null) | undefined, is_audio_enabled?: (boolean | null) | undefined, is_outdoor?: (boolean | null) | undefined}; export type UpdateApiDevicesIdArgs = {id: string, body: DeviceRequest}; export type UpdateApiDevicesIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates a device. * * PUT /devices/{id} * * Also accepts auth: ApiKeyInHeader, ApiKeyInQuery */ export const updateApiDevicesId = async (args: UpdateApiDevicesIdArgs, options?: UpdateApiDevicesIdOptions) => { const {baseUrl = "https://api.reveldigital.com", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/devices/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };