/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 6d936dba7cb6 */ 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 { DebugPackagePresignedURLs, DebugPackagePresignedURLs$inboundSchema, } from "./debugpackagepresignedurls.js"; import { DebugSessionState, DebugSessionState$inboundSchema, } from "./debugsessionstate.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; /** * Deployment model: how updates are delivered to the remote environment. */ export const DebugSessionMode = { Push: "push", Pull: "pull", } as const; /** * Deployment model: how updates are delivered to the remote environment. */ export type DebugSessionMode = ClosedEnum; /** * Represents the target cloud platform. */ export const DebugSessionProvider = { Aws: "aws", Gcp: "gcp", Azure: "azure", Kubernetes: "kubernetes", Machines: "machines", Local: "local", Test: "test", } as const; /** * Represents the target cloud platform. */ export type DebugSessionProvider = ClosedEnum; export type DebugSession = { /** * Unique identifier for the debug session. */ id: string; owner?: string | null | undefined; state: DebugSessionState; /** * Deployment model: how updates are delivered to the remote environment. */ mode: DebugSessionMode; /** * Represents the target cloud platform. */ provider?: DebugSessionProvider | null | undefined; presignedUrls: { [k: string]: DebugPackagePresignedURLs }; error?: any | null | undefined; createdAt: Date; expiresAt: Date; /** * Unique identifier for the deployment. */ deploymentId: string; /** * Unique identifier for the project. */ projectId: string; /** * Unique identifier for the workspace. */ workspaceId: string; }; /** @internal */ export const DebugSessionMode$inboundSchema: z.ZodEnum< typeof DebugSessionMode > = z.enum(DebugSessionMode); /** @internal */ export const DebugSessionProvider$inboundSchema: z.ZodEnum< typeof DebugSessionProvider > = z.enum(DebugSessionProvider); /** @internal */ export const DebugSession$inboundSchema: z.ZodType = z .object({ id: z.string(), owner: z.nullable(z.string()).optional(), state: DebugSessionState$inboundSchema, mode: DebugSessionMode$inboundSchema, provider: z.nullable(DebugSessionProvider$inboundSchema).optional(), presignedUrls: z.record( z.string(), DebugPackagePresignedURLs$inboundSchema, ), error: z.nullable(z.any()).optional(), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), expiresAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)), deploymentId: z.string(), projectId: z.string(), workspaceId: z.string(), }); export function debugSessionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DebugSession$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DebugSession' from JSON`, ); }