/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 4a4265122008 */ 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 CustomDataValue = { displayLabel?: string | undefined; stringValue?: string | undefined; /** * list of strings for multi-value properties */ stringListValue?: Array | undefined; numberValue?: number | undefined; booleanValue?: boolean | undefined; }; /** @internal */ export const CustomDataValue$inboundSchema: z.ZodType< CustomDataValue, z.ZodTypeDef, unknown > = z.object({ displayLabel: z.string().optional(), stringValue: z.string().optional(), stringListValue: z.array(z.string()).optional(), numberValue: z.number().optional(), booleanValue: z.boolean().optional(), }); /** @internal */ export type CustomDataValue$Outbound = { displayLabel?: string | undefined; stringValue?: string | undefined; stringListValue?: Array | undefined; numberValue?: number | undefined; booleanValue?: boolean | undefined; }; /** @internal */ export const CustomDataValue$outboundSchema: z.ZodType< CustomDataValue$Outbound, z.ZodTypeDef, CustomDataValue > = z.object({ displayLabel: z.string().optional(), stringValue: z.string().optional(), stringListValue: z.array(z.string()).optional(), numberValue: z.number().optional(), booleanValue: z.boolean().optional(), }); export function customDataValueToJSON( customDataValue: CustomDataValue, ): string { return JSON.stringify(CustomDataValue$outboundSchema.parse(customDataValue)); } export function customDataValueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomDataValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomDataValue' from JSON`, ); }