/* * 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 PartnerAnalyticsTimeseries = { /** * The starting timestamp of the interval */ start: string; /** * The number of clicks in the interval */ clicks: number; /** * The number of leads in the interval */ leads: number; /** * The number of sales in the interval */ sales: number; /** * The total amount of sales in the interval, in cents */ saleAmount: number; earnings: number; }; /** @internal */ export const PartnerAnalyticsTimeseries$inboundSchema: z.ZodType< PartnerAnalyticsTimeseries, z.ZodTypeDef, unknown > = z.object({ start: z.string(), clicks: z.number().default(0), leads: z.number().default(0), sales: z.number().default(0), saleAmount: z.number().default(0), earnings: z.number().default(0), }); export function partnerAnalyticsTimeseriesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartnerAnalyticsTimeseries$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartnerAnalyticsTimeseries' from JSON`, ); }