/* * 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"; import { MemoryStoreVisibility, MemoryStoreVisibility$inboundSchema, MemoryStoreVisibility$outboundSchema, } from "./memorystorevisibility.js"; export type UpdateMemoryStoreRequest = { name?: string | undefined; description?: string | null | undefined; instructions?: string | null | undefined; visibility?: MemoryStoreVisibility | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const UpdateMemoryStoreRequest$inboundSchema: z.ZodType< UpdateMemoryStoreRequest, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), description: z.nullable(z.string()).optional(), instructions: z.nullable(z.string()).optional(), visibility: MemoryStoreVisibility$inboundSchema.optional(), metadata: z.record(z.string()).optional(), }); /** @internal */ export type UpdateMemoryStoreRequest$Outbound = { name?: string | undefined; description?: string | null | undefined; instructions?: string | null | undefined; visibility?: string | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const UpdateMemoryStoreRequest$outboundSchema: z.ZodType< UpdateMemoryStoreRequest$Outbound, z.ZodTypeDef, UpdateMemoryStoreRequest > = z.object({ name: z.string().optional(), description: z.nullable(z.string()).optional(), instructions: z.nullable(z.string()).optional(), visibility: MemoryStoreVisibility$outboundSchema.optional(), metadata: z.record(z.string()).optional(), }); export function updateMemoryStoreRequestToJSON( updateMemoryStoreRequest: UpdateMemoryStoreRequest, ): string { return JSON.stringify( UpdateMemoryStoreRequest$outboundSchema.parse(updateMemoryStoreRequest), ); } export function updateMemoryStoreRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateMemoryStoreRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateMemoryStoreRequest' from JSON`, ); }