// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { sceneRecallAction } from './scene-recall-action'; import { dimming, dimmingRequest, dimmingResponse } from '../../common/dimming'; /** * The shape of the model inside the application code - what the users use */ export const sceneRecall = z.object({ action: sceneRecallAction.optional(), duration: z.number().optional(), dimming: dimming.optional(), }); /** * * @typedef {SceneRecall} sceneRecall * @property {SceneRecallAction} - When writing active, the actions in the scene are executed on the target. dynamic_palette starts dynamic scene with colors in the Palette object. * @property {number} - Transition to the scene within the timeframe given by duration * @property {Dimming} */ export type SceneRecall = z.infer; /** * The shape of the model mapping from the api schema into the application shape. * Is equal to application shape if all property names match the api schema */ export const sceneRecallResponse = z .object({ action: sceneRecallAction.optional(), duration: z.number().optional(), dimming: dimmingResponse.optional(), }) .transform((data) => ({ action: data['action'], duration: data['duration'], dimming: data['dimming'], })); /** * The shape of the model mapping from the application shape into the api schema. * Is equal to application shape if all property names match the api schema */ export const sceneRecallRequest = z .object({ action: sceneRecallAction.nullish(), duration: z.number().nullish(), dimming: dimmingRequest.nullish() }) .transform((data) => ({ action: data['action'], duration: data['duration'], dimming: data['dimming'], }));