/* * 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 CatalogHealthResponse = { isAvailable: boolean; error?: string | undefined; checkedAt: number; }; /** @internal */ export const CatalogHealthResponse$inboundSchema: z.ZodType< CatalogHealthResponse, z.ZodTypeDef, unknown > = z.object({ is_available: z.boolean(), error: z.string().optional(), checked_at: z.number(), }).transform((v) => { return remap$(v, { "is_available": "isAvailable", "checked_at": "checkedAt", }); }); /** @internal */ export type CatalogHealthResponse$Outbound = { is_available: boolean; error?: string | undefined; checked_at: number; }; /** @internal */ export const CatalogHealthResponse$outboundSchema: z.ZodType< CatalogHealthResponse$Outbound, z.ZodTypeDef, CatalogHealthResponse > = z.object({ isAvailable: z.boolean(), error: z.string().optional(), checkedAt: z.number(), }).transform((v) => { return remap$(v, { isAvailable: "is_available", checkedAt: "checked_at", }); }); export function catalogHealthResponseToJSON( catalogHealthResponse: CatalogHealthResponse, ): string { return JSON.stringify( CatalogHealthResponse$outboundSchema.parse(catalogHealthResponse), ); } export function catalogHealthResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CatalogHealthResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CatalogHealthResponse' from JSON`, ); }