/* * 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 { DelayControlDto, DelayControlDto$Outbound, DelayControlDto$outboundSchema, } from "./delaycontroldto.js"; /** * Control values for the Delay step. */ export type DelayStepUpsertDtoControlValues = DelayControlDto | { [k: string]: any; }; export type DelayStepUpsertDto = { /** * 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: "delay"; /** * Control values for the Delay step. */ controlValues?: DelayControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type DelayStepUpsertDtoControlValues$Outbound = | DelayControlDto$Outbound | { [k: string]: any }; /** @internal */ export const DelayStepUpsertDtoControlValues$outboundSchema: z.ZodType< DelayStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, DelayStepUpsertDtoControlValues > = z.union([DelayControlDto$outboundSchema, z.record(z.any())]); export function delayStepUpsertDtoControlValuesToJSON( delayStepUpsertDtoControlValues: DelayStepUpsertDtoControlValues, ): string { return JSON.stringify( DelayStepUpsertDtoControlValues$outboundSchema.parse( delayStepUpsertDtoControlValues, ), ); } /** @internal */ export type DelayStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "delay"; controlValues?: DelayControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const DelayStepUpsertDto$outboundSchema: z.ZodType< DelayStepUpsertDto$Outbound, z.ZodTypeDef, DelayStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("delay"), controlValues: z.union([DelayControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function delayStepUpsertDtoToJSON( delayStepUpsertDto: DelayStepUpsertDto, ): string { return JSON.stringify( DelayStepUpsertDto$outboundSchema.parse(delayStepUpsertDto), ); }