/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; import { MemoryStoreMount, MemoryStoreMount$inboundSchema, MemoryStoreMount$Outbound, MemoryStoreMount$outboundSchema, } from "./memorystoremount.js"; import { ShellNetworkPolicy, ShellNetworkPolicy$inboundSchema, ShellNetworkPolicy$Outbound, ShellNetworkPolicy$outboundSchema, } from "./shellnetworkpolicy.js"; import { SkillEntry, SkillEntry$inboundSchema, SkillEntry$Outbound, SkillEntry$outboundSchema, } from "./skillentry.js"; export type ShellEnvironmentContainerReference = { type: "container_reference"; /** * ID of an existing container to reuse. */ containerId: string; networkPolicy?: ShellNetworkPolicy | undefined; /** * Skills to inject into the container's /skills directory. */ skills?: Array | undefined; /** * Memory stores to mount into the container under /mnt/memory. */ memoryStores?: Array | undefined; }; /** @internal */ export const ShellEnvironmentContainerReference$inboundSchema: z.ZodType< ShellEnvironmentContainerReference, z.ZodTypeDef, unknown > = z.object({ type: z.literal("container_reference"), container_id: z.string(), network_policy: ShellNetworkPolicy$inboundSchema.optional(), skills: z.array(SkillEntry$inboundSchema).optional(), memory_stores: z.array(MemoryStoreMount$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "container_id": "containerId", "network_policy": "networkPolicy", "memory_stores": "memoryStores", }); }); /** @internal */ export type ShellEnvironmentContainerReference$Outbound = { type: "container_reference"; container_id: string; network_policy?: ShellNetworkPolicy$Outbound | undefined; skills?: Array | undefined; memory_stores?: Array | undefined; }; /** @internal */ export const ShellEnvironmentContainerReference$outboundSchema: z.ZodType< ShellEnvironmentContainerReference$Outbound, z.ZodTypeDef, ShellEnvironmentContainerReference > = z.object({ type: z.literal("container_reference"), containerId: z.string(), networkPolicy: ShellNetworkPolicy$outboundSchema.optional(), skills: z.array(SkillEntry$outboundSchema).optional(), memoryStores: z.array(MemoryStoreMount$outboundSchema).optional(), }).transform((v) => { return remap$(v, { containerId: "container_id", networkPolicy: "network_policy", memoryStores: "memory_stores", }); }); export function shellEnvironmentContainerReferenceToJSON( shellEnvironmentContainerReference: ShellEnvironmentContainerReference, ): string { return JSON.stringify( ShellEnvironmentContainerReference$outboundSchema.parse( shellEnvironmentContainerReference, ), ); } export function shellEnvironmentContainerReferenceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ShellEnvironmentContainerReference$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ShellEnvironmentContainerReference' from JSON`, ); }