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