/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c850c4f7068a */ 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"; /** * Possible value of a specific parameter */ export type PossibleValue = { /** * Possible value */ value?: string | undefined; /** * User-friendly label associated with the value */ label?: string | undefined; }; /** @internal */ export const PossibleValue$inboundSchema: z.ZodType< PossibleValue, z.ZodTypeDef, unknown > = z.object({ value: z.string().optional(), label: z.string().optional(), }); /** @internal */ export type PossibleValue$Outbound = { value?: string | undefined; label?: string | undefined; }; /** @internal */ export const PossibleValue$outboundSchema: z.ZodType< PossibleValue$Outbound, z.ZodTypeDef, PossibleValue > = z.object({ value: z.string().optional(), label: z.string().optional(), }); export function possibleValueToJSON(possibleValue: PossibleValue): string { return JSON.stringify(PossibleValue$outboundSchema.parse(possibleValue)); } export function possibleValueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PossibleValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PossibleValue' from JSON`, ); }