/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 8c98b46e2414 */ 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 { IconConfig, IconConfig$inboundSchema } from "./iconconfig.js"; /** * The display configuration for a link. */ export type StructuredLink = { /** * The display name for the link */ name?: string | undefined; /** * The URL for the link. */ url?: string | undefined; /** * Defines how to render an icon */ iconConfig?: IconConfig | undefined; }; /** @internal */ export const StructuredLink$inboundSchema: z.ZodType< StructuredLink, z.ZodTypeDef, unknown > = z.object({ name: z.string().optional(), url: z.string().optional(), iconConfig: IconConfig$inboundSchema.optional(), }); export function structuredLinkFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => StructuredLink$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'StructuredLink' from JSON`, ); }