/* * 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 { collectExtraKeys as collectExtraKeys$, safeParse, } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type WakeAgentRunRequestInput2 = { type?: string | undefined; additionalProperties?: { [k: string]: any } | undefined; }; export type WakeAgentRunRequestInput = | string | Array; export type WakeAgentRunRequest = { input: string | Array; }; /** @internal */ export const WakeAgentRunRequestInput2$inboundSchema: z.ZodType< WakeAgentRunRequestInput2, z.ZodTypeDef, unknown > = collectExtraKeys$( z.object({ type: z.string().optional(), }).catchall(z.any()), "additionalProperties", true, ); /** @internal */ export type WakeAgentRunRequestInput2$Outbound = { type?: string | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const WakeAgentRunRequestInput2$outboundSchema: z.ZodType< WakeAgentRunRequestInput2$Outbound, z.ZodTypeDef, WakeAgentRunRequestInput2 > = z.object({ type: z.string().optional(), additionalProperties: z.record(z.any()).optional(), }).transform((v) => { return { ...v.additionalProperties, ...remap$(v, { additionalProperties: null, }), }; }); export function wakeAgentRunRequestInput2ToJSON( wakeAgentRunRequestInput2: WakeAgentRunRequestInput2, ): string { return JSON.stringify( WakeAgentRunRequestInput2$outboundSchema.parse(wakeAgentRunRequestInput2), ); } export function wakeAgentRunRequestInput2FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WakeAgentRunRequestInput2$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WakeAgentRunRequestInput2' from JSON`, ); } /** @internal */ export const WakeAgentRunRequestInput$inboundSchema: z.ZodType< WakeAgentRunRequestInput, z.ZodTypeDef, unknown > = z.union([ z.string(), z.array(z.lazy(() => WakeAgentRunRequestInput2$inboundSchema)), ]); /** @internal */ export type WakeAgentRunRequestInput$Outbound = | string | Array; /** @internal */ export const WakeAgentRunRequestInput$outboundSchema: z.ZodType< WakeAgentRunRequestInput$Outbound, z.ZodTypeDef, WakeAgentRunRequestInput > = z.union([ z.string(), z.array(z.lazy(() => WakeAgentRunRequestInput2$outboundSchema)), ]); export function wakeAgentRunRequestInputToJSON( wakeAgentRunRequestInput: WakeAgentRunRequestInput, ): string { return JSON.stringify( WakeAgentRunRequestInput$outboundSchema.parse(wakeAgentRunRequestInput), ); } export function wakeAgentRunRequestInputFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WakeAgentRunRequestInput$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WakeAgentRunRequestInput' from JSON`, ); } /** @internal */ export const WakeAgentRunRequest$inboundSchema: z.ZodType< WakeAgentRunRequest, z.ZodTypeDef, unknown > = z.object({ input: z.union([ z.string(), z.array(z.lazy(() => WakeAgentRunRequestInput2$inboundSchema)), ]), }); /** @internal */ export type WakeAgentRunRequest$Outbound = { input: string | Array; }; /** @internal */ export const WakeAgentRunRequest$outboundSchema: z.ZodType< WakeAgentRunRequest$Outbound, z.ZodTypeDef, WakeAgentRunRequest > = z.object({ input: z.union([ z.string(), z.array(z.lazy(() => WakeAgentRunRequestInput2$outboundSchema)), ]), }); export function wakeAgentRunRequestToJSON( wakeAgentRunRequest: WakeAgentRunRequest, ): string { return JSON.stringify( WakeAgentRunRequest$outboundSchema.parse(wakeAgentRunRequest), ); } export function wakeAgentRunRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WakeAgentRunRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WakeAgentRunRequest' from JSON`, ); }