/*
 * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js";

export type V2DeployDeploymentStep = {
  /**
   * Step status
   */
  status?: string | undefined;
  /**
   * Step message
   */
  message?: string | undefined;
  /**
   * Error message if step failed
   */
  errorMessage?: string | undefined;
  /**
   * Unix timestamp in milliseconds
   */
  createdAt?: number | undefined;
};

/** @internal */
export const V2DeployDeploymentStep$inboundSchema: z.ZodType<
  V2DeployDeploymentStep,
  z.ZodTypeDef,
  unknown
> = z.object({
  status: z.string().optional(),
  message: z.string().optional(),
  errorMessage: z.string().optional(),
  createdAt: z.number().int().optional(),
});

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