/* * 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"; /** * Status of the trigger */ export const TriggerEventResponseDtoStatus = { Error: "error", TriggerNotActive: "trigger_not_active", NoWorkflowActiveStepsDefined: "no_workflow_active_steps_defined", NoWorkflowStepsDefined: "no_workflow_steps_defined", Processed: "processed", NoTenantFound: "no_tenant_found", InvalidRecipients: "invalid_recipients", } as const; /** * Status of the trigger */ export type TriggerEventResponseDtoStatus = ClosedEnum< typeof TriggerEventResponseDtoStatus >; export type JobData = {}; export type TriggerEventResponseDto = { /** * Indicates whether the trigger was acknowledged or not */ acknowledged: boolean; /** * Status of the trigger */ status: TriggerEventResponseDtoStatus; /** * In case of an error, this field will contain the error message(s) */ error?: Array | undefined; /** * The returned transaction ID of the trigger */ transactionId?: string | undefined; /** * Link to the activity feed for this trigger event */ activityFeedLink?: string | undefined; jobData?: JobData | undefined; }; /** @internal */ export const TriggerEventResponseDtoStatus$inboundSchema: z.ZodNativeEnum< typeof TriggerEventResponseDtoStatus > = z.nativeEnum(TriggerEventResponseDtoStatus); /** @internal */ export const JobData$inboundSchema: z.ZodType = z.object({}); export function jobDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => JobData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'JobData' from JSON`, ); } /** @internal */ export const TriggerEventResponseDto$inboundSchema: z.ZodType< TriggerEventResponseDto, z.ZodTypeDef, unknown > = z.object({ acknowledged: z.boolean(), status: TriggerEventResponseDtoStatus$inboundSchema, error: z.array(z.string()).optional(), transactionId: z.string().optional(), activityFeedLink: z.string().optional(), jobData: z.lazy(() => JobData$inboundSchema).optional(), }); export function triggerEventResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TriggerEventResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TriggerEventResponseDto' from JSON`, ); }