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

import * as z from "zod/v3";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import * as types from "../../types/primitives.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

/**
 * A message confirming the instance was canceled, including the instance and workflow IDs
 */
export type CancelWorkflowInstanceResponse = {
  message?: string | undefined;
};

/** @internal */
export const CancelWorkflowInstanceResponse$inboundSchema: z.ZodType<
  CancelWorkflowInstanceResponse,
  z.ZodTypeDef,
  unknown
> = z.object({
  message: types.optional(types.string()),
});

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