/* * 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 { EmailControlDto, EmailControlDto$Outbound, EmailControlDto$outboundSchema, } from "./emailcontroldto.js"; /** * Control values for the Email step. */ export type EmailStepUpsertDtoControlValues = EmailControlDto | { [k: string]: any; }; export type EmailStepUpsertDto = { /** * 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: "email"; /** * Control values for the Email step. */ controlValues?: EmailControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type EmailStepUpsertDtoControlValues$Outbound = | EmailControlDto$Outbound | { [k: string]: any }; /** @internal */ export const EmailStepUpsertDtoControlValues$outboundSchema: z.ZodType< EmailStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, EmailStepUpsertDtoControlValues > = z.union([EmailControlDto$outboundSchema, z.record(z.any())]); export function emailStepUpsertDtoControlValuesToJSON( emailStepUpsertDtoControlValues: EmailStepUpsertDtoControlValues, ): string { return JSON.stringify( EmailStepUpsertDtoControlValues$outboundSchema.parse( emailStepUpsertDtoControlValues, ), ); } /** @internal */ export type EmailStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "email"; controlValues?: EmailControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const EmailStepUpsertDto$outboundSchema: z.ZodType< EmailStepUpsertDto$Outbound, z.ZodTypeDef, EmailStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("email"), controlValues: z.union([EmailControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function emailStepUpsertDtoToJSON( emailStepUpsertDto: EmailStepUpsertDto, ): string { return JSON.stringify( EmailStepUpsertDto$outboundSchema.parse(emailStepUpsertDto), ); }