/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: d5adae5cea67 */ import * as z from "zod/v4"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * Count of deployments introduced through each deployment path. */ export type ByOrigin = { framework?: number | undefined; remoteOperator?: number | undefined; }; export type DeploymentStats = { /** * Total number of deployments matching filters */ total: number; /** * Count of deployments by status (only includes statuses with non-zero counts) */ byStatus: { [k: string]: number }; /** * Count of deployments by platform (only includes platforms with non-zero counts) */ byPlatform: { [k: string]: number }; /** * Count of deployments by currentReleaseId. The empty string key represents deployments with no current release (initial provisioning). */ byCurrentRelease: { [k: string]: number }; /** * Count of deployments by pinnedReleaseId among deployments that are pinned. Excludes unpinned deployments. */ byPinnedRelease: { [k: string]: number }; /** * Count of deployments introduced through each deployment path. */ byOrigin: ByOrigin; }; /** @internal */ export const ByOrigin$inboundSchema: z.ZodType = z.object({ framework: z.number().optional(), remoteOperator: z.number().optional(), }); export function byOriginFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ByOrigin$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ByOrigin' from JSON`, ); } /** @internal */ export const DeploymentStats$inboundSchema: z.ZodType< DeploymentStats, unknown > = z.object({ total: z.number(), byStatus: z.record(z.string(), z.number()), byPlatform: z.record(z.string(), z.number()), byCurrentRelease: z.record(z.string(), z.number()), byPinnedRelease: z.record(z.string(), z.number()), byOrigin: z.lazy(() => ByOrigin$inboundSchema), }); export function deploymentStatsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentStats$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentStats' from JSON`, ); }