/* * 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"; /** * Latest health status of the webhooks system */ export const WebhooksHealthCheckStatusStatus = { Healthy: "healthy", Unhealthy: "unhealthy", Unknown: "unknown", } as const; /** * Latest health status of the webhooks system */ export type WebhooksHealthCheckStatusStatus = ClosedEnum< typeof WebhooksHealthCheckStatusStatus >; /** * The representation of a webhooks health check response */ export type WebhooksHealthCheckStatus = { /** * Latest health status of the webhooks system */ status?: WebhooksHealthCheckStatusStatus | undefined; /** * ISO8601 timestamp of the last successful health check with millisecond precision */ lastCheckedAt?: Date | undefined; }; /** @internal */ export const WebhooksHealthCheckStatusStatus$inboundSchema: z.ZodNativeEnum< typeof WebhooksHealthCheckStatusStatus > = z.nativeEnum(WebhooksHealthCheckStatusStatus); /** @internal */ export const WebhooksHealthCheckStatus$inboundSchema: z.ZodType< WebhooksHealthCheckStatus, z.ZodTypeDef, unknown > = z.object({ status: WebhooksHealthCheckStatusStatus$inboundSchema.optional(), last_checked_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), }).transform((v) => { return remap$(v, { "last_checked_at": "lastCheckedAt", }); }); export function webhooksHealthCheckStatusFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhooksHealthCheckStatus$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhooksHealthCheckStatus' from JSON`, ); }