/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 2c5b14d0424b */ import * as z from "zod/v4"; 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 { Workflow, Workflow$inboundSchema } from "./workflow.js"; import { WorkflowCodeDefinition, WorkflowCodeDefinition$inboundSchema, } from "./workflowcodedefinition.js"; export type WorkflowRegistrationWithWorkerStatus = { /** * Unique identifier of the workflow registration */ id: string; /** * Deployment ID this registration belongs to */ deploymentId?: string | null | undefined; /** * Deprecated. Use deployment_id instead. Will be removed in a future release. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ taskQueue?: string | null | undefined; definition: WorkflowCodeDefinition; /** * Workflow ID of the workflow */ workflowId: string; /** * Workflow of the workflow registration */ workflow?: Workflow | null | undefined; /** * Whether the workflow is compatible with chat assistant */ compatibleWithChatAssistant: boolean; /** * Whether the workflow registration is active */ active: boolean; }; /** @internal */ export const WorkflowRegistrationWithWorkerStatus$inboundSchema: z.ZodType< WorkflowRegistrationWithWorkerStatus, unknown > = z.object({ id: z.string(), deployment_id: z.nullable(z.string()).optional(), task_queue: z.nullable(z.string()).optional(), definition: WorkflowCodeDefinition$inboundSchema, workflow_id: z.string(), workflow: z.nullable(Workflow$inboundSchema).optional(), compatible_with_chat_assistant: z.boolean().default(false), active: z.boolean(), }).transform((v) => { return remap$(v, { "deployment_id": "deploymentId", "task_queue": "taskQueue", "workflow_id": "workflowId", "compatible_with_chat_assistant": "compatibleWithChatAssistant", }); }); export function workflowRegistrationWithWorkerStatusFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowRegistrationWithWorkerStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowRegistrationWithWorkerStatus' from JSON`, ); }