/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 6826bbd1401f */ 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 ListResourceDeploymentsGlobals = { /** * 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 ListResourceDeploymentsArea = { Container: "container", Worker: "worker", Daemon: "daemon", Ai: "ai", } as const; export type ListResourceDeploymentsArea = ClosedEnum< typeof ListResourceDeploymentsArea >; export type ListResourceDeploymentsRequest = { area: ListResourceDeploymentsArea; resourceId: string; /** * Filter by project ID or name. */ project: string; deploymentGroupId?: string | undefined; deploymentId?: string | undefined; }; export type ListResourceDeploymentsDeployment = { deploymentId: string; deploymentName: string; deploymentGroupId: string | null; deploymentGroupName: string | null; resourceType: string; resourceId: 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; observedAt: Date; }; /** * Deployments where the resource is installed. */ export type ListResourceDeploymentsResponse = { resourceType: string; resourceId: string; deployments: Array; }; /** @internal */ export const ListResourceDeploymentsArea$outboundSchema: z.ZodEnum< typeof ListResourceDeploymentsArea > = z.enum(ListResourceDeploymentsArea); /** @internal */ export type ListResourceDeploymentsRequest$Outbound = { area: string; resourceId: string; project: string; deploymentGroupId?: string | undefined; deploymentId?: string | undefined; }; /** @internal */ export const ListResourceDeploymentsRequest$outboundSchema: z.ZodType< ListResourceDeploymentsRequest$Outbound, ListResourceDeploymentsRequest > = z.object({ area: ListResourceDeploymentsArea$outboundSchema, resourceId: z.string(), project: z.string(), deploymentGroupId: z.string().optional(), deploymentId: z.string().optional(), }); export function listResourceDeploymentsRequestToJSON( listResourceDeploymentsRequest: ListResourceDeploymentsRequest, ): string { return JSON.stringify( ListResourceDeploymentsRequest$outboundSchema.parse( listResourceDeploymentsRequest, ), ); } /** @internal */ export const ListResourceDeploymentsDeployment$inboundSchema: z.ZodType< ListResourceDeploymentsDeployment, unknown > = z.object({ deploymentId: z.string(), deploymentName: z.string(), deploymentGroupId: z.nullable(z.string()), deploymentGroupName: z.nullable(z.string()), resourceType: z.string(), resourceId: 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()), observedAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), }); export function listResourceDeploymentsDeploymentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListResourceDeploymentsDeployment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListResourceDeploymentsDeployment' from JSON`, ); } /** @internal */ export const ListResourceDeploymentsResponse$inboundSchema: z.ZodType< ListResourceDeploymentsResponse, unknown > = z.object({ resourceType: z.string(), resourceId: z.string(), deployments: z.array( z.lazy(() => ListResourceDeploymentsDeployment$inboundSchema), ), }); export function listResourceDeploymentsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListResourceDeploymentsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListResourceDeploymentsResponse' from JSON`, ); }