/* * 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 WorkflowControllerGetWorkflowRequest = { workflowId: string; environmentId?: string | undefined; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type WorkflowControllerGetWorkflowResponse = { headers: { [k: string]: Array }; result: components.WorkflowResponseDto; }; /** @internal */ export type WorkflowControllerGetWorkflowRequest$Outbound = { workflowId: string; environmentId?: string | undefined; "idempotency-key"?: string | undefined; }; /** @internal */ export const WorkflowControllerGetWorkflowRequest$outboundSchema: z.ZodType< WorkflowControllerGetWorkflowRequest$Outbound, z.ZodTypeDef, WorkflowControllerGetWorkflowRequest > = z.object({ workflowId: z.string(), environmentId: z.string().optional(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function workflowControllerGetWorkflowRequestToJSON( workflowControllerGetWorkflowRequest: WorkflowControllerGetWorkflowRequest, ): string { return JSON.stringify( WorkflowControllerGetWorkflowRequest$outboundSchema.parse( workflowControllerGetWorkflowRequest, ), ); } /** @internal */ export const WorkflowControllerGetWorkflowResponse$inboundSchema: z.ZodType< WorkflowControllerGetWorkflowResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.WorkflowResponseDto$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function workflowControllerGetWorkflowResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WorkflowControllerGetWorkflowResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WorkflowControllerGetWorkflowResponse' from JSON`, ); }