/* * 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 Update = { /** * Set of 16 key-value pairs to update. */ metadata: { [k: string]: string }; }; /** @internal */ export const Update$inboundSchema: z.ZodType = z .object({ metadata: z.record(z.string()), }); /** @internal */ export type Update$Outbound = { metadata: { [k: string]: string }; }; /** @internal */ export const Update$outboundSchema: z.ZodType< Update$Outbound, z.ZodTypeDef, Update > = z.object({ metadata: z.record(z.string()), }); export function updateToJSON(update: Update): string { return JSON.stringify(Update$outboundSchema.parse(update)); } export function updateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Update$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Update' from JSON`, ); }