/* * 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 { PushControlDto, PushControlDto$Outbound, PushControlDto$outboundSchema, } from "./pushcontroldto.js"; /** * Control values for the Push step. */ export type PushStepUpsertDtoControlValues = PushControlDto | { [k: string]: any; }; export type PushStepUpsertDto = { /** * 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: "push"; /** * Control values for the Push step. */ controlValues?: PushControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type PushStepUpsertDtoControlValues$Outbound = | PushControlDto$Outbound | { [k: string]: any }; /** @internal */ export const PushStepUpsertDtoControlValues$outboundSchema: z.ZodType< PushStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, PushStepUpsertDtoControlValues > = z.union([PushControlDto$outboundSchema, z.record(z.any())]); export function pushStepUpsertDtoControlValuesToJSON( pushStepUpsertDtoControlValues: PushStepUpsertDtoControlValues, ): string { return JSON.stringify( PushStepUpsertDtoControlValues$outboundSchema.parse( pushStepUpsertDtoControlValues, ), ); } /** @internal */ export type PushStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "push"; controlValues?: PushControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const PushStepUpsertDto$outboundSchema: z.ZodType< PushStepUpsertDto$Outbound, z.ZodTypeDef, PushStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("push"), controlValues: z.union([PushControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function pushStepUpsertDtoToJSON( pushStepUpsertDto: PushStepUpsertDto, ): string { return JSON.stringify( PushStepUpsertDto$outboundSchema.parse(pushStepUpsertDto), ); }