import { z } from 'zod';
import { MetriportWebhookType } from './types';
/**
 * Parses an incoming Metriport webhook. The discriminator (`meta.type`) is
 * nested, so we rely on a union rather than a discriminated union.
 */
export declare const webhookPayloadSchema: z.ZodUnion<[z.ZodObject<{
    meta: z.ZodObject<{
        messageId: z.ZodString;
        when: z.ZodString;
        requestId: z.ZodOptional<z.ZodString>;
        data: z.ZodOptional<z.ZodUnknown>;
    } & {
        type: z.ZodLiteral<MetriportWebhookType.PatientAdmit>;
    }, "strip", z.ZodTypeAny, {
        type: MetriportWebhookType.PatientAdmit;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }, {
        type: MetriportWebhookType.PatientAdmit;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }>;
    payload: z.ZodObject<{
        url: z.ZodString;
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        admitTimestamp: z.ZodString;
        dischargeTimestamp: z.ZodOptional<z.ZodString>;
        whenSourceSent: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    }, {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    }>;
}, "strip", z.ZodTypeAny, {
    payload: {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    };
    meta: {
        type: MetriportWebhookType.PatientAdmit;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
}, {
    payload: {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    };
    meta: {
        type: MetriportWebhookType.PatientAdmit;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
}>, z.ZodObject<{
    meta: z.ZodObject<{
        messageId: z.ZodString;
        when: z.ZodString;
        requestId: z.ZodOptional<z.ZodString>;
        data: z.ZodOptional<z.ZodUnknown>;
    } & {
        type: z.ZodLiteral<MetriportWebhookType.PatientDischarge>;
    }, "strip", z.ZodTypeAny, {
        type: MetriportWebhookType.PatientDischarge;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }, {
        type: MetriportWebhookType.PatientDischarge;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }>;
    payload: z.ZodObject<{
        url: z.ZodString;
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        admitTimestamp: z.ZodString;
        whenSourceSent: z.ZodOptional<z.ZodString>;
    } & {
        dischargeTimestamp: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        patientId: string;
        url: string;
        admitTimestamp: string;
        dischargeTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        whenSourceSent?: string | undefined;
    }, {
        patientId: string;
        url: string;
        admitTimestamp: string;
        dischargeTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        whenSourceSent?: string | undefined;
    }>;
}, "strip", z.ZodTypeAny, {
    payload: {
        patientId: string;
        url: string;
        admitTimestamp: string;
        dischargeTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        whenSourceSent?: string | undefined;
    };
    meta: {
        type: MetriportWebhookType.PatientDischarge;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
}, {
    payload: {
        patientId: string;
        url: string;
        admitTimestamp: string;
        dischargeTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        whenSourceSent?: string | undefined;
    };
    meta: {
        type: MetriportWebhookType.PatientDischarge;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
}>, z.ZodObject<{
    meta: z.ZodObject<{
        messageId: z.ZodString;
        when: z.ZodString;
        requestId: z.ZodOptional<z.ZodString>;
        data: z.ZodOptional<z.ZodUnknown>;
    } & {
        type: z.ZodLiteral<MetriportWebhookType.PatientTransfer>;
    }, "strip", z.ZodTypeAny, {
        type: MetriportWebhookType.PatientTransfer;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }, {
        type: MetriportWebhookType.PatientTransfer;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }>;
    payload: z.ZodObject<{
        url: z.ZodString;
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        admitTimestamp: z.ZodString;
        dischargeTimestamp: z.ZodOptional<z.ZodString>;
        whenSourceSent: z.ZodOptional<z.ZodString>;
    }, "strip", z.ZodTypeAny, {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    }, {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    }>;
}, "strip", z.ZodTypeAny, {
    payload: {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    };
    meta: {
        type: MetriportWebhookType.PatientTransfer;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
}, {
    payload: {
        patientId: string;
        url: string;
        admitTimestamp: string;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    };
    meta: {
        type: MetriportWebhookType.PatientTransfer;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
}>, z.ZodObject<{
    meta: z.ZodObject<{
        messageId: z.ZodString;
        when: z.ZodString;
        requestId: z.ZodOptional<z.ZodString>;
        data: z.ZodOptional<z.ZodUnknown>;
    } & {
        type: z.ZodLiteral<MetriportWebhookType.DischargeSummary>;
    }, "strip", z.ZodTypeAny, {
        type: MetriportWebhookType.DischargeSummary;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }, {
        type: MetriportWebhookType.DischargeSummary;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }>;
    patients: z.ZodOptional<z.ZodArray<z.ZodObject<{
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        status: z.ZodOptional<z.ZodString>;
        bundle: z.ZodOptional<z.ZodUnknown>;
        url: z.ZodOptional<z.ZodString>;
    }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        status: z.ZodOptional<z.ZodString>;
        bundle: z.ZodOptional<z.ZodUnknown>;
        url: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        status: z.ZodOptional<z.ZodString>;
        bundle: z.ZodOptional<z.ZodUnknown>;
        url: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough">>, "many">>;
    payload: z.ZodOptional<z.ZodObject<{
        url: z.ZodOptional<z.ZodString>;
        patientId: z.ZodOptional<z.ZodString>;
        externalId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
        additionalIds: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>>;
        admitTimestamp: z.ZodOptional<z.ZodString>;
        dischargeTimestamp: z.ZodOptional<z.ZodOptional<z.ZodString>>;
        whenSourceSent: z.ZodOptional<z.ZodOptional<z.ZodString>>;
    }, "strip", z.ZodTypeAny, {
        patientId?: string | undefined;
        url?: string | undefined;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        admitTimestamp?: string | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    }, {
        patientId?: string | undefined;
        url?: string | undefined;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        admitTimestamp?: string | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    }>>;
}, "strip", z.ZodTypeAny, {
    meta: {
        type: MetriportWebhookType.DischargeSummary;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
    payload?: {
        patientId?: string | undefined;
        url?: string | undefined;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        admitTimestamp?: string | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    } | undefined;
    patients?: z.objectOutputType<{
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        status: z.ZodOptional<z.ZodString>;
        bundle: z.ZodOptional<z.ZodUnknown>;
        url: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough">[] | undefined;
}, {
    meta: {
        type: MetriportWebhookType.DischargeSummary;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
    payload?: {
        patientId?: string | undefined;
        url?: string | undefined;
        externalId?: string | undefined;
        additionalIds?: Record<string, string[]> | undefined;
        admitTimestamp?: string | undefined;
        dischargeTimestamp?: string | undefined;
        whenSourceSent?: string | undefined;
    } | undefined;
    patients?: z.objectInputType<{
        patientId: z.ZodString;
        externalId: z.ZodOptional<z.ZodString>;
        additionalIds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
        status: z.ZodOptional<z.ZodString>;
        bundle: z.ZodOptional<z.ZodUnknown>;
        url: z.ZodOptional<z.ZodString>;
    }, z.ZodTypeAny, "passthrough">[] | undefined;
}>, z.ZodObject<{
    meta: z.ZodObject<{
        messageId: z.ZodString;
        when: z.ZodString;
        requestId: z.ZodOptional<z.ZodString>;
        data: z.ZodOptional<z.ZodUnknown>;
    } & {
        type: z.ZodLiteral<MetriportWebhookType.Ping>;
    }, "strip", z.ZodTypeAny, {
        type: MetriportWebhookType.Ping;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }, {
        type: MetriportWebhookType.Ping;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    }>;
    ping: z.ZodString;
}, "strip", z.ZodTypeAny, {
    meta: {
        type: MetriportWebhookType.Ping;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
    ping: string;
}, {
    meta: {
        type: MetriportWebhookType.Ping;
        messageId: string;
        when: string;
        data?: unknown;
        requestId?: string | undefined;
    };
    ping: string;
}>]>;
export type WebhookPayloadSchema = z.infer<typeof webhookPayloadSchema>;
