// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { groupedLightPutType } from './grouped-light-put-type'; 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 { alert, alertRequest, alertResponse } from '../../common/alert'; import { signaling, signalingRequest, signalingResponse } from '../../common/signaling'; import { dynamics2, dynamics2Request, dynamics2Response } from '../../common/dynamics-2'; /** * The shape of the model inside the application code - what the users use */ export const groupedLightPut = z.object({ type_: groupedLightPutType.optional(), on: on.optional(), dimming: dimming.optional(), dimmingDelta: dimmingDelta.optional(), colorTemperature: colorTemperature.optional(), colorTemperatureDelta: colorTemperatureDelta.optional(), color: color.optional(), alert: alert.optional(), signaling: signaling.optional(), dynamics: dynamics2.optional(), }); /** * * @typedef {GroupedLightPut} groupedLightPut * @property {GroupedLightPutType} - Type of the supported resources (always `grouped_light` here) * @property {On} * @property {Dimming} * @property {DimmingDelta} * @property {ColorTemperature} * @property {ColorTemperatureDelta} * @property {Color} * @property {Alert} - Joined alert control * @property {Signaling} - Feature containing basic signaling properties. * @property {Dynamics2} */ export type GroupedLightPut = 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 groupedLightPutResponse = z .object({ type: groupedLightPutType.optional(), on: onResponse.optional(), dimming: dimmingResponse.optional(), dimming_delta: dimmingDeltaResponse.optional(), color_temperature: colorTemperatureResponse.optional(), color_temperature_delta: colorTemperatureDeltaResponse.optional(), color: colorResponse.optional(), alert: alertResponse.optional(), signaling: signalingResponse.optional(), dynamics: dynamics2Response.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'], alert: data['alert'], signaling: data['signaling'], dynamics: data['dynamics'], })); /** * 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 groupedLightPutRequest = z .object({ type_: groupedLightPutType.nullish(), on: onRequest.nullish(), dimming: dimmingRequest.nullish(), dimmingDelta: dimmingDeltaRequest.nullish(), colorTemperature: colorTemperatureRequest.nullish(), colorTemperatureDelta: colorTemperatureDeltaRequest.nullish(), color: colorRequest.nullish(), alert: alertRequest.nullish(), signaling: signalingRequest.nullish(), dynamics: dynamics2Request.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'], alert: data['alert'], signaling: data['signaling'], dynamics: data['dynamics'], }));