// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { resourceIdentifier, resourceIdentifierRequest, resourceIdentifierResponse } from './resource-identifier'; import { roomPutMetadata, roomPutMetadataRequest, roomPutMetadataResponse } from './room-put-metadata'; /** * The shape of the model inside the application code - what the users use */ export const roomPut = z.object({ type_: z.string().optional(), children: z.array(resourceIdentifier).optional(), metadata: roomPutMetadata.optional(), }); /** * * @typedef {RoomPut} roomPut * @property {string} - Type of the supported resources (always `room` here) * @property {ResourceIdentifier[]} - Child devices/services to group by the derived group * @property {RoomPutMetadata} - configuration object for a room */ export type RoomPut = 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 roomPutResponse = z .object({ type: z.string().optional(), children: z.array(resourceIdentifierResponse).optional(), metadata: roomPutMetadataResponse.optional(), }) .transform((data) => ({ type_: data['type'], children: data['children'], metadata: data['metadata'], })); /** * 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 roomPutRequest = z .object({ type_: z.string().nullish(), children: z.array(resourceIdentifierRequest).nullish(), metadata: roomPutMetadataRequest.nullish(), }) .transform((data) => ({ type: data['type_'], children: data['children'], metadata: data['metadata'], }));