/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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"; export type AnalyticsBrowsers = { /** * The name of the browser */ browser: string; /** * The number of clicks from this browser */ clicks: number; /** * The number of leads from this browser */ leads: number; /** * The number of sales from this browser */ sales: number; /** * The total amount of sales from this browser, in cents */ saleAmount: number; }; /** @internal */ export const AnalyticsBrowsers$inboundSchema: z.ZodType< AnalyticsBrowsers, z.ZodTypeDef, unknown > = z.object({ browser: z.string(), clicks: z.number().default(0), leads: z.number().default(0), sales: z.number().default(0), saleAmount: z.number().default(0), }); export function analyticsBrowsersFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AnalyticsBrowsers$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnalyticsBrowsers' from JSON`, ); }