/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { FieldValuePair, FieldValuePair$inboundSchema, } from "./fieldvaluepair.js"; export type CenseyeResult = { /** * Number of matching documents for this field-value combination. */ count: number; /** * The field-value pairs that were counted. */ fieldValuePairs: Array | null; }; /** @internal */ export const CenseyeResult$inboundSchema: z.ZodType< CenseyeResult, z.ZodTypeDef, unknown > = z.object({ count: z.number(), field_value_pairs: z.nullable(z.array(FieldValuePair$inboundSchema)), }).transform((v) => { return remap$(v, { "field_value_pairs": "fieldValuePairs", }); }); export function censeyeResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CenseyeResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CenseyeResult' from JSON`, ); }