/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { NotificationTriggerVariable, NotificationTriggerVariable$inboundSchema, } from "./notificationtriggervariable.js"; export const NotificationTriggerType = { Event: "event", } as const; export type NotificationTriggerType = ClosedEnum< typeof NotificationTriggerType >; export type NotificationTrigger = { type: NotificationTriggerType; identifier: string; variables: Array; subscriberVariables?: Array | undefined; }; /** @internal */ export const NotificationTriggerType$inboundSchema: z.ZodNativeEnum< typeof NotificationTriggerType > = z.nativeEnum(NotificationTriggerType); /** @internal */ export const NotificationTrigger$inboundSchema: z.ZodType< NotificationTrigger, z.ZodTypeDef, unknown > = z.object({ type: NotificationTriggerType$inboundSchema, identifier: z.string(), variables: z.array(NotificationTriggerVariable$inboundSchema), subscriberVariables: z.array(NotificationTriggerVariable$inboundSchema) .optional(), }); export function notificationTriggerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => NotificationTrigger$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'NotificationTrigger' from JSON`, ); }