/* * 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 { MessageTemplateDto, MessageTemplateDto$inboundSchema, } from "./messagetemplatedto.js"; import { StepFilterDto, StepFilterDto$inboundSchema } from "./stepfilterdto.js"; /** * Reply callback settings */ export type ActivityNotificationStepResponseDtoReplyCallback = {}; /** * Control variables */ export type ControlVariables = {}; /** * Metadata for the workflow step */ export type ActivityNotificationStepResponseDtoMetadata = {}; /** * Step issues */ export type Issues = {}; export type ActivityNotificationStepResponseDto = { /** * Unique identifier of the step */ id: string; /** * Whether the step is active or not */ active: boolean; /** * Reply callback settings */ replyCallback?: ActivityNotificationStepResponseDtoReplyCallback | undefined; /** * Control variables */ controlVariables?: ControlVariables | undefined; /** * Metadata for the workflow step */ metadata?: ActivityNotificationStepResponseDtoMetadata | undefined; /** * Step issues */ issues?: Issues | undefined; /** * Filter criteria for the step */ filters: Array; /** * Optional template for the step */ template?: MessageTemplateDto | undefined; /** * Variants of the step */ variants?: Array | undefined; /** * The identifier for the template associated with this step */ templateId: string; /** * The name of the step */ name?: string | undefined; /** * The unique identifier for the parent step */ parentId?: string | null | undefined; }; /** @internal */ export const ActivityNotificationStepResponseDtoReplyCallback$inboundSchema: z.ZodType< ActivityNotificationStepResponseDtoReplyCallback, z.ZodTypeDef, unknown > = z.object({}); export function activityNotificationStepResponseDtoReplyCallbackFromJSON( jsonString: string, ): SafeParseResult< ActivityNotificationStepResponseDtoReplyCallback, SDKValidationError > { return safeParse( jsonString, (x) => ActivityNotificationStepResponseDtoReplyCallback$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ActivityNotificationStepResponseDtoReplyCallback' from JSON`, ); } /** @internal */ export const ControlVariables$inboundSchema: z.ZodType< ControlVariables, z.ZodTypeDef, unknown > = z.object({}); export function controlVariablesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ControlVariables$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ControlVariables' from JSON`, ); } /** @internal */ export const ActivityNotificationStepResponseDtoMetadata$inboundSchema: z.ZodType< ActivityNotificationStepResponseDtoMetadata, z.ZodTypeDef, unknown > = z.object({}); export function activityNotificationStepResponseDtoMetadataFromJSON( jsonString: string, ): SafeParseResult< ActivityNotificationStepResponseDtoMetadata, SDKValidationError > { return safeParse( jsonString, (x) => ActivityNotificationStepResponseDtoMetadata$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ActivityNotificationStepResponseDtoMetadata' from JSON`, ); } /** @internal */ export const Issues$inboundSchema: z.ZodType = z .object({}); export function issuesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Issues$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Issues' from JSON`, ); } /** @internal */ export const ActivityNotificationStepResponseDto$inboundSchema: z.ZodType< ActivityNotificationStepResponseDto, z.ZodTypeDef, unknown > = z.object({ _id: z.string(), active: z.boolean(), replyCallback: z.lazy(() => ActivityNotificationStepResponseDtoReplyCallback$inboundSchema ).optional(), controlVariables: z.lazy(() => ControlVariables$inboundSchema).optional(), metadata: z.lazy(() => ActivityNotificationStepResponseDtoMetadata$inboundSchema ).optional(), issues: z.lazy(() => Issues$inboundSchema).optional(), filters: z.array(StepFilterDto$inboundSchema), template: MessageTemplateDto$inboundSchema.optional(), variants: z.array( z.lazy(() => ActivityNotificationStepResponseDto$inboundSchema), ).optional(), _templateId: z.string(), name: z.string().optional(), _parentId: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "_id": "id", "_templateId": "templateId", "_parentId": "parentId", }); }); export function activityNotificationStepResponseDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ActivityNotificationStepResponseDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ActivityNotificationStepResponseDto' from JSON`, ); }