/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { ChatControlDto, ChatControlDto$Outbound, ChatControlDto$outboundSchema, } from "./chatcontroldto.js"; /** * Control values for the Chat step. */ export type ChatStepUpsertDtoControlValues = ChatControlDto | { [k: string]: any; }; export type ChatStepUpsertDto = { /** * Database identifier of the step. Used for updating the step. */ id?: string | undefined; /** * Unique identifier for the step */ stepId?: string | undefined; /** * Name of the step */ name: string; /** * Type of the step */ type: "chat"; /** * Control values for the Chat step. */ controlValues?: ChatControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type ChatStepUpsertDtoControlValues$Outbound = | ChatControlDto$Outbound | { [k: string]: any }; /** @internal */ export const ChatStepUpsertDtoControlValues$outboundSchema: z.ZodType< ChatStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, ChatStepUpsertDtoControlValues > = z.union([ChatControlDto$outboundSchema, z.record(z.any())]); export function chatStepUpsertDtoControlValuesToJSON( chatStepUpsertDtoControlValues: ChatStepUpsertDtoControlValues, ): string { return JSON.stringify( ChatStepUpsertDtoControlValues$outboundSchema.parse( chatStepUpsertDtoControlValues, ), ); } /** @internal */ export type ChatStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "chat"; controlValues?: ChatControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const ChatStepUpsertDto$outboundSchema: z.ZodType< ChatStepUpsertDto$Outbound, z.ZodTypeDef, ChatStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("chat"), controlValues: z.union([ChatControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function chatStepUpsertDtoToJSON( chatStepUpsertDto: ChatStepUpsertDto, ): string { return JSON.stringify( ChatStepUpsertDto$outboundSchema.parse(chatStepUpsertDto), ); }