/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c350a93ef419 */ 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 { DeploymentBuildState, DeploymentBuildState$inboundSchema, } from "./deploymentbuildstate.js"; export type DeploymentObservedState = { phase?: string | null | undefined; availableReplicas: number; readyReplicas: number; endpoint?: string | null | undefined; message?: string | null | undefined; lastSeen?: Date | null | undefined; deployedRevision?: string | null | undefined; generation?: number | null | undefined; buildState?: DeploymentBuildState | null | undefined; }; /** @internal */ export const DeploymentObservedState$inboundSchema: z.ZodType< DeploymentObservedState, unknown > = z.object({ phase: z.nullable(z.string()).optional(), available_replicas: z.int().default(0), ready_replicas: z.int().default(0), endpoint: z.nullable(z.string()).optional(), message: z.nullable(z.string()).optional(), last_seen: z.nullable( z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), deployed_revision: z.nullable(z.string()).optional(), generation: z.nullable(z.int()).optional(), build_state: z.nullable(DeploymentBuildState$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "available_replicas": "availableReplicas", "ready_replicas": "readyReplicas", "last_seen": "lastSeen", "deployed_revision": "deployedRevision", "build_state": "buildState", }); }); export function deploymentObservedStateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentObservedState$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentObservedState' from JSON`, ); }