aiconfigsexperimentinforep.ts•2.51 kB
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
import {
AiConfigsLegacyExperimentRep,
AiConfigsLegacyExperimentRep$inboundSchema,
AiConfigsLegacyExperimentRep$Outbound,
AiConfigsLegacyExperimentRep$outboundSchema,
} from "./aiconfigslegacyexperimentrep.js";
export type AiConfigsExperimentInfoRep = {
baselineIdx: number;
items: Array<AiConfigsLegacyExperimentRep>;
};
/** @internal */
export const AiConfigsExperimentInfoRep$inboundSchema: z.ZodType<
AiConfigsExperimentInfoRep,
z.ZodTypeDef,
unknown
> = z.object({
baselineIdx: z.number().int(),
items: z.array(AiConfigsLegacyExperimentRep$inboundSchema),
});
/** @internal */
export type AiConfigsExperimentInfoRep$Outbound = {
baselineIdx: number;
items: Array<AiConfigsLegacyExperimentRep$Outbound>;
};
/** @internal */
export const AiConfigsExperimentInfoRep$outboundSchema: z.ZodType<
AiConfigsExperimentInfoRep$Outbound,
z.ZodTypeDef,
AiConfigsExperimentInfoRep
> = z.object({
baselineIdx: z.number().int(),
items: z.array(AiConfigsLegacyExperimentRep$outboundSchema),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace AiConfigsExperimentInfoRep$ {
/** @deprecated use `AiConfigsExperimentInfoRep$inboundSchema` instead. */
export const inboundSchema = AiConfigsExperimentInfoRep$inboundSchema;
/** @deprecated use `AiConfigsExperimentInfoRep$outboundSchema` instead. */
export const outboundSchema = AiConfigsExperimentInfoRep$outboundSchema;
/** @deprecated use `AiConfigsExperimentInfoRep$Outbound` instead. */
export type Outbound = AiConfigsExperimentInfoRep$Outbound;
}
export function aiConfigsExperimentInfoRepToJSON(
aiConfigsExperimentInfoRep: AiConfigsExperimentInfoRep,
): string {
return JSON.stringify(
AiConfigsExperimentInfoRep$outboundSchema.parse(aiConfigsExperimentInfoRep),
);
}
export function aiConfigsExperimentInfoRepFromJSON(
jsonString: string,
): SafeParseResult<AiConfigsExperimentInfoRep, SDKValidationError> {
return safeParse(
jsonString,
(x) => AiConfigsExperimentInfoRep$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'AiConfigsExperimentInfoRep' from JSON`,
);
}