/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const MemoryLimit = { Oneg: "1g", Fourg: "4g", Sixteeng: "16g", SixtyFourg: "64g", } as const; export type MemoryLimit = ClosedEnum; export type CodeInterpreterContainerAuto = { type: "auto"; fileIds?: Array | null | undefined; memoryLimit?: MemoryLimit | null | undefined; }; /** @internal */ export const MemoryLimit$inboundSchema: z.ZodNativeEnum = z .nativeEnum(MemoryLimit); /** @internal */ export const MemoryLimit$outboundSchema: z.ZodNativeEnum = MemoryLimit$inboundSchema; /** @internal */ export const CodeInterpreterContainerAuto$inboundSchema: z.ZodType< CodeInterpreterContainerAuto, z.ZodTypeDef, unknown > = z.object({ type: z.literal("auto"), file_ids: z.nullable(z.array(z.string())).optional(), memory_limit: z.nullable(MemoryLimit$inboundSchema).optional(), }).transform((v) => { return remap$(v, { "file_ids": "fileIds", "memory_limit": "memoryLimit", }); }); /** @internal */ export type CodeInterpreterContainerAuto$Outbound = { type: "auto"; file_ids?: Array | null | undefined; memory_limit?: string | null | undefined; }; /** @internal */ export const CodeInterpreterContainerAuto$outboundSchema: z.ZodType< CodeInterpreterContainerAuto$Outbound, z.ZodTypeDef, CodeInterpreterContainerAuto > = z.object({ type: z.literal("auto"), fileIds: z.nullable(z.array(z.string())).optional(), memoryLimit: z.nullable(MemoryLimit$outboundSchema).optional(), }).transform((v) => { return remap$(v, { fileIds: "file_ids", memoryLimit: "memory_limit", }); }); export function codeInterpreterContainerAutoToJSON( codeInterpreterContainerAuto: CodeInterpreterContainerAuto, ): string { return JSON.stringify( CodeInterpreterContainerAuto$outboundSchema.parse( codeInterpreterContainerAuto, ), ); } export function codeInterpreterContainerAutoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CodeInterpreterContainerAuto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CodeInterpreterContainerAuto' from JSON`, ); }