/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type WorkflowControllerGetWorkflowStepDataRequest = { workflowId: string; stepId: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type WorkflowControllerGetWorkflowStepDataResponse = { headers: { [k: string]: Array }; result: components.StepResponseDto; }; /** @internal */ export type WorkflowControllerGetWorkflowStepDataRequest$Outbound = { workflowId: string; stepId: string; "idempotency-key"?: string | undefined; }; /** @internal */ export const WorkflowControllerGetWorkflowStepDataRequest$outboundSchema: z.ZodType< WorkflowControllerGetWorkflowStepDataRequest$Outbound, z.ZodTypeDef, WorkflowControllerGetWorkflowStepDataRequest > = z.object({ workflowId: z.string(), stepId: z.string(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function workflowControllerGetWorkflowStepDataRequestToJSON( workflowControllerGetWorkflowStepDataRequest: WorkflowControllerGetWorkflowStepDataRequest, ): string { return JSON.stringify( WorkflowControllerGetWorkflowStepDataRequest$outboundSchema.parse( workflowControllerGetWorkflowStepDataRequest, ), ); } /** @internal */ export const WorkflowControllerGetWorkflowStepDataResponse$inboundSchema: z.ZodType< WorkflowControllerGetWorkflowStepDataResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.StepResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function workflowControllerGetWorkflowStepDataResponseFromJSON( jsonString: string, ): SafeParseResult< WorkflowControllerGetWorkflowStepDataResponse, SDKValidationError > { return safeParse( jsonString, (x) => WorkflowControllerGetWorkflowStepDataResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'WorkflowControllerGetWorkflowStepDataResponse' from JSON`, ); }