/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 5a5ded8564fd */ 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"; /** * A single configuration value, either a scalar or a list */ export type ConfigurationValue = { /** * The configuration value as a string. Only one of value or valueList should be populated. */ value?: string | undefined; /** * The configuration value as a list of strings. Only one of value or valueList should be populated. */ valueList?: Array | undefined; }; /** @internal */ export const ConfigurationValue$inboundSchema: z.ZodType< ConfigurationValue, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), valueList: z.array(z.string()).optional(), }); /** @internal */ export type ConfigurationValue$Outbound = { value?: string | undefined; valueList?: Array | undefined; }; /** @internal */ export const ConfigurationValue$outboundSchema: z.ZodType< ConfigurationValue$Outbound, z.ZodTypeDef, ConfigurationValue > = z.object({ value: z.string().optional(), valueList: z.array(z.string()).optional(), }); export function configurationValueToJSON( configurationValue: ConfigurationValue, ): string { return JSON.stringify( ConfigurationValue$outboundSchema.parse(configurationValue), ); } export function configurationValueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ConfigurationValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ConfigurationValue' from JSON`, ); }