/* * 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 { InAppControlDto, InAppControlDto$Outbound, InAppControlDto$outboundSchema, } from "./inappcontroldto.js"; /** * Control values for the In-App step. */ export type InAppStepUpsertDtoControlValues = InAppControlDto | { [k: string]: any; }; export type InAppStepUpsertDto = { /** * 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: "in_app"; /** * Control values for the In-App step. */ controlValues?: InAppControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type InAppStepUpsertDtoControlValues$Outbound = | InAppControlDto$Outbound | { [k: string]: any }; /** @internal */ export const InAppStepUpsertDtoControlValues$outboundSchema: z.ZodType< InAppStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, InAppStepUpsertDtoControlValues > = z.union([InAppControlDto$outboundSchema, z.record(z.any())]); export function inAppStepUpsertDtoControlValuesToJSON( inAppStepUpsertDtoControlValues: InAppStepUpsertDtoControlValues, ): string { return JSON.stringify( InAppStepUpsertDtoControlValues$outboundSchema.parse( inAppStepUpsertDtoControlValues, ), ); } /** @internal */ export type InAppStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "in_app"; controlValues?: InAppControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const InAppStepUpsertDto$outboundSchema: z.ZodType< InAppStepUpsertDto$Outbound, z.ZodTypeDef, InAppStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("in_app"), controlValues: z.union([InAppControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function inAppStepUpsertDtoToJSON( inAppStepUpsertDto: InAppStepUpsertDto, ): string { return JSON.stringify( InAppStepUpsertDto$outboundSchema.parse(inAppStepUpsertDto), ); }