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

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";

export type UpdateWorkflowResponse = {
  updateName: string;
  /**
   * The result of the Update workflow call
   */
  result: any;
};

/** @internal */
export const UpdateWorkflowResponse$inboundSchema: z.ZodType<
  UpdateWorkflowResponse,
  unknown
> = z.object({
  update_name: z.string(),
  result: z.any(),
}).transform((v) => {
  return remap$(v, {
    "update_name": "updateName",
  });
});

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