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