/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 1484598bcc14 */ 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"; import { IconConfig, IconConfig$inboundSchema } from "./iconconfig.js"; export type FacetValue = { /** * The value that should be set in the FacetFilter when applying this filter to a search request. */ stringValue?: string | undefined; integerValue?: number | undefined; /** * An optional user-friendly label to display in place of the facet value. */ displayLabel?: string | undefined; /** * Defines how to render an icon */ iconConfig?: IconConfig | undefined; }; /** @internal */ export const FacetValue$inboundSchema: z.ZodType< FacetValue, z.ZodTypeDef, unknown > = z.object({ stringValue: z.string().optional(), integerValue: z.number().int().optional(), displayLabel: z.string().optional(), iconConfig: IconConfig$inboundSchema.optional(), }); export function facetValueFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FacetValue$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FacetValue' from JSON`, ); }