/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: ac8ef7ed5d4f */ 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 { DigestUpdate, DigestUpdate$inboundSchema } from "./digestupdate.js"; import { SectionType, SectionType$inboundSchema } from "./sectiontype.js"; export type DigestSection = { /** * Unique identifier for the digest section. */ id: string; /** * Type of the section. This defines how the section should be interpreted and rendered in the digest. */ type: SectionType; /** * Human-readable name for the digest section. */ displayName?: string | undefined; /** * Name of the channel (applicable for CHANNEL type sections). Used to display in the frontend. */ channelName?: string | undefined; /** * Channel visibility/type for CHANNEL sections. For Slack this is typically one of * * @remarks * PublicChannel, PrivateChannel. Omit if not applicable or unknown. */ channelType?: string | undefined; /** * Instance identifier for the channel or workspace. Used for constructing channel URLs to display in the frontend. */ instanceId?: string | undefined; /** * Optional URL for the digest section. Should be populated only if the section is a CHANNEL type section. */ url?: string | undefined; /** * List of updates within this digest section. */ updates: Array; }; /** @internal */ export const DigestSection$inboundSchema: z.ZodType< DigestSection, z.ZodTypeDef, unknown > = z.object({ id: z.string(), type: SectionType$inboundSchema, displayName: z.string().optional(), channelName: z.string().optional(), channelType: z.string().optional(), instanceId: z.string().optional(), url: z.string().optional(), updates: z.array(DigestUpdate$inboundSchema), }); export function digestSectionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DigestSection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DigestSection' from JSON`, ); }