/* * 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"; export type GetEvalSuiteVersionRequest = { suiteId: string; version: number; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; export type GetEvalSuiteVersionManifest = { schemaVersion?: string | undefined; tasks: Array; metadata?: { [k: string]: any } | undefined; }; /** * OK */ export type GetEvalSuiteVersionResponseBody = { id: string; object: "eval.suite.version"; suiteId: string; version: number; manifest: GetEvalSuiteVersionManifest; datasetFileIds: Array; metadata: { [k: string]: string }; createdAt: number; }; /** @internal */ export const GetEvalSuiteVersionRequest$inboundSchema: z.ZodType< GetEvalSuiteVersionRequest, z.ZodTypeDef, unknown > = z.object({ suite_id: z.string(), version: z.number().int(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "suite_id": "suiteId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type GetEvalSuiteVersionRequest$Outbound = { suite_id: string; version: number; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const GetEvalSuiteVersionRequest$outboundSchema: z.ZodType< GetEvalSuiteVersionRequest$Outbound, z.ZodTypeDef, GetEvalSuiteVersionRequest > = z.object({ suiteId: z.string(), version: z.number().int(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { suiteId: "suite_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function getEvalSuiteVersionRequestToJSON( getEvalSuiteVersionRequest: GetEvalSuiteVersionRequest, ): string { return JSON.stringify( GetEvalSuiteVersionRequest$outboundSchema.parse(getEvalSuiteVersionRequest), ); } export function getEvalSuiteVersionRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetEvalSuiteVersionRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEvalSuiteVersionRequest' from JSON`, ); } /** @internal */ export const GetEvalSuiteVersionManifest$inboundSchema: z.ZodType< GetEvalSuiteVersionManifest, z.ZodTypeDef, unknown > = z.object({ schema_version: z.string().default("2026-05-27"), tasks: z.array(z.nullable(z.any())), metadata: z.record(z.any()).optional(), }).transform((v) => { return remap$(v, { "schema_version": "schemaVersion", }); }); /** @internal */ export type GetEvalSuiteVersionManifest$Outbound = { schema_version: string; tasks: Array; metadata?: { [k: string]: any } | undefined; }; /** @internal */ export const GetEvalSuiteVersionManifest$outboundSchema: z.ZodType< GetEvalSuiteVersionManifest$Outbound, z.ZodTypeDef, GetEvalSuiteVersionManifest > = z.object({ schemaVersion: z.string().default("2026-05-27"), tasks: z.array(z.nullable(z.any())), metadata: z.record(z.any()).optional(), }).transform((v) => { return remap$(v, { schemaVersion: "schema_version", }); }); export function getEvalSuiteVersionManifestToJSON( getEvalSuiteVersionManifest: GetEvalSuiteVersionManifest, ): string { return JSON.stringify( GetEvalSuiteVersionManifest$outboundSchema.parse( getEvalSuiteVersionManifest, ), ); } export function getEvalSuiteVersionManifestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetEvalSuiteVersionManifest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEvalSuiteVersionManifest' from JSON`, ); } /** @internal */ export const GetEvalSuiteVersionResponseBody$inboundSchema: z.ZodType< GetEvalSuiteVersionResponseBody, z.ZodTypeDef, unknown > = z.object({ id: z.string(), object: z.literal("eval.suite.version"), suite_id: z.string(), version: z.number().int(), manifest: z.lazy(() => GetEvalSuiteVersionManifest$inboundSchema), dataset_file_ids: z.array(z.string()), metadata: z.record(z.string()), created_at: z.number().int(), }).transform((v) => { return remap$(v, { "suite_id": "suiteId", "dataset_file_ids": "datasetFileIds", "created_at": "createdAt", }); }); /** @internal */ export type GetEvalSuiteVersionResponseBody$Outbound = { id: string; object: "eval.suite.version"; suite_id: string; version: number; manifest: GetEvalSuiteVersionManifest$Outbound; dataset_file_ids: Array; metadata: { [k: string]: string }; created_at: number; }; /** @internal */ export const GetEvalSuiteVersionResponseBody$outboundSchema: z.ZodType< GetEvalSuiteVersionResponseBody$Outbound, z.ZodTypeDef, GetEvalSuiteVersionResponseBody > = z.object({ id: z.string(), object: z.literal("eval.suite.version"), suiteId: z.string(), version: z.number().int(), manifest: z.lazy(() => GetEvalSuiteVersionManifest$outboundSchema), datasetFileIds: z.array(z.string()), metadata: z.record(z.string()), createdAt: z.number().int(), }).transform((v) => { return remap$(v, { suiteId: "suite_id", datasetFileIds: "dataset_file_ids", createdAt: "created_at", }); }); export function getEvalSuiteVersionResponseBodyToJSON( getEvalSuiteVersionResponseBody: GetEvalSuiteVersionResponseBody, ): string { return JSON.stringify( GetEvalSuiteVersionResponseBody$outboundSchema.parse( getEvalSuiteVersionResponseBody, ), ); } export function getEvalSuiteVersionResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetEvalSuiteVersionResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetEvalSuiteVersionResponseBody' from JSON`, ); }