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