/* * 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 UpdateMemoryEntryRequest = { content: string; ifMatch?: string | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const UpdateMemoryEntryRequest$inboundSchema: z.ZodType< UpdateMemoryEntryRequest, z.ZodTypeDef, unknown > = z.object({ content: z.string(), if_match: z.string().optional(), metadata: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { "if_match": "ifMatch", }); }); /** @internal */ export type UpdateMemoryEntryRequest$Outbound = { content: string; if_match?: string | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const UpdateMemoryEntryRequest$outboundSchema: z.ZodType< UpdateMemoryEntryRequest$Outbound, z.ZodTypeDef, UpdateMemoryEntryRequest > = z.object({ content: z.string(), ifMatch: z.string().optional(), metadata: z.record(z.string()).optional(), }).transform((v) => { return remap$(v, { ifMatch: "if_match", }); }); 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`, ); }