/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: ce1366d023d2 */ import * as z from "zod/v4"; import { ClosedEnum } from "../types/enums.js"; /** * Backend whose observer produced this snapshot. */ export const ObservedInventoryBatchBackend = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Local: "local", Managed: "managed", External: "external", Test: "test", } as const; /** * Backend whose observer produced this snapshot. */ export type ObservedInventoryBatchBackend = ClosedEnum< typeof ObservedInventoryBatchBackend >; /** * Represents the target cloud platform. */ export const ObservedInventoryBatchControllerPlatform = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type ObservedInventoryBatchControllerPlatform = ClosedEnum< typeof ObservedInventoryBatchControllerPlatform >; export const ObservedInventoryBatchReason = { Forbidden: "forbidden", NotInstalled: "not-installed", ApiUnavailable: "api-unavailable", CollectionFailed: "collection-failed", TimedOut: "timed-out", } as const; export type ObservedInventoryBatchReason = ClosedEnum< typeof ObservedInventoryBatchReason >; export const ObservedInventoryBatchSeverity = { Info: "info", Warning: "warning", Error: "error", } as const; export type ObservedInventoryBatchSeverity = ClosedEnum< typeof ObservedInventoryBatchSeverity >; export type ObservedInventoryBatchCollectionIssue = { message: string; reason: ObservedInventoryBatchReason; severity: ObservedInventoryBatchSeverity; source: string; }; export type Counts = { current?: number | null | undefined; desired?: number | null | undefined; ready?: number | null | undefined; }; export type CountsUnion = Counts | any; export const ObservedInventoryBatchHealth = { Unknown: "unknown", Healthy: "healthy", Degraded: "degraded", Unhealthy: "unhealthy", } as const; export type ObservedInventoryBatchHealth = ClosedEnum< typeof ObservedInventoryBatchHealth >; export const ObservedInventoryBatchLifecycle = { Unknown: "unknown", Creating: "creating", Updating: "updating", Running: "running", Scaling: "scaling", Stopping: "stopping", Stopped: "stopped", Deleting: "deleting", Deleted: "deleted", Failed: "failed", } as const; export type ObservedInventoryBatchLifecycle = ClosedEnum< typeof ObservedInventoryBatchLifecycle >; export const ObservedInventoryBatchFormat = { Json: "json", Yaml: "yaml", Text: "text", } as const; export type ObservedInventoryBatchFormat = ClosedEnum< typeof ObservedInventoryBatchFormat >; export type ObservedInventoryBatchRaw = { body: string; collectedAt: Date; format: ObservedInventoryBatchFormat; source: string; truncated: boolean; }; export type ResourceTypeHint = string | any; export type ObservedInventoryBatchResource = { alienResourceId?: string | null | undefined; attributes?: { [k: string]: any | null } | undefined; collectionIssues?: Array | undefined; counts?: Counts | any | null | undefined; deploymentId?: string | null | undefined; displayName: string; health: ObservedInventoryBatchHealth; labels?: { [k: string]: string } | undefined; lifecycle: ObservedInventoryBatchLifecycle; message?: string | null | undefined; namespace?: string | null | undefined; partial: boolean; /** * Provider-native kind, such as `apps/v1/Deployment`, * * @remarks * `AWS::S3::Bucket`, `storage.googleapis.com/Bucket`, or an Azure * resource type. */ providerKind: string; providerStale: boolean; raw?: Array | undefined; /** * Provider-native stable identity: Kubernetes object identity, cloud ARN, * * @remarks * GCP full resource name, Azure resource id, etc. */ rawIdentity: string; region?: string | null | undefined; resourceTypeHint?: string | any | null | undefined; scope?: string | null | undefined; /** * Release/version identity observed from the provider resource, when available. */ version?: string | null | undefined; }; export type ObservedInventoryBatch = { /** * Backend whose observer produced this snapshot. */ backend: ObservedInventoryBatchBackend; /** * Whether this batch is a complete replacement for the scope. Complete * * @remarks * batches tombstone previously observed rows in the same scope when they * are absent from `resources`. */ complete: boolean; /** * Represents the target cloud platform. */ controllerPlatform: ObservedInventoryBatchControllerPlatform; /** * Stable scope for the provider list operation that produced this batch. */ inventoryScope: string; /** * Time the inventory scope was observed. */ observedAt: Date; resources: Array; /** * Writer/source for this inventory pass, such as `operator` or * * @remarks * `manager-observer`. */ sourceKind: string; }; /** @internal */ export const ObservedInventoryBatchBackend$outboundSchema: z.ZodEnum< typeof ObservedInventoryBatchBackend > = z.enum(ObservedInventoryBatchBackend); /** @internal */ export const ObservedInventoryBatchControllerPlatform$outboundSchema: z.ZodEnum< typeof ObservedInventoryBatchControllerPlatform > = z.enum(ObservedInventoryBatchControllerPlatform); /** @internal */ export const ObservedInventoryBatchReason$outboundSchema: z.ZodEnum< typeof ObservedInventoryBatchReason > = z.enum(ObservedInventoryBatchReason); /** @internal */ export const ObservedInventoryBatchSeverity$outboundSchema: z.ZodEnum< typeof ObservedInventoryBatchSeverity > = z.enum(ObservedInventoryBatchSeverity); /** @internal */ export type ObservedInventoryBatchCollectionIssue$Outbound = { message: string; reason: string; severity: string; source: string; }; /** @internal */ export const ObservedInventoryBatchCollectionIssue$outboundSchema: z.ZodType< ObservedInventoryBatchCollectionIssue$Outbound, ObservedInventoryBatchCollectionIssue > = z.object({ message: z.string(), reason: ObservedInventoryBatchReason$outboundSchema, severity: ObservedInventoryBatchSeverity$outboundSchema, source: z.string(), }); export function observedInventoryBatchCollectionIssueToJSON( observedInventoryBatchCollectionIssue: ObservedInventoryBatchCollectionIssue, ): string { return JSON.stringify( ObservedInventoryBatchCollectionIssue$outboundSchema.parse( observedInventoryBatchCollectionIssue, ), ); } /** @internal */ export type Counts$Outbound = { current?: number | null | undefined; desired?: number | null | undefined; ready?: number | null | undefined; }; /** @internal */ export const Counts$outboundSchema: z.ZodType = z .object({ current: z.nullable(z.int()).optional(), desired: z.nullable(z.int()).optional(), ready: z.nullable(z.int()).optional(), }); export function countsToJSON(counts: Counts): string { return JSON.stringify(Counts$outboundSchema.parse(counts)); } /** @internal */ export type CountsUnion$Outbound = Counts$Outbound | any; /** @internal */ export const CountsUnion$outboundSchema: z.ZodType< CountsUnion$Outbound, CountsUnion > = z.union([z.lazy(() => Counts$outboundSchema), z.any()]); export function countsUnionToJSON(countsUnion: CountsUnion): string { return JSON.stringify(CountsUnion$outboundSchema.parse(countsUnion)); } /** @internal */ export const ObservedInventoryBatchHealth$outboundSchema: z.ZodEnum< typeof ObservedInventoryBatchHealth > = z.enum(ObservedInventoryBatchHealth); /** @internal */ export const ObservedInventoryBatchLifecycle$outboundSchema: z.ZodEnum< typeof ObservedInventoryBatchLifecycle > = z.enum(ObservedInventoryBatchLifecycle); /** @internal */ export const ObservedInventoryBatchFormat$outboundSchema: z.ZodEnum< typeof ObservedInventoryBatchFormat > = z.enum(ObservedInventoryBatchFormat); /** @internal */ export type ObservedInventoryBatchRaw$Outbound = { body: string; collectedAt: string; format: string; source: string; truncated: boolean; }; /** @internal */ export const ObservedInventoryBatchRaw$outboundSchema: z.ZodType< ObservedInventoryBatchRaw$Outbound, ObservedInventoryBatchRaw > = z.object({ body: z.string(), collectedAt: z.date().transform(v => v.toISOString()), format: ObservedInventoryBatchFormat$outboundSchema, source: z.string(), truncated: z.boolean(), }); export function observedInventoryBatchRawToJSON( observedInventoryBatchRaw: ObservedInventoryBatchRaw, ): string { return JSON.stringify( ObservedInventoryBatchRaw$outboundSchema.parse(observedInventoryBatchRaw), ); } /** @internal */ export type ResourceTypeHint$Outbound = string | any; /** @internal */ export const ResourceTypeHint$outboundSchema: z.ZodType< ResourceTypeHint$Outbound, ResourceTypeHint > = z.union([z.string(), z.any()]); export function resourceTypeHintToJSON( resourceTypeHint: ResourceTypeHint, ): string { return JSON.stringify( ResourceTypeHint$outboundSchema.parse(resourceTypeHint), ); } /** @internal */ export type ObservedInventoryBatchResource$Outbound = { alienResourceId?: string | null | undefined; attributes?: { [k: string]: any | null } | undefined; collectionIssues?: | Array | undefined; counts?: Counts$Outbound | any | null | undefined; deploymentId?: string | null | undefined; displayName: string; health: string; labels?: { [k: string]: string } | undefined; lifecycle: string; message?: string | null | undefined; namespace?: string | null | undefined; partial: boolean; providerKind: string; providerStale: boolean; raw?: Array | undefined; rawIdentity: string; region?: string | null | undefined; resourceTypeHint?: string | any | null | undefined; scope?: string | null | undefined; version?: string | null | undefined; }; /** @internal */ export const ObservedInventoryBatchResource$outboundSchema: z.ZodType< ObservedInventoryBatchResource$Outbound, ObservedInventoryBatchResource > = z.object({ alienResourceId: z.nullable(z.string()).optional(), attributes: z.record(z.string(), z.nullable(z.any())).optional(), collectionIssues: z.array( z.lazy(() => ObservedInventoryBatchCollectionIssue$outboundSchema), ).optional(), counts: z.nullable(z.union([z.lazy(() => Counts$outboundSchema), z.any()])) .optional(), deploymentId: z.nullable(z.string()).optional(), displayName: z.string(), health: ObservedInventoryBatchHealth$outboundSchema, labels: z.record(z.string(), z.string()).optional(), lifecycle: ObservedInventoryBatchLifecycle$outboundSchema, message: z.nullable(z.string()).optional(), namespace: z.nullable(z.string()).optional(), partial: z.boolean(), providerKind: z.string(), providerStale: z.boolean(), raw: z.array(z.lazy(() => ObservedInventoryBatchRaw$outboundSchema)) .optional(), rawIdentity: z.string(), region: z.nullable(z.string()).optional(), resourceTypeHint: z.nullable(z.union([z.string(), z.any()])).optional(), scope: z.nullable(z.string()).optional(), version: z.nullable(z.string()).optional(), }); export function observedInventoryBatchResourceToJSON( observedInventoryBatchResource: ObservedInventoryBatchResource, ): string { return JSON.stringify( ObservedInventoryBatchResource$outboundSchema.parse( observedInventoryBatchResource, ), ); } /** @internal */ export type ObservedInventoryBatch$Outbound = { backend: string; complete: boolean; controllerPlatform: string; inventoryScope: string; observedAt: string; resources: Array; sourceKind: string; }; /** @internal */ export const ObservedInventoryBatch$outboundSchema: z.ZodType< ObservedInventoryBatch$Outbound, ObservedInventoryBatch > = z.object({ backend: ObservedInventoryBatchBackend$outboundSchema, complete: z.boolean(), controllerPlatform: ObservedInventoryBatchControllerPlatform$outboundSchema, inventoryScope: z.string(), observedAt: z.date().transform(v => v.toISOString()), resources: z.array( z.lazy(() => ObservedInventoryBatchResource$outboundSchema), ), sourceKind: z.string(), }); export function observedInventoryBatchToJSON( observedInventoryBatch: ObservedInventoryBatch, ): string { return JSON.stringify( ObservedInventoryBatch$outboundSchema.parse(observedInventoryBatch), ); }