/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateMemoryEntryRequest = { path: string; content: string; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const CreateMemoryEntryRequest$inboundSchema: z.ZodType< CreateMemoryEntryRequest, z.ZodTypeDef, unknown > = z.object({ path: z.string(), content: z.string(), metadata: z.record(z.string()).optional(), }); /** @internal */ export type CreateMemoryEntryRequest$Outbound = { path: string; content: string; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const CreateMemoryEntryRequest$outboundSchema: z.ZodType< CreateMemoryEntryRequest$Outbound, z.ZodTypeDef, CreateMemoryEntryRequest > = z.object({ path: z.string(), content: z.string(), metadata: z.record(z.string()).optional(), }); 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`, ); }