// This file was generated by liblab | https://liblab.com/ import { z } from 'zod'; import { sceneGetType } from './scene-get-type'; import { resourceIdentifier, resourceIdentifierRequest, resourceIdentifierResponse } from './resource-identifier'; import { actionGet, actionGetRequest, actionGetResponse } from './action-get'; import { sceneMetadata, sceneMetadataRequest, sceneMetadataResponse } from './scene-metadata'; import { scenePalette, scenePaletteRequest, scenePaletteResponse } from './scene-palette'; import { sceneGetStatus, sceneGetStatusRequest, sceneGetStatusResponse } from './scene-get-status'; /** * The shape of the model inside the application code - what the users use */ export const sceneGet = z.object({ type_: sceneGetType.optional(), id: z .string() .regex(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) .optional(), idV1: z .string() .regex(/^(\/[a-z]{4,32}\/[0-9a-zA-Z-]{1,32})?$/) .optional(), owner: resourceIdentifier.optional(), actions: z.array(actionGet).optional(), metadata: sceneMetadata.optional(), group: resourceIdentifier.optional(), palette: scenePalette.optional(), speed: z.number().gte(0).lte(1).optional(), autoDynamic: z.boolean().optional(), status: sceneGetStatus.optional(), }); /** * * @typedef {SceneGet} sceneGet * @property {SceneGetType} * @property {string} - Unique identifier representing a specific resource instance * @property {string} - Clip v1 resource identifier * @property {ResourceIdentifier} * @property {ActionGet[]} - List of actions to be executed synchronously on recall * @property {SceneMetadata} * @property {ResourceIdentifier} * @property {ScenePalette} - Group of colors that describe the palette of colors to be used when playing dynamics * @property {number} - Speed of dynamic palette for this scene * @property {boolean} - Indicates whether to automatically start the scene dynamically on active recall * @property {SceneGetStatus} */ export type SceneGet = 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 sceneGetResponse = z .object({ type: sceneGetType.optional(), id: z .string() .regex(/^[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}$/) .optional(), id_v1: z .string() .regex(/^(\/[a-z]{4,32}\/[0-9a-zA-Z-]{1,32})?$/) .optional(), owner: resourceIdentifierResponse.optional(), actions: z.array(actionGetResponse).optional(), metadata: sceneMetadataResponse.optional(), group: resourceIdentifierResponse.optional(), palette: scenePaletteResponse.optional(), speed: z.number().gte(0).lte(1).optional(), auto_dynamic: z.boolean().optional(), status: sceneGetStatusResponse.optional(), }) .transform((data) => ({ type_: data['type'], id: data['id'], idV1: data['id_v1'], owner: data['owner'], actions: data['actions'], metadata: data['metadata'], group: data['group'], palette: data['palette'], speed: data['speed'], autoDynamic: data['auto_dynamic'], status: data['status'], })); /** * 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 sceneGetRequest = z .object({ type_: sceneGetType.nullish(), id: z.string().nullish(), idV1: z.string().nullish(), owner: resourceIdentifierRequest.nullish(), actions: z.array(actionGetRequest).nullish(), metadata: sceneMetadataRequest.nullish(), group: resourceIdentifierRequest.nullish(), palette: scenePaletteRequest.nullish(), speed: z.number().nullish(), autoDynamic: z.boolean().nullish(), status: sceneGetStatusRequest.nullish(), }) .transform((data) => ({ type: data['type_'], id: data['id'], id_v1: data['idV1'], owner: data['owner'], actions: data['actions'], metadata: data['metadata'], group: data['group'], palette: data['palette'], speed: data['speed'], auto_dynamic: data['autoDynamic'], status: data['status'], }));