/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 87846762af20 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { smartUnion } from "../../types/smartUnion.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AgentsApiV1ConversationsGetRequest = { /** * ID of the conversation from which we are fetching metadata. */ conversationId: string; }; /** * Successful Response */ export type ResponseV1ConversationsGet = | components.ModelConversation | components.AgentConversation; /** @internal */ export type AgentsApiV1ConversationsGetRequest$Outbound = { conversation_id: string; }; /** @internal */ export const AgentsApiV1ConversationsGetRequest$outboundSchema: z.ZodType< AgentsApiV1ConversationsGetRequest$Outbound, AgentsApiV1ConversationsGetRequest > = z.object({ conversationId: z.string(), }).transform((v) => { return remap$(v, { conversationId: "conversation_id", }); }); export function agentsApiV1ConversationsGetRequestToJSON( agentsApiV1ConversationsGetRequest: AgentsApiV1ConversationsGetRequest, ): string { return JSON.stringify( AgentsApiV1ConversationsGetRequest$outboundSchema.parse( agentsApiV1ConversationsGetRequest, ), ); } /** @internal */ export const ResponseV1ConversationsGet$inboundSchema: z.ZodType< ResponseV1ConversationsGet, unknown > = smartUnion([ components.ModelConversation$inboundSchema, components.AgentConversation$inboundSchema, ]); export function responseV1ConversationsGetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ResponseV1ConversationsGet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ResponseV1ConversationsGet' from JSON`, ); }