// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { powerupPreset2 } from './powerup-preset-2'; import { powerupOn2, powerupOn2Request, powerupOn2Response } from './powerup-on-2'; import { powerupDimming2, powerupDimming2Request, powerupDimming2Response } from './powerup-dimming-2'; /** * The shape of the model inside the application code - what the users use */ export const powerup = z.object({ preset: powerupPreset2.optional(), configured: z.boolean().optional(), on: powerupOn2.optional(), dimming: powerupDimming2.optional(), }); /** * Feature containing properties to configure powerup behaviour of a lightsource. * @typedef {Powerup} powerup - Feature containing properties to configure powerup behaviour of a lightsource. - Feature containing properties to configure powerup behaviour of a lightsource. * @property {PowerupPreset2} - When setting the custom preset the additional properties can be set. For all other presets, no other properties can be included. * @property {boolean} - Indicates if the shown values have been configured in the lightsource. * @property {PowerupOn2} * @property {PowerupDimming2} */ export type Powerup = 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 powerupResponse = z .object({ preset: powerupPreset2.optional(), configured: z.boolean().optional(), on: powerupOn2Response.optional(), dimming: powerupDimming2Response.optional(), }) .transform((data) => ({ preset: data['preset'], configured: data['configured'], on: data['on'], 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 powerupRequest = z .object({ preset: powerupPreset2.nullish(), configured: z.boolean().nullish(), on: powerupOn2Request.nullish(), dimming: powerupDimming2Request.nullish(), }) .transform((data) => ({ preset: data['preset'], configured: data['configured'], on: data['on'], dimming: data['dimming'], }));