/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 64f21b1cb4dd */ 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 DocumentSection = { /** * The title of the document section (e.g. the section header). */ title?: string | undefined; /** * The permalink of the document section. */ url?: string | undefined; }; /** @internal */ export const DocumentSection$inboundSchema: z.ZodType< DocumentSection, z.ZodTypeDef, unknown > = z.object({ title: z.string().optional(), url: z.string().optional(), }); /** @internal */ export type DocumentSection$Outbound = { title?: string | undefined; url?: string | undefined; }; /** @internal */ export const DocumentSection$outboundSchema: z.ZodType< DocumentSection$Outbound, z.ZodTypeDef, DocumentSection > = z.object({ title: z.string().optional(), url: z.string().optional(), }); export function documentSectionToJSON( documentSection: DocumentSection, ): string { return JSON.stringify(DocumentSection$outboundSchema.parse(documentSection)); } export function documentSectionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DocumentSection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DocumentSection' from JSON`, ); }