/* * 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"; /** * Request schema for updating a response's metadata. */ export type UpdateResponseRequest = { /** * Set of 16 key-value pairs to update. Keys must be strings up to 64 characters, values must be strings up to 512 characters. */ metadata: { [k: string]: string }; }; /** @internal */ export const UpdateResponseRequest$inboundSchema: z.ZodType< UpdateResponseRequest, z.ZodTypeDef, unknown > = z.object({ metadata: z.record(z.string()), }); /** @internal */ export type UpdateResponseRequest$Outbound = { metadata: { [k: string]: string }; }; /** @internal */ export const UpdateResponseRequest$outboundSchema: z.ZodType< UpdateResponseRequest$Outbound, z.ZodTypeDef, UpdateResponseRequest > = z.object({ metadata: z.record(z.string()), }); export function updateResponseRequestToJSON( updateResponseRequest: UpdateResponseRequest, ): string { return JSON.stringify( UpdateResponseRequest$outboundSchema.parse(updateResponseRequest), ); } export function updateResponseRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateResponseRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateResponseRequest' from JSON`, ); }