import { z } from "zod";
import { AppPropertySchema, ActionPropertySchema, ConnectionPropertySchema, InputsPropertySchema, TriggerInboxNamePropertySchema, } from "../../../types/properties";
import { TriggerInboxItemSchema, } from "../../../schemas/TriggerInbox";
const EnsureTriggerInboxDescription = "Get-or-create a trigger inbox by name. Idempotent on (user, account, name): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the name exists with a different subscription.";
export const EnsureTriggerInboxSchema = z
    .object({
    name: TriggerInboxNamePropertySchema.describe("Inbox name; serves as the idempotency key. Required for ensureTriggerInbox — without one, the API mints a fresh inbox each call (use createTriggerInbox for that path)."),
    app: AppPropertySchema,
    action: ActionPropertySchema,
    connection: ConnectionPropertySchema.nullable()
        .optional()
        .describe("Connection alias or connection ID. Optional for triggers that don't require auth."),
    inputs: InputsPropertySchema.optional().describe("Input parameters for the trigger subscription"),
    notificationUrl: z
        .string()
        .url()
        .optional()
        .describe("Webhook URL to POST to when new messages arrive"),
})
    .describe(EnsureTriggerInboxDescription);
export { TriggerInboxItemSchema };
