/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: f00378f592a1 */ 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 Koyeb backend. */ export type DeploymentKoyebBackendSpec = { type: "koyeb"; /** * Docker build context, as a path in the repo. Defaults to the repo root. */ buildDirectory?: string | null | undefined; /** * Path to the Dockerfile, relative to 'build_directory'. Defaults to 'Dockerfile'. */ dockerfilePath?: string | null | undefined; }; /** @internal */ export const DeploymentKoyebBackendSpec$inboundSchema: z.ZodType< DeploymentKoyebBackendSpec, unknown > = z.object({ type: z.literal("koyeb"), build_directory: z.nullable(z.string()).optional(), dockerfile_path: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "build_directory": "buildDirectory", "dockerfile_path": "dockerfilePath", }); }); /** @internal */ export type DeploymentKoyebBackendSpec$Outbound = { type: "koyeb"; build_directory?: string | null | undefined; dockerfile_path?: string | null | undefined; }; /** @internal */ export const DeploymentKoyebBackendSpec$outboundSchema: z.ZodType< DeploymentKoyebBackendSpec$Outbound, DeploymentKoyebBackendSpec > = z.object({ type: z.literal("koyeb"), buildDirectory: z.nullable(z.string()).optional(), dockerfilePath: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { buildDirectory: "build_directory", dockerfilePath: "dockerfile_path", }); }); export function deploymentKoyebBackendSpecToJSON( deploymentKoyebBackendSpec: DeploymentKoyebBackendSpec, ): string { return JSON.stringify( DeploymentKoyebBackendSpec$outboundSchema.parse(deploymentKoyebBackendSpec), ); } export function deploymentKoyebBackendSpecFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeploymentKoyebBackendSpec$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeploymentKoyebBackendSpec' from JSON`, ); }