/* * 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 { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const AgentRunWakeObject = { AgentRunWake: "agent.run.wake", } as const; export type AgentRunWakeObject = ClosedEnum; export type AgentRunWake = { object: AgentRunWakeObject; runId: string; gatewayResponseId: string; gatewayWake: { [k: string]: any }; }; /** @internal */ export const AgentRunWakeObject$inboundSchema: z.ZodNativeEnum< typeof AgentRunWakeObject > = z.nativeEnum(AgentRunWakeObject); /** @internal */ export const AgentRunWakeObject$outboundSchema: z.ZodNativeEnum< typeof AgentRunWakeObject > = AgentRunWakeObject$inboundSchema; /** @internal */ export const AgentRunWake$inboundSchema: z.ZodType< AgentRunWake, z.ZodTypeDef, unknown > = z.object({ object: AgentRunWakeObject$inboundSchema, run_id: z.string(), gateway_response_id: z.string(), gateway_wake: z.record(z.any()), }).transform((v) => { return remap$(v, { "run_id": "runId", "gateway_response_id": "gatewayResponseId", "gateway_wake": "gatewayWake", }); }); /** @internal */ export type AgentRunWake$Outbound = { object: string; run_id: string; gateway_response_id: string; gateway_wake: { [k: string]: any }; }; /** @internal */ export const AgentRunWake$outboundSchema: z.ZodType< AgentRunWake$Outbound, z.ZodTypeDef, AgentRunWake > = z.object({ object: AgentRunWakeObject$outboundSchema, runId: z.string(), gatewayResponseId: z.string(), gatewayWake: z.record(z.any()), }).transform((v) => { return remap$(v, { runId: "run_id", gatewayResponseId: "gateway_response_id", gatewayWake: "gateway_wake", }); }); export function agentRunWakeToJSON(agentRunWake: AgentRunWake): string { return JSON.stringify(AgentRunWake$outboundSchema.parse(agentRunWake)); } export function agentRunWakeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AgentRunWake$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AgentRunWake' from JSON`, ); }