/* * 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 PartnerAnalyticsTopLinks = { /** * The unique ID of the short link * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ link: string; /** * The unique ID of the short link */ id: string; /** * The domain of the short link */ domain: string; /** * The key of the short link */ key: string; /** * The short link URL */ shortLink: string; /** * The destination URL of the short link */ url: string; /** * The custom link preview title (og:title) */ title?: string | null | undefined; /** * The comments of the short link */ comments?: string | null | undefined; /** * The ID of the folder that the link belongs to (if applicable) */ folderId?: string | null | undefined; /** * The ID of the partner that the link belongs to (if applicable) */ partnerId?: string | null | undefined; /** * The creation timestamp of the short link */ createdAt: string; /** * The number of clicks from this link */ clicks: number; /** * The number of leads from this link */ leads: number; /** * The number of sales from this link */ sales: number; /** * The total amount of sales from this link, in cents */ saleAmount: number; earnings: number; }; /** @internal */ export const PartnerAnalyticsTopLinks$inboundSchema: z.ZodType< PartnerAnalyticsTopLinks, z.ZodTypeDef, unknown > = z.object({ link: z.string(), id: z.string(), domain: z.string(), key: z.string(), shortLink: z.string(), url: z.string(), title: z.nullable(z.string()).optional(), comments: z.nullable(z.string()).optional(), folderId: z.nullable(z.string()).optional(), partnerId: z.nullable(z.string()).optional(), createdAt: 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 partnerAnalyticsTopLinksFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PartnerAnalyticsTopLinks$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PartnerAnalyticsTopLinks' from JSON`, ); }