/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The 2-letter ISO 3166-1 code representing the continent associated with the location of the user. */ export const Continent = { Af: "AF", An: "AN", As: "AS", Eu: "EU", Na: "NA", Oc: "OC", Sa: "SA", } as const; /** * The 2-letter ISO 3166-1 code representing the continent associated with the location of the user. */ export type Continent = ClosedEnum; export type AnalyticsContinents = { /** * The 2-letter ISO 3166-1 code representing the continent associated with the location of the user. */ continent: Continent; /** * The number of clicks from this continent */ clicks: number; /** * The number of leads from this continent */ leads: number; /** * The number of sales from this continent */ sales: number; /** * The total amount of sales from this continent, in cents */ saleAmount: number; }; /** @internal */ export const Continent$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Continent); /** @internal */ export const AnalyticsContinents$inboundSchema: z.ZodType< AnalyticsContinents, z.ZodTypeDef, unknown > = z.object({ continent: Continent$inboundSchema, clicks: z.number().default(0), leads: z.number().default(0), sales: z.number().default(0), saleAmount: z.number().default(0), }); export function analyticsContinentsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AnalyticsContinents$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnalyticsContinents' from JSON`, ); }