/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type StreamAgentRunEventsRequest = { agentId: string; runId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; /** @internal */ export const StreamAgentRunEventsRequest$inboundSchema: z.ZodType< StreamAgentRunEventsRequest, z.ZodTypeDef, unknown > = z.object({ agent_id: z.string(), run_id: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "agent_id": "agentId", "run_id": "runId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type StreamAgentRunEventsRequest$Outbound = { agent_id: string; run_id: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const StreamAgentRunEventsRequest$outboundSchema: z.ZodType< StreamAgentRunEventsRequest$Outbound, z.ZodTypeDef, StreamAgentRunEventsRequest > = z.object({ agentId: z.string(), runId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { agentId: "agent_id", runId: "run_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function streamAgentRunEventsRequestToJSON( streamAgentRunEventsRequest: StreamAgentRunEventsRequest, ): string { return JSON.stringify( StreamAgentRunEventsRequest$outboundSchema.parse( streamAgentRunEventsRequest, ), ); } export function streamAgentRunEventsRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StreamAgentRunEventsRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StreamAgentRunEventsRequest' from JSON`, ); }