/* * 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"; export type Wandb = { /** * W&B project name */ project: string; /** * W&B entity/team */ entity?: string | null | undefined; /** * Run display name */ name?: string | null | undefined; /** * Tags for the run */ tags?: Array | null | undefined; }; export type IntegrationObject = { type: "wandb"; wandb: Wandb; }; /** @internal */ export const Wandb$inboundSchema: z.ZodType = z .object({ project: z.string(), entity: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), tags: z.nullable(z.array(z.string())).optional(), }); /** @internal */ export type Wandb$Outbound = { project: string; entity?: string | null | undefined; name?: string | null | undefined; tags?: Array | null | undefined; }; /** @internal */ export const Wandb$outboundSchema: z.ZodType< Wandb$Outbound, z.ZodTypeDef, Wandb > = z.object({ project: z.string(), entity: z.nullable(z.string()).optional(), name: z.nullable(z.string()).optional(), tags: z.nullable(z.array(z.string())).optional(), }); export function wandbToJSON(wandb: Wandb): string { return JSON.stringify(Wandb$outboundSchema.parse(wandb)); } export function wandbFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Wandb$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Wandb' from JSON`, ); } /** @internal */ export const IntegrationObject$inboundSchema: z.ZodType< IntegrationObject, z.ZodTypeDef, unknown > = z.object({ type: z.literal("wandb"), wandb: z.lazy(() => Wandb$inboundSchema), }); /** @internal */ export type IntegrationObject$Outbound = { type: "wandb"; wandb: Wandb$Outbound; }; /** @internal */ export const IntegrationObject$outboundSchema: z.ZodType< IntegrationObject$Outbound, z.ZodTypeDef, IntegrationObject > = z.object({ type: z.literal("wandb"), wandb: z.lazy(() => Wandb$outboundSchema), }); export function integrationObjectToJSON( integrationObject: IntegrationObject, ): string { return JSON.stringify( IntegrationObject$outboundSchema.parse(integrationObject), ); } export function integrationObjectFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => IntegrationObject$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'IntegrationObject' from JSON`, ); }