/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CountAggregation = { func: "count"; }; /** @internal */ export const CountAggregation$inboundSchema: z.ZodMiniType< CountAggregation, unknown > = z.object({ func: z.literal("count"), }); /** @internal */ export type CountAggregation$Outbound = { func: "count"; }; /** @internal */ export const CountAggregation$outboundSchema: z.ZodMiniType< CountAggregation$Outbound, CountAggregation > = z.object({ func: z.literal("count"), }); export function countAggregationToJSON( countAggregation: CountAggregation, ): string { return JSON.stringify( CountAggregation$outboundSchema.parse(countAggregation), ); } export function countAggregationFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CountAggregation$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CountAggregation' from JSON`, ); }