/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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 { SeverityLevelEnum, SeverityLevelEnum$inboundSchema, } from "./severitylevelenum.js"; export type NotificationWorkflowDto = { /** * Unique identifier of the workflow */ id: string; /** * Workflow identifier used for triggering */ identifier: string; /** * Human-readable name of the workflow */ name: string; /** * Whether this workflow is marked as critical */ critical: boolean; /** * Tags associated with the workflow */ tags?: Array | undefined; /** * Custom data associated with the workflow */ data?: { [k: string]: any } | undefined; /** * Severity of the workflow */ severity: SeverityLevelEnum; }; /** @internal */ export const NotificationWorkflowDto$inboundSchema: z.ZodType< NotificationWorkflowDto, z.ZodTypeDef, unknown > = z.object({ id: z.string(), identifier: z.string(), name: z.string(), critical: z.boolean(), tags: z.array(z.string()).optional(), data: z.record(z.any()).optional(), severity: SeverityLevelEnum$inboundSchema, }); export function notificationWorkflowDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NotificationWorkflowDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotificationWorkflowDto' from JSON`, ); }