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