/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 659f0f861ed3 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Worker configuration for the Kubernetes backend. */ export type DeploymentK8sBackendSpec = { type: "kubernetes"; /** * Either a 'module:function' reference (e.g. 'worker:main') or a '.py' script path relative to 'working_dir'. */ entrypoint?: string | null | undefined; /** * Path in the repo holding the worker's pyproject.toml, for monorepo layouts. Leave empty for single-package repos. */ workingDir?: string | null | undefined; }; /** @internal */ export const DeploymentK8sBackendSpec$inboundSchema: z.ZodType< DeploymentK8sBackendSpec, unknown > = z.object({ type: z.literal("kubernetes"), entrypoint: z.nullable(z.string()).optional(), working_dir: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "working_dir": "workingDir", }); }); /** @internal */ export type DeploymentK8sBackendSpec$Outbound = { type: "kubernetes"; entrypoint?: string | null | undefined; working_dir?: string | null | undefined; }; /** @internal */ export const DeploymentK8sBackendSpec$outboundSchema: z.ZodType< DeploymentK8sBackendSpec$Outbound, DeploymentK8sBackendSpec > = z.object({ type: z.literal("kubernetes"), entrypoint: z.nullable(z.string()).optional(), workingDir: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { workingDir: "working_dir", }); }); export function deploymentK8sBackendSpecToJSON( deploymentK8sBackendSpec: DeploymentK8sBackendSpec, ): string { return JSON.stringify( DeploymentK8sBackendSpec$outboundSchema.parse(deploymentK8sBackendSpec), ); } export function deploymentK8sBackendSpecFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentK8sBackendSpec$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentK8sBackendSpec' from JSON`, ); }