/* * 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 AnalyticsCities = { /** * The 2-letter ISO 3166-1 country code of the country where this city is located. Learn more: https://d.to/geo */ country: string; /** * The 2-letter ISO 3166-2 region code representing the region associated with the location of the user. */ region: string; /** * The name of the city */ city: string; /** * The number of clicks from this city */ clicks: number; /** * The number of leads from this city */ leads: number; /** * The number of sales from this city */ sales: number; /** * The total amount of sales from this city, in cents */ saleAmount: number; }; /** @internal */ export const AnalyticsCities$inboundSchema: z.ZodType< AnalyticsCities, z.ZodTypeDef, unknown > = z.object({ country: z.string(), region: z.string(), city: z.string(), clicks: z.number().default(0), leads: z.number().default(0), sales: z.number().default(0), saleAmount: z.number().default(0), }); export function analyticsCitiesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AnalyticsCities$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AnalyticsCities' from JSON`, ); }