/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 8bb608c4797d */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ListResourceOverviewGlobals = { /** * Workspace name. Platform API keys already select a workspace; other authentication methods can configure it once on the SDK client. */ workspace?: string | undefined; }; export const ListResourceOverviewArea = { Container: "container", Worker: "worker", Daemon: "daemon", Ai: "ai", } as const; export type ListResourceOverviewArea = ClosedEnum< typeof ListResourceOverviewArea >; export type ListResourceOverviewRequest = { area: ListResourceOverviewArea; /** * Filter by project ID or name. */ project: string; deploymentGroupId?: string | undefined; deploymentId?: string | undefined; }; export type ListResourceOverviewResource = { resourceType: string; resourceId: string; name: string; backend: string; controllerPlatform: string; health: string; lifecycle: string; message: string | null; partial: boolean; providerStale: boolean; platformStale: boolean; desiredCount: number | null; currentCount: number | null; readyCount: number | null; deploymentCount: number; attentionCount: number; lastObservedAt: Date; }; /** * Compute resource overview rows from latest heartbeats. */ export type ListResourceOverviewResponse = { resources: Array; }; /** @internal */ export const ListResourceOverviewArea$outboundSchema: z.ZodEnum< typeof ListResourceOverviewArea > = z.enum(ListResourceOverviewArea); /** @internal */ export type ListResourceOverviewRequest$Outbound = { area: string; project: string; deploymentGroupId?: string | undefined; deploymentId?: string | undefined; }; /** @internal */ export const ListResourceOverviewRequest$outboundSchema: z.ZodType< ListResourceOverviewRequest$Outbound, ListResourceOverviewRequest > = z.object({ area: ListResourceOverviewArea$outboundSchema, project: z.string(), deploymentGroupId: z.string().optional(), deploymentId: z.string().optional(), }); export function listResourceOverviewRequestToJSON( listResourceOverviewRequest: ListResourceOverviewRequest, ): string { return JSON.stringify( ListResourceOverviewRequest$outboundSchema.parse( listResourceOverviewRequest, ), ); } /** @internal */ export const ListResourceOverviewResource$inboundSchema: z.ZodType< ListResourceOverviewResource, unknown > = z.object({ resourceType: z.string(), resourceId: z.string(), name: z.string(), backend: z.string(), controllerPlatform: z.string(), health: z.string(), lifecycle: z.string(), message: z.nullable(z.string()), partial: z.boolean(), providerStale: z.boolean(), platformStale: z.boolean(), desiredCount: z.nullable(z.int()), currentCount: z.nullable(z.int()), readyCount: z.nullable(z.int()), deploymentCount: z.int(), attentionCount: z.int(), lastObservedAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), }); export function listResourceOverviewResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListResourceOverviewResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListResourceOverviewResource' from JSON`, ); } /** @internal */ export const ListResourceOverviewResponse$inboundSchema: z.ZodType< ListResourceOverviewResponse, unknown > = z.object({ resources: z.array(z.lazy(() => ListResourceOverviewResource$inboundSchema)), }); export function listResourceOverviewResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListResourceOverviewResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListResourceOverviewResponse' from JSON`, ); }