/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export type GraphMemoryItem = { id?: string | undefined; memory?: string | undefined; userId?: string | undefined; agentId?: string | undefined; runId?: string | undefined; metadata?: { [k: string]: any } | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; relations?: Array<{ [k: string]: any }> | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const GraphMemoryItem$inboundSchema: z.ZodMiniType< GraphMemoryItem, unknown > = z.pipe( z.catchall( z.object({ id: types.optional(types.string()), memory: types.optional(types.string()), user_id: types.optional(types.string()), agent_id: types.optional(types.string()), run_id: types.optional(types.string()), metadata: types.optional(z.record(z.string(), z.any())), created_at: types.optional(types.string()), updated_at: types.optional(types.string()), relations: types.optional(z.array(z.record(z.string(), z.any()))), }), z.any(), ), z.transform((v) => { return remap$(v, { "user_id": "userId", "agent_id": "agentId", "run_id": "runId", "created_at": "createdAt", "updated_at": "updatedAt", }); }), ); export function graphMemoryItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GraphMemoryItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GraphMemoryItem' from JSON`, ); }