/* * 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 { CustomControlDto, CustomControlDto$Outbound, CustomControlDto$outboundSchema, } from "./customcontroldto.js"; /** * Control values for the Custom step. */ export type CustomStepUpsertDtoControlValues = CustomControlDto | { [k: string]: any; }; export type CustomStepUpsertDto = { /** * 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: "custom"; /** * Control values for the Custom step. */ controlValues?: CustomControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type CustomStepUpsertDtoControlValues$Outbound = | CustomControlDto$Outbound | { [k: string]: any }; /** @internal */ export const CustomStepUpsertDtoControlValues$outboundSchema: z.ZodType< CustomStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, CustomStepUpsertDtoControlValues > = z.union([CustomControlDto$outboundSchema, z.record(z.any())]); export function customStepUpsertDtoControlValuesToJSON( customStepUpsertDtoControlValues: CustomStepUpsertDtoControlValues, ): string { return JSON.stringify( CustomStepUpsertDtoControlValues$outboundSchema.parse( customStepUpsertDtoControlValues, ), ); } /** @internal */ export type CustomStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "custom"; controlValues?: CustomControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const CustomStepUpsertDto$outboundSchema: z.ZodType< CustomStepUpsertDto$Outbound, z.ZodTypeDef, CustomStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("custom"), controlValues: z.union([CustomControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function customStepUpsertDtoToJSON( customStepUpsertDto: CustomStepUpsertDto, ): string { return JSON.stringify( CustomStepUpsertDto$outboundSchema.parse(customStepUpsertDto), ); }