/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f6aec4ad716b */ 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 { DeploymentObservedState, DeploymentObservedState$inboundSchema, } from "./deploymentobservedstate.js"; import { DeploymentResourceConfig, DeploymentResourceConfig$inboundSchema, } from "./deploymentresourceconfig.js"; import { DeploymentWorkerSpecResponse, DeploymentWorkerSpecResponse$inboundSchema, } from "./deploymentworkerspecresponse.js"; export type ManagedDeploymentResponse = { serviceId: string; name: string; spec: DeploymentWorkerSpecResponse; resources: DeploymentResourceConfig; status: DeploymentObservedState; createdAt: Date; updatedAt: Date; stopped: boolean; rolloutStatus?: string | null | undefined; createdBy?: string | null | undefined; updatedBy?: string | null | undefined; deployedBy?: string | null | undefined; deployedAt?: Date | null | undefined; isHardened: boolean; }; /** @internal */ export const ManagedDeploymentResponse$inboundSchema: z.ZodType< ManagedDeploymentResponse, unknown > = z.object({ service_id: z.string(), name: z.string(), spec: DeploymentWorkerSpecResponse$inboundSchema, resources: DeploymentResourceConfig$inboundSchema, status: DeploymentObservedState$inboundSchema, created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)), updated_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)), stopped: z.boolean().default(false), rollout_status: z.nullable(z.string()).optional(), created_by: z.nullable(z.string()).optional(), updated_by: z.nullable(z.string()).optional(), deployed_by: z.nullable(z.string()).optional(), deployed_at: z.nullable( z.iso.datetime({ offset: true }).transform(v => new Date(v)), ).optional(), is_hardened: z.boolean().default(false), }).transform((v) => { return remap$(v, { "service_id": "serviceId", "created_at": "createdAt", "updated_at": "updatedAt", "rollout_status": "rolloutStatus", "created_by": "createdBy", "updated_by": "updatedBy", "deployed_by": "deployedBy", "deployed_at": "deployedAt", "is_hardened": "isHardened", }); }); export function managedDeploymentResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManagedDeploymentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManagedDeploymentResponse' from JSON`, ); }