/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: e8f8fc4b933f */ 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 DeploymentBuildState = { phase?: string | null | undefined; commitSha?: string | null | undefined; image?: string | null | undefined; message?: string | null | undefined; startedAt?: Date | null | undefined; finishedAt?: Date | null | undefined; }; /** @internal */ export const DeploymentBuildState$inboundSchema: z.ZodType< DeploymentBuildState, unknown > = z.object({ phase: z.nullable(z.string()).optional(), commit_sha: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), message: z.nullable(z.string()).optional(), started_at: z.nullable( z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), finished_at: z.nullable( z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { "commit_sha": "commitSha", "started_at": "startedAt", "finished_at": "finishedAt", }); }); export function deploymentBuildStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentBuildState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentBuildState' from JSON`, ); }