// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { on, onRequest, onResponse } from '../../common/on'; import { dimming, dimmingRequest, dimmingResponse } from '../../common/dimming'; import { dimmingDelta, dimmingDeltaRequest, dimmingDeltaResponse } from '../../common/dimming-delta'; import { colorTemperature, colorTemperatureRequest, colorTemperatureResponse } from '../../common/color-temperature'; import { colorTemperatureDelta, colorTemperatureDeltaRequest, colorTemperatureDeltaResponse, } from '../../common/color-temperature-delta'; import { color, colorRequest, colorResponse } from '../../common/color'; import { dynamics, dynamicsRequest, dynamicsResponse } from './dynamics'; import { alert, alertRequest, alertResponse } from '../../common/alert'; import { signaling, signalingRequest, signalingResponse } from '../../common/signaling'; import { lightPutMode } from './light-put-mode'; import { gradient, gradientRequest, gradientResponse } from '../../common/gradient'; import { effects, effectsRequest, effectsResponse } from './effects'; import { lightPutTimedEffects, lightPutTimedEffectsRequest, lightPutTimedEffectsResponse, } from './light-put-timed-effects'; import { powerup, powerupRequest, powerupResponse } from './powerup'; /** * The shape of the model inside the application code - what the users use */ export const lightPut = z.object({ type_: z.string().optional(), on: on.optional(), dimming: dimming.optional(), dimmingDelta: dimmingDelta.optional(), colorTemperature: colorTemperature.optional(), colorTemperatureDelta: colorTemperatureDelta.optional(), color: color.optional(), dynamics: dynamics.optional(), alert: alert.optional(), signaling: signaling.optional(), mode: lightPutMode.optional(), gradient: gradient.optional(), effects: effects.optional(), timedEffects: lightPutTimedEffects.optional(), powerup: powerup.optional(), }); /** * * @typedef {LightPut} lightPut * @property {string} - Type of the supported resources (always `light` here) * @property {On} * @property {Dimming} * @property {DimmingDelta} * @property {ColorTemperature} * @property {ColorTemperatureDelta} * @property {Color} * @property {Dynamics} * @property {Alert} - Joined alert control * @property {Signaling} - Feature containing basic signaling properties. * @property {LightPutMode} * @property {Gradient} - Basic feature containing gradient properties. * @property {Effects} - Basic feature containing effect properties. * @property {LightPutTimedEffects} - Basic feature containing timed effect properties. * @property {Powerup} - Feature containing properties to configure powerup behaviour of a lightsource. */ export type LightPut = 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 lightPutResponse = z .object({ type: z.string().optional(), on: onResponse.optional(), dimming: dimmingResponse.optional(), dimming_delta: dimmingDeltaResponse.optional(), color_temperature: colorTemperatureResponse.optional(), color_temperature_delta: colorTemperatureDeltaResponse.optional(), color: colorResponse.optional(), dynamics: dynamicsResponse.optional(), alert: alertResponse.optional(), signaling: signalingResponse.optional(), mode: lightPutMode.optional(), gradient: gradientResponse.optional(), effects: effectsResponse.optional(), timed_effects: lightPutTimedEffectsResponse.optional(), powerup: powerupResponse.optional(), }) .transform((data) => ({ type_: data['type'], on: data['on'], dimming: data['dimming'], dimmingDelta: data['dimming_delta'], colorTemperature: data['color_temperature'], colorTemperatureDelta: data['color_temperature_delta'], color: data['color'], dynamics: data['dynamics'], alert: data['alert'], signaling: data['signaling'], mode: data['mode'], gradient: data['gradient'], effects: data['effects'], timedEffects: data['timed_effects'], powerup: data['powerup'], })); /** * 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 lightPutRequest = z .object({ type_: z.string().nullish(), on: onRequest.nullish(), dimming: dimmingRequest.nullish(), dimmingDelta: dimmingDeltaRequest.nullish(), colorTemperature: colorTemperatureRequest.nullish(), colorTemperatureDelta: colorTemperatureDeltaRequest.nullish(), color: colorRequest.nullish(), dynamics: dynamicsRequest.nullish(), alert: alertRequest.nullish(), signaling: signalingRequest.nullish(), mode: lightPutMode.nullish(), gradient: gradientRequest.nullish(), effects: effectsRequest.nullish(), timedEffects: lightPutTimedEffectsRequest.nullish(), powerup: powerupRequest.nullish(), }) .transform((data) => ({ type: data['type_'], on: data['on'], dimming: data['dimming'], dimming_delta: data['dimmingDelta'], color_temperature: data['colorTemperature'], color_temperature_delta: data['colorTemperatureDelta'], color: data['color'], dynamics: data['dynamics'], alert: data['alert'], signaling: data['signaling'], mode: data['mode'], gradient: data['gradient'], effects: data['effects'], timed_effects: data['timedEffects'], powerup: data['powerup'], }));