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