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