import { CreateTag } from './Resource'; import { ScreenOrientation } from './Device'; export type BatchTagOperation = | 'add' | 'remove_key' | 'remove_value' | 'overwrite'; type BatchDeviceSettingsType = { name: T['name']; payload: T['payload']; }; export type BatchPlaylist = BatchDeviceSettingsType<{ name: 'playlist'; payload: string; }>; export type BatchScreenDimensions = BatchDeviceSettingsType<{ name: 'screen_dimensions'; payload: string; }>; export type BatchTimezone = BatchDeviceSettingsType<{ name: 'timezone'; payload: string; }>; export type BatchOrientation = BatchDeviceSettingsType<{ name: 'orientation'; payload: ScreenOrientation; }>; export type BatchTag = { name: 'tags'; op: BatchTagOperation; payload: CreateTag; }; export type BatchSharing = BatchDeviceSettingsType<{ name: 'device_sharing' | 'revoke_sharing'; payload: string[]; }>; export type BatchDailyRestartReBoot = BatchDeviceSettingsType<{ name: 'daily_restart_time' | 'daily_reboot_time'; payload: string; }>; export type BatchActiveHours = BatchDeviceSettingsType<{ name: 'active_hours'; payload: { start: string; end: string; }; }>; export type BatchPublish = { name: 'publish'; }; export type BatchDeviceActions = | BatchPlaylist | BatchScreenDimensions | BatchTimezone | BatchOrientation | BatchTag | BatchSharing | BatchDailyRestartReBoot | BatchActiveHours | BatchPublish; export type BatchDeviceSettingsRequest = { device_ids: string[]; actions: BatchDeviceActions[]; }; export type BatchDeviceSettingsResponse = undefined; export type ActionStatusAction = | 'playlist' | 'screen_dimensions' | 'timezone' | 'orientation' | 'tags' | 'device_sharing' | 'revoke_sharing' | 'daily_restart_time' | 'daily_reboot_time' | 'active_hours' | 'publish'; export type ActionStatusStatus = 'in_progress' | 'completed' | 'error'; export type BatchActionStatusResponse = { action: ActionStatusAction; status: ActionStatusStatus; created_at: string; completed_at: string; message: string; }; export type BatchActionStatus = { action: ActionStatusAction; status: ActionStatusStatus; createdAt: string; completedAt: string; message: string; }; export type BatchDeviceStatusResponse = { device_id: string; profile_id: string; action_status: BatchActionStatusResponse[]; }; export type BatchDeviceStatus = { deviceId: string; profileId: string; actionStatus: BatchActionStatus[]; }; export type BatchDevicesStatusRequest = undefined; export type BatchDevicesStatusResponse = BatchDeviceStatusResponse[];