/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: b53243a0df57 */ 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"; import { GitMetadata, GitMetadata$inboundSchema } from "./gitmetadata.js"; import { SetupFingerprintInfo, SetupFingerprintInfo$inboundSchema, } from "./setupfingerprintinfo.js"; export type ReleaseStack = { aws?: any | null | undefined; gcp?: any | null | undefined; azure?: any | null | undefined; kubernetes?: any | null | undefined; machines?: any | null | undefined; local?: any | null | undefined; test?: any | null | undefined; }; export type Release = { /** * Unique identifier for the release. */ id: string; projectId: string; version: string; gitMetadata?: GitMetadata | null | undefined; createdAt: Date; stack?: ReleaseStack | null | undefined; setupFingerprints: { [k: string]: SetupFingerprintInfo }; rootDirectory?: string | null | undefined; /** * ID of the platform user who created the release, if known */ createdByUserId?: string | null | undefined; workspaceId: string; }; /** @internal */ export const ReleaseStack$inboundSchema: z.ZodType = z .object({ aws: z.nullable(z.any()).optional(), gcp: z.nullable(z.any()).optional(), azure: z.nullable(z.any()).optional(), kubernetes: z.nullable(z.any()).optional(), machines: z.nullable(z.any()).optional(), local: z.nullable(z.any()).optional(), test: z.nullable(z.any()).optional(), }); export function releaseStackFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReleaseStack$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReleaseStack' from JSON`, ); } /** @internal */ export const Release$inboundSchema: z.ZodType = z.object({ id: z.string(), projectId: z.string(), version: z.string(), gitMetadata: z.nullable(GitMetadata$inboundSchema).optional(), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), stack: z.nullable(z.lazy(() => ReleaseStack$inboundSchema)).optional(), setupFingerprints: z.record(z.string(), SetupFingerprintInfo$inboundSchema), rootDirectory: z.nullable(z.string()).optional(), createdByUserId: z.nullable(z.string()).optional(), workspaceId: z.string(), }); export function releaseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Release$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Release' from JSON`, ); }