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

/**
 * Indicates that the ability to create new workflow instances from this workflow has been resumed.
 *
 * @remarks
 * Existing workflow instances will be unaffected.
 */
export type ResumeNewWorkflowInstancesSuccess = {
  /**
   * Represents the new state of a workflow's mechanism to permit new workflow instances from being created.
   *
   * @remarks
   * Valid values include:
   *   - active
   *   - paused
   */
  status?: string | undefined;
};

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

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