// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { productArchetype } from '../../common/product-archetype'; /** * The shape of the model inside the application code - what the users use */ export const devicePutMetadata = z.object({ name: z.string().min(1).max(32).optional(), archetype: productArchetype.optional(), }); /** * * @typedef {DevicePutMetadata} devicePutMetadata * @property {string} - Human readable name of a resource * @property {ProductArchetype} - The default archetype given by manufacturer. Can be changed by user. */ export type DevicePutMetadata = 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 devicePutMetadataResponse = z .object({ name: z.string().min(1).max(32).optional(), archetype: productArchetype.optional(), }) .transform((data) => ({ name: data['name'], archetype: data['archetype'], })); /** * 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 devicePutMetadataRequest = z .object({ name: z.string().nullish(), archetype: productArchetype.nullish() }) .transform((data) => ({ name: data['name'], archetype: data['archetype'], }));