/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 1dbc9fe2d553 */ 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 Thumbnail = { /** * Photo id if the thumbnail is from splash. */ photoId?: string | undefined; /** * Thumbnail URL. This can be user provided image and/or from downloaded images hosted by Glean. */ url?: string | undefined; }; /** @internal */ export const Thumbnail$inboundSchema: z.ZodType< Thumbnail, z.ZodTypeDef, unknown > = z.object({ photoId: z.string().optional(), url: z.string().optional(), }); /** @internal */ export type Thumbnail$Outbound = { photoId?: string | undefined; url?: string | undefined; }; /** @internal */ export const Thumbnail$outboundSchema: z.ZodType< Thumbnail$Outbound, z.ZodTypeDef, Thumbnail > = z.object({ photoId: z.string().optional(), url: z.string().optional(), }); export function thumbnailToJSON(thumbnail: Thumbnail): string { return JSON.stringify(Thumbnail$outboundSchema.parse(thumbnail)); } export function thumbnailFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Thumbnail$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Thumbnail' from JSON`, ); }