/* * 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 { ThrottleControlDto, ThrottleControlDto$Outbound, ThrottleControlDto$outboundSchema, } from "./throttlecontroldto.js"; /** * Control values for the Throttle step. */ export type ThrottleStepUpsertDtoControlValues = ThrottleControlDto | { [k: string]: any; }; export type ThrottleStepUpsertDto = { /** * 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: "throttle"; /** * Control values for the Throttle step. */ controlValues?: ThrottleControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type ThrottleStepUpsertDtoControlValues$Outbound = | ThrottleControlDto$Outbound | { [k: string]: any }; /** @internal */ export const ThrottleStepUpsertDtoControlValues$outboundSchema: z.ZodType< ThrottleStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, ThrottleStepUpsertDtoControlValues > = z.union([ThrottleControlDto$outboundSchema, z.record(z.any())]); export function throttleStepUpsertDtoControlValuesToJSON( throttleStepUpsertDtoControlValues: ThrottleStepUpsertDtoControlValues, ): string { return JSON.stringify( ThrottleStepUpsertDtoControlValues$outboundSchema.parse( throttleStepUpsertDtoControlValues, ), ); } /** @internal */ export type ThrottleStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "throttle"; controlValues?: | ThrottleControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const ThrottleStepUpsertDto$outboundSchema: z.ZodType< ThrottleStepUpsertDto$Outbound, z.ZodTypeDef, ThrottleStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("throttle"), controlValues: z.union([ThrottleControlDto$outboundSchema, z.record(z.any())]) .optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function throttleStepUpsertDtoToJSON( throttleStepUpsertDto: ThrottleStepUpsertDto, ): string { return JSON.stringify( ThrottleStepUpsertDto$outboundSchema.parse(throttleStepUpsertDto), ); }