/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type WorkflowExecutionDTO = { closeTime?: Date | undefined; createdBy?: string | undefined; durationMs?: number | undefined; /** * e.g. plan, invoice, subscription */ entity?: string | undefined; /** * e.g. plan ID, invoice ID */ entityId?: string | undefined; runId?: string | undefined; startTime?: Date | undefined; status?: string | undefined; taskQueue?: string | undefined; totalDuration?: string | undefined; workflowId?: string | undefined; workflowType?: string | undefined; }; /** @internal */ export const WorkflowExecutionDTO$inboundSchema: z.ZodMiniType< WorkflowExecutionDTO, unknown > = z.pipe( z.object({ close_time: types.optional(types.date()), created_by: types.optional(types.string()), duration_ms: types.optional(types.number()), entity: types.optional(types.string()), entity_id: types.optional(types.string()), run_id: types.optional(types.string()), start_time: types.optional(types.date()), status: types.optional(types.string()), task_queue: types.optional(types.string()), total_duration: types.optional(types.string()), workflow_id: types.optional(types.string()), workflow_type: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "close_time": "closeTime", "created_by": "createdBy", "duration_ms": "durationMs", "entity_id": "entityId", "run_id": "runId", "start_time": "startTime", "task_queue": "taskQueue", "total_duration": "totalDuration", "workflow_id": "workflowId", "workflow_type": "workflowType", }); }), ); export function workflowExecutionDTOFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowExecutionDTO$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowExecutionDTO' from JSON`, ); }