/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: 430bbeca9211
 */

import * as z from "zod/v4";
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";

export type WorkflowUpdateResponse = {
  workflow: Workflow;
};

/** @internal */
export const WorkflowUpdateResponse$inboundSchema: z.ZodType<
  WorkflowUpdateResponse,
  unknown
> = z.object({
  workflow: Workflow$inboundSchema,
});

export function workflowUpdateResponseFromJSON(
  jsonString: string,
): SafeParseResult<WorkflowUpdateResponse, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => WorkflowUpdateResponse$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'WorkflowUpdateResponse' from JSON`,
  );
}
