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