/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { NotificationGroup, NotificationGroup$inboundSchema, } from "./notificationgroup.js"; import { NotificationStepDto, NotificationStepDto$inboundSchema, } from "./notificationstepdto.js"; import { NotificationTrigger, NotificationTrigger$inboundSchema, } from "./notificationtrigger.js"; import { SubscriberPreferenceChannels, SubscriberPreferenceChannels$inboundSchema, } from "./subscriberpreferencechannels.js"; export type WorkflowResponseData = {}; export type WorkflowIntegrationStatus = {}; export type WorkflowResponse = { id?: string | undefined; name: string; description: string; active: boolean; draft: boolean; preferenceSettings: SubscriberPreferenceChannels; critical: boolean; tags: Array; steps: Array; organizationId: string; creatorId: string; environmentId: string; triggers: Array; notificationGroupId: string; parentId?: string | undefined; deleted: boolean; deletedAt: string; deletedBy: string; notificationGroup?: NotificationGroup | undefined; data?: WorkflowResponseData | undefined; workflowIntegrationStatus?: WorkflowIntegrationStatus | undefined; }; /** @internal */ export const WorkflowResponseData$inboundSchema: z.ZodType< WorkflowResponseData, z.ZodTypeDef, unknown > = z.object({}); export function workflowResponseDataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowResponseData$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowResponseData' from JSON`, ); } /** @internal */ export const WorkflowIntegrationStatus$inboundSchema: z.ZodType< WorkflowIntegrationStatus, z.ZodTypeDef, unknown > = z.object({}); export function workflowIntegrationStatusFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowIntegrationStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowIntegrationStatus' from JSON`, ); } /** @internal */ export const WorkflowResponse$inboundSchema: z.ZodType< WorkflowResponse, z.ZodTypeDef, unknown > = z.object({ _id: z.string().optional(), name: z.string(), description: z.string(), active: z.boolean(), draft: z.boolean(), preferenceSettings: SubscriberPreferenceChannels$inboundSchema, critical: z.boolean(), tags: z.array(z.string()), steps: z.array(NotificationStepDto$inboundSchema), _organizationId: z.string(), _creatorId: z.string(), _environmentId: z.string(), triggers: z.array(NotificationTrigger$inboundSchema), _notificationGroupId: z.string(), _parentId: z.string().optional(), deleted: z.boolean(), deletedAt: z.string(), deletedBy: z.string(), notificationGroup: NotificationGroup$inboundSchema.optional(), data: z.lazy(() => WorkflowResponseData$inboundSchema).optional(), workflowIntegrationStatus: z.lazy(() => WorkflowIntegrationStatus$inboundSchema ).optional(), }).transform((v) => { return remap$(v, { "_id": "id", "_organizationId": "organizationId", "_creatorId": "creatorId", "_environmentId": "environmentId", "_notificationGroupId": "notificationGroupId", "_parentId": "parentId", }); }); export function workflowResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowResponse' from JSON`, ); }