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

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";
import {
  WorkflowRegistrationWithWorkerStatus,
  WorkflowRegistrationWithWorkerStatus$inboundSchema,
} from "./workflowregistrationwithworkerstatus.js";

export type WorkflowRegistrationGetResponse = {
  workflowRegistration: WorkflowRegistrationWithWorkerStatus;
  workflowVersion: WorkflowRegistrationWithWorkerStatus;
};

/** @internal */
export const WorkflowRegistrationGetResponse$inboundSchema: z.ZodType<
  WorkflowRegistrationGetResponse,
  unknown
> = z.object({
  workflow_registration: WorkflowRegistrationWithWorkerStatus$inboundSchema,
  workflow_version: WorkflowRegistrationWithWorkerStatus$inboundSchema,
}).transform((v) => {
  return remap$(v, {
    "workflow_registration": "workflowRegistration",
    "workflow_version": "workflowVersion",
  });
});

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