/* * 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 { HttpRequestControlDto, HttpRequestControlDto$Outbound, HttpRequestControlDto$outboundSchema, } from "./httprequestcontroldto.js"; /** * Control values for the HTTP Request step. */ export type HttpRequestStepUpsertDtoControlValues = HttpRequestControlDto | { [k: string]: any; }; export type HttpRequestStepUpsertDto = { /** * 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: "http_request"; /** * Control values for the HTTP Request step. */ controlValues?: HttpRequestControlDto | { [k: string]: any } | undefined; }; /** @internal */ export type HttpRequestStepUpsertDtoControlValues$Outbound = | HttpRequestControlDto$Outbound | { [k: string]: any }; /** @internal */ export const HttpRequestStepUpsertDtoControlValues$outboundSchema: z.ZodType< HttpRequestStepUpsertDtoControlValues$Outbound, z.ZodTypeDef, HttpRequestStepUpsertDtoControlValues > = z.union([HttpRequestControlDto$outboundSchema, z.record(z.any())]); export function httpRequestStepUpsertDtoControlValuesToJSON( httpRequestStepUpsertDtoControlValues: HttpRequestStepUpsertDtoControlValues, ): string { return JSON.stringify( HttpRequestStepUpsertDtoControlValues$outboundSchema.parse( httpRequestStepUpsertDtoControlValues, ), ); } /** @internal */ export type HttpRequestStepUpsertDto$Outbound = { _id?: string | undefined; stepId?: string | undefined; name: string; type: "http_request"; controlValues?: | HttpRequestControlDto$Outbound | { [k: string]: any } | undefined; }; /** @internal */ export const HttpRequestStepUpsertDto$outboundSchema: z.ZodType< HttpRequestStepUpsertDto$Outbound, z.ZodTypeDef, HttpRequestStepUpsertDto > = z.object({ id: z.string().optional(), stepId: z.string().optional(), name: z.string(), type: z.literal("http_request"), controlValues: z.union([ HttpRequestControlDto$outboundSchema, z.record(z.any()), ]).optional(), }).transform((v) => { return remap$(v, { id: "_id", }); }); export function httpRequestStepUpsertDtoToJSON( httpRequestStepUpsertDto: HttpRequestStepUpsertDto, ): string { return JSON.stringify( HttpRequestStepUpsertDto$outboundSchema.parse(httpRequestStepUpsertDto), ); }