// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { motionPutSensitivity, motionPutSensitivityRequest, motionPutSensitivityResponse, } from './motion-put-sensitivity'; /** * The shape of the model inside the application code - what the users use */ export const motionPut = z.object({ type_: z.string().optional(), enabled: z.boolean().optional(), sensitivity: motionPutSensitivity.optional(), }); /** * * @typedef {MotionPut} motionPut * @property {string} - Type of the supported resources (always `motion` here) * @property {boolean} - true when the sensor is activated, false when deactivated * @property {MotionPutSensitivity} */ export type MotionPut = 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 motionPutResponse = z .object({ type: z.string().optional(), enabled: z.boolean().optional(), sensitivity: motionPutSensitivityResponse.optional(), }) .transform((data) => ({ type_: data['type'], enabled: data['enabled'], sensitivity: data['sensitivity'], })); /** * 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 motionPutRequest = z .object({ type_: z.string().nullish(), enabled: z.boolean().nullish(), sensitivity: motionPutSensitivityRequest.nullish(), }) .transform((data) => ({ type: data['type_'], enabled: data['enabled'], sensitivity: data['sensitivity'], }));