/* * 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 { DigestControlDto, DigestControlDto$Outbound, DigestControlDto$outboundSchema, } from "./digestcontroldto.js"; /** * Control values for the Digest step. */ export type DigestStepUpsertDtoControlValues = DigestControlDto | { [k: string]: any; }; export type DigestStepUpsertDto = { /** * 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: "digest"; /** * Control values for the Digest step. */ controlValues?: DigestControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type DigestStepUpsertDtoControlValues$Outbound = | DigestControlDto$Outbound | { [k: string]: any }; /** @internal */ export const DigestStepUpsertDtoControlValues$outboundSchema: z.ZodType< DigestStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, DigestStepUpsertDtoControlValues > = z.union([DigestControlDto$outboundSchema, z.record(z.any())]); export function digestStepUpsertDtoControlValuesToJSON( digestStepUpsertDtoControlValues: DigestStepUpsertDtoControlValues, ): string { return JSON.stringify( DigestStepUpsertDtoControlValues$outboundSchema.parse( digestStepUpsertDtoControlValues, ), ); } /** @internal */ export type DigestStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "digest"; controlValues?: DigestControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const DigestStepUpsertDto$outboundSchema: z.ZodType< DigestStepUpsertDto$Outbound, z.ZodTypeDef, DigestStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("digest"), controlValues: z.union([DigestControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function digestStepUpsertDtoToJSON( digestStepUpsertDto: DigestStepUpsertDto, ): string { return JSON.stringify( DigestStepUpsertDto$outboundSchema.parse(digestStepUpsertDto), ); }