/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 3a8e7f2156db */ 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"; import { UgcType, UgcType$inboundSchema } from "./ugctype.js"; export type FavoriteInfo = { ugcType?: UgcType | undefined; /** * Opaque id of the UGC. */ id?: string | undefined; /** * Number of users this object has been favorited by. */ count?: number | undefined; /** * If the requesting user has favorited this object. */ favoritedByUser?: boolean | undefined; }; /** @internal */ export const FavoriteInfo$inboundSchema: z.ZodType< FavoriteInfo, z.ZodTypeDef, unknown > = z.object({ ugcType: UgcType$inboundSchema.optional(), id: z.string().optional(), count: z.number().int().optional(), favoritedByUser: z.boolean().optional(), }); export function favoriteInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FavoriteInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FavoriteInfo' from JSON`, ); }