/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ShellEnvironmentContainerAuto, ShellEnvironmentContainerAuto$inboundSchema, ShellEnvironmentContainerAuto$Outbound, ShellEnvironmentContainerAuto$outboundSchema, } from "./shellenvironmentcontainerauto.js"; import { ShellEnvironmentContainerReference, ShellEnvironmentContainerReference$inboundSchema, ShellEnvironmentContainerReference$Outbound, ShellEnvironmentContainerReference$outboundSchema, } from "./shellenvironmentcontainerreference.js"; export type ShellEnvironment = | ShellEnvironmentContainerAuto | ShellEnvironmentContainerReference; /** @internal */ export const ShellEnvironment$inboundSchema: z.ZodType< ShellEnvironment, z.ZodTypeDef, unknown > = z.union([ ShellEnvironmentContainerAuto$inboundSchema, ShellEnvironmentContainerReference$inboundSchema, ]); /** @internal */ export type ShellEnvironment$Outbound = | ShellEnvironmentContainerAuto$Outbound | ShellEnvironmentContainerReference$Outbound; /** @internal */ export const ShellEnvironment$outboundSchema: z.ZodType< ShellEnvironment$Outbound, z.ZodTypeDef, ShellEnvironment > = z.union([ ShellEnvironmentContainerAuto$outboundSchema, ShellEnvironmentContainerReference$outboundSchema, ]); export function shellEnvironmentToJSON( shellEnvironment: ShellEnvironment, ): string { return JSON.stringify( ShellEnvironment$outboundSchema.parse(shellEnvironment), ); } export function shellEnvironmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ShellEnvironment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ShellEnvironment' from JSON`, ); }