/**
 * Cloudflare EMAIL-SECURITY API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service email-security
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
export const GetInvestigateRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    postfixId: Schema.String.pipe(T.HttpPath("postfixId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/investigate/{postfixId}",
}));
export const GetInvestigateResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    actionLog: Schema.Unknown,
    clientRecipients: Schema.Array(Schema.String),
    detectionReasons: Schema.Array(Schema.String),
    isPhishSubmission: Schema.Boolean,
    isQuarantined: Schema.Boolean,
    postfixId: Schema.String,
    properties: Schema.Struct({
        allowlistedPattern: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        allowlistedPatternType: Schema.optional(Schema.Union([
            Schema.Literals([
                "quarantine_release",
                "acceptable_sender",
                "allowed_sender",
                "allowed_recipient",
                "domain_similarity",
                "domain_recency",
                "managed_acceptable_sender",
                "outbound_ndr",
            ]),
            Schema.Null,
        ])),
        blocklistedMessage: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        blocklistedPattern: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        whitelistedPatternType: Schema.optional(Schema.Union([
            Schema.Literals([
                "quarantine_release",
                "acceptable_sender",
                "allowed_sender",
                "allowed_recipient",
                "domain_similarity",
                "domain_recency",
                "managed_acceptable_sender",
                "outbound_ndr",
            ]),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        allowlistedPattern: "allowlisted_pattern",
        allowlistedPatternType: "allowlisted_pattern_type",
        blocklistedMessage: "blocklisted_message",
        blocklistedPattern: "blocklisted_pattern",
        whitelistedPatternType: "whitelisted_pattern_type",
    })),
    ts: Schema.String,
    alertId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    deliveryMode: Schema.optional(Schema.Union([
        Schema.Literal("DIRECT"),
        Schema.Literal("BCC"),
        Schema.Literal("JOURNAL"),
        Schema.Literal("REVIEW_SUBMISSION"),
        Schema.Literal("DMARC_UNVERIFIED"),
        Schema.Literal("DMARC_FAILURE_REPORT"),
        Schema.Literal("DMARC_AGGREGATE_REPORT"),
        Schema.Literal("THREAT_INTEL_SUBMISSION"),
        Schema.Literal("SIMULATION_SUBMISSION"),
        Schema.Literal("API"),
        Schema.Literal("RETRO_SCAN"),
        Schema.Null,
    ])),
    edfHash: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    envelopeFrom: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    envelopeTo: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    finalDisposition: Schema.optional(Schema.Union([
        Schema.Literal("MALICIOUS"),
        Schema.Literal("MALICIOUS-BEC"),
        Schema.Literal("SUSPICIOUS"),
        Schema.Literal("SPOOF"),
        Schema.Literal("SPAM"),
        Schema.Literal("BULK"),
        Schema.Literal("ENCRYPTED"),
        Schema.Literal("EXTERNAL"),
        Schema.Literal("UNKNOWN"),
        Schema.Literal("NONE"),
        Schema.Null,
    ])),
    findings: Schema.optional(Schema.Union([
        Schema.Array(Schema.Struct({
            attachment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            detection: Schema.optional(Schema.Union([
                Schema.Literal("MALICIOUS"),
                Schema.Literal("MALICIOUS-BEC"),
                Schema.Literal("SUSPICIOUS"),
                Schema.Literal("SPOOF"),
                Schema.Literal("SPAM"),
                Schema.Literal("BULK"),
                Schema.Literal("ENCRYPTED"),
                Schema.Literal("EXTERNAL"),
                Schema.Literal("UNKNOWN"),
                Schema.Literal("NONE"),
                Schema.Null,
            ])),
            field: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            portion: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            reason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        })),
        Schema.Null,
    ])),
    from: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    fromName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    htmltextStructureHash: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    messageId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    postfixIdOutbound: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    replyto: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    sentDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    subject: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    threatCategories: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    to: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    toName: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    validation: Schema.optional(Schema.Union([
        Schema.Struct({
            comment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            dkim: Schema.optional(Schema.Union([
                Schema.Literal("pass"),
                Schema.Literal("neutral"),
                Schema.Literal("fail"),
                Schema.Literal("error"),
                Schema.Literal("none"),
                Schema.Null,
            ])),
            dmarc: Schema.optional(Schema.Union([
                Schema.Literal("pass"),
                Schema.Literal("neutral"),
                Schema.Literal("fail"),
                Schema.Literal("error"),
                Schema.Literal("none"),
                Schema.Null,
            ])),
            spf: Schema.optional(Schema.Union([
                Schema.Literal("pass"),
                Schema.Literal("neutral"),
                Schema.Literal("fail"),
                Schema.Literal("error"),
                Schema.Literal("none"),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    actionLog: "action_log",
    clientRecipients: "client_recipients",
    detectionReasons: "detection_reasons",
    isPhishSubmission: "is_phish_submission",
    isQuarantined: "is_quarantined",
    postfixId: "postfix_id",
    properties: "properties",
    ts: "ts",
    alertId: "alert_id",
    deliveryMode: "delivery_mode",
    edfHash: "edf_hash",
    envelopeFrom: "envelope_from",
    envelopeTo: "envelope_to",
    finalDisposition: "final_disposition",
    findings: "findings",
    from: "from",
    fromName: "from_name",
    htmltextStructureHash: "htmltext_structure_hash",
    messageId: "message_id",
    postfixIdOutbound: "postfix_id_outbound",
    replyto: "replyto",
    sentDate: "sent_date",
    subject: "subject",
    threatCategories: "threat_categories",
    to: "to",
    toName: "to_name",
    validation: "validation",
}))
    .pipe(T.ResponsePath("result"));
export const getInvestigate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInvestigateRequest,
    output: GetInvestigateResponse,
    errors: [],
}));
export const ListInvestigatesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    actionLog: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("action_log")),
    alertId: Schema.optional(Schema.String).pipe(T.HttpQuery("alert_id")),
    cursor: Schema.optional(Schema.String).pipe(T.HttpQuery("cursor")),
    detectionsOnly: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("detections_only")),
    domain: Schema.optional(Schema.String).pipe(T.HttpQuery("domain")),
    end: Schema.optional(Schema.String).pipe(T.HttpQuery("end")),
    finalDisposition: Schema.optional(Schema.Literals([
        "MALICIOUS",
        "SUSPICIOUS",
        "SPOOF",
        "SPAM",
        "BULK",
        "NONE",
    ])).pipe(T.HttpQuery("final_disposition")),
    messageAction: Schema.optional(Schema.Literals(["PREVIEW", "QUARANTINE_RELEASED", "MOVED"])).pipe(T.HttpQuery("message_action")),
    messageId: Schema.optional(Schema.String).pipe(T.HttpQuery("message_id")),
    metric: Schema.optional(Schema.String).pipe(T.HttpQuery("metric")),
    query: Schema.optional(Schema.String).pipe(T.HttpQuery("query")),
    recipient: Schema.optional(Schema.String).pipe(T.HttpQuery("recipient")),
    sender: Schema.optional(Schema.String).pipe(T.HttpQuery("sender")),
    start: Schema.optional(Schema.String).pipe(T.HttpQuery("start")),
    subject: Schema.optional(Schema.String).pipe(T.HttpQuery("subject")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/investigate",
}));
export const ListInvestigatesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        actionLog: Schema.Unknown,
        clientRecipients: Schema.Array(Schema.String),
        detectionReasons: Schema.Array(Schema.String),
        isPhishSubmission: Schema.Boolean,
        isQuarantined: Schema.Boolean,
        postfixId: Schema.String,
        properties: Schema.Struct({
            allowlistedPattern: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            allowlistedPatternType: Schema.optional(Schema.Union([
                Schema.Literals([
                    "quarantine_release",
                    "acceptable_sender",
                    "allowed_sender",
                    "allowed_recipient",
                    "domain_similarity",
                    "domain_recency",
                    "managed_acceptable_sender",
                    "outbound_ndr",
                ]),
                Schema.Null,
            ])),
            blocklistedMessage: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
            blocklistedPattern: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            whitelistedPatternType: Schema.optional(Schema.Union([
                Schema.Literals([
                    "quarantine_release",
                    "acceptable_sender",
                    "allowed_sender",
                    "allowed_recipient",
                    "domain_similarity",
                    "domain_recency",
                    "managed_acceptable_sender",
                    "outbound_ndr",
                ]),
                Schema.Null,
            ])),
        }).pipe(Schema.encodeKeys({
            allowlistedPattern: "allowlisted_pattern",
            allowlistedPatternType: "allowlisted_pattern_type",
            blocklistedMessage: "blocklisted_message",
            blocklistedPattern: "blocklisted_pattern",
            whitelistedPatternType: "whitelisted_pattern_type",
        })),
        ts: Schema.String,
        alertId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        deliveryMode: Schema.optional(Schema.Union([
            Schema.Literal("DIRECT"),
            Schema.Literal("BCC"),
            Schema.Literal("JOURNAL"),
            Schema.Literal("REVIEW_SUBMISSION"),
            Schema.Literal("DMARC_UNVERIFIED"),
            Schema.Literal("DMARC_FAILURE_REPORT"),
            Schema.Literal("DMARC_AGGREGATE_REPORT"),
            Schema.Literal("THREAT_INTEL_SUBMISSION"),
            Schema.Literal("SIMULATION_SUBMISSION"),
            Schema.Literal("API"),
            Schema.Literal("RETRO_SCAN"),
            Schema.Null,
        ])),
        edfHash: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        envelopeFrom: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        envelopeTo: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        finalDisposition: Schema.optional(Schema.Union([
            Schema.Literal("MALICIOUS"),
            Schema.Literal("MALICIOUS-BEC"),
            Schema.Literal("SUSPICIOUS"),
            Schema.Literal("SPOOF"),
            Schema.Literal("SPAM"),
            Schema.Literal("BULK"),
            Schema.Literal("ENCRYPTED"),
            Schema.Literal("EXTERNAL"),
            Schema.Literal("UNKNOWN"),
            Schema.Literal("NONE"),
            Schema.Null,
        ])),
        findings: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                attachment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                detail: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                detection: Schema.optional(Schema.Union([
                    Schema.Literal("MALICIOUS"),
                    Schema.Literal("MALICIOUS-BEC"),
                    Schema.Literal("SUSPICIOUS"),
                    Schema.Literal("SPOOF"),
                    Schema.Literal("SPAM"),
                    Schema.Literal("BULK"),
                    Schema.Literal("ENCRYPTED"),
                    Schema.Literal("EXTERNAL"),
                    Schema.Literal("UNKNOWN"),
                    Schema.Literal("NONE"),
                    Schema.Null,
                ])),
                field: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                portion: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                reason: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                score: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            })),
            Schema.Null,
        ])),
        from: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        fromName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        htmltextStructureHash: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        messageId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        postfixIdOutbound: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        replyto: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        sentDate: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        subject: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        threatCategories: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        to: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        toName: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        validation: Schema.optional(Schema.Union([
            Schema.Struct({
                comment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                dkim: Schema.optional(Schema.Union([
                    Schema.Literal("pass"),
                    Schema.Literal("neutral"),
                    Schema.Literal("fail"),
                    Schema.Literal("error"),
                    Schema.Literal("none"),
                    Schema.Null,
                ])),
                dmarc: Schema.optional(Schema.Union([
                    Schema.Literal("pass"),
                    Schema.Literal("neutral"),
                    Schema.Literal("fail"),
                    Schema.Literal("error"),
                    Schema.Literal("none"),
                    Schema.Null,
                ])),
                spf: Schema.optional(Schema.Union([
                    Schema.Literal("pass"),
                    Schema.Literal("neutral"),
                    Schema.Literal("fail"),
                    Schema.Literal("error"),
                    Schema.Literal("none"),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        actionLog: "action_log",
        clientRecipients: "client_recipients",
        detectionReasons: "detection_reasons",
        isPhishSubmission: "is_phish_submission",
        isQuarantined: "is_quarantined",
        postfixId: "postfix_id",
        properties: "properties",
        ts: "ts",
        alertId: "alert_id",
        deliveryMode: "delivery_mode",
        edfHash: "edf_hash",
        envelopeFrom: "envelope_from",
        envelopeTo: "envelope_to",
        finalDisposition: "final_disposition",
        findings: "findings",
        from: "from",
        fromName: "from_name",
        htmltextStructureHash: "htmltext_structure_hash",
        messageId: "message_id",
        postfixIdOutbound: "postfix_id_outbound",
        replyto: "replyto",
        sentDate: "sent_date",
        subject: "subject",
        threatCategories: "threat_categories",
        to: "to",
        toName: "to_name",
        validation: "validation",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listInvestigates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListInvestigatesRequest,
    output: ListInvestigatesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const GetInvestigateDetectionRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    postfixId: Schema.String.pipe(T.HttpPath("postfixId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/investigate/{postfixId}/detections",
}));
export const GetInvestigateDetectionResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    action: Schema.String,
    attachments: Schema.Array(Schema.Struct({
        size: Schema.Number,
        contentType: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        detection: Schema.optional(Schema.Union([
            Schema.Literal("MALICIOUS"),
            Schema.Literal("MALICIOUS-BEC"),
            Schema.Literal("SUSPICIOUS"),
            Schema.Literal("SPOOF"),
            Schema.Literal("SPAM"),
            Schema.Literal("BULK"),
            Schema.Literal("ENCRYPTED"),
            Schema.Literal("EXTERNAL"),
            Schema.Literal("UNKNOWN"),
            Schema.Literal("NONE"),
            Schema.Null,
        ])),
        encrypted: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        size: "size",
        contentType: "content_type",
        detection: "detection",
        encrypted: "encrypted",
        name: "name",
    }))),
    headers: Schema.Array(Schema.Struct({
        name: Schema.String,
        value: Schema.String,
    })),
    links: Schema.Array(Schema.Struct({
        href: Schema.String,
        text: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
    senderInfo: Schema.Struct({
        asName: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        asNumber: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        geo: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        ip: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        pld: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        asName: "as_name",
        asNumber: "as_number",
        geo: "geo",
        ip: "ip",
        pld: "pld",
    })),
    threatCategories: Schema.Array(Schema.Struct({
        id: Schema.Number,
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
    validation: Schema.Struct({
        comment: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        dkim: Schema.optional(Schema.Union([
            Schema.Literal("pass"),
            Schema.Literal("neutral"),
            Schema.Literal("fail"),
            Schema.Literal("error"),
            Schema.Literal("none"),
            Schema.Null,
        ])),
        dmarc: Schema.optional(Schema.Union([
            Schema.Literal("pass"),
            Schema.Literal("neutral"),
            Schema.Literal("fail"),
            Schema.Literal("error"),
            Schema.Literal("none"),
            Schema.Null,
        ])),
        spf: Schema.optional(Schema.Union([
            Schema.Literal("pass"),
            Schema.Literal("neutral"),
            Schema.Literal("fail"),
            Schema.Literal("error"),
            Schema.Literal("none"),
            Schema.Null,
        ])),
    }),
    finalDisposition: Schema.optional(Schema.Union([
        Schema.Literal("MALICIOUS"),
        Schema.Literal("MALICIOUS-BEC"),
        Schema.Literal("SUSPICIOUS"),
        Schema.Literal("SPOOF"),
        Schema.Literal("SPAM"),
        Schema.Literal("BULK"),
        Schema.Literal("ENCRYPTED"),
        Schema.Literal("EXTERNAL"),
        Schema.Literal("UNKNOWN"),
        Schema.Literal("NONE"),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    action: "action",
    attachments: "attachments",
    headers: "headers",
    links: "links",
    senderInfo: "sender_info",
    threatCategories: "threat_categories",
    validation: "validation",
    finalDisposition: "final_disposition",
}))
    .pipe(T.ResponsePath("result"));
export const getInvestigateDetection = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInvestigateDetectionRequest,
    output: GetInvestigateDetectionResponse,
    errors: [],
}));
export const CreateInvestigateMoveRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    postfixId: Schema.String.pipe(T.HttpPath("postfixId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    destination: Schema.Literals([
        "Inbox",
        "JunkEmail",
        "DeletedItems",
        "RecoverableItemsDeletions",
        "RecoverableItemsPurges",
    ]),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/investigate/{postfixId}/move",
}));
export const CreateInvestigateMoveResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        completedTimestamp: Schema.String,
        itemCount: Schema.Number,
        success: Schema.Boolean,
        destination: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        messageId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        operation: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        recipient: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        completedTimestamp: "completed_timestamp",
        itemCount: "item_count",
        success: "success",
        destination: "destination",
        messageId: "message_id",
        operation: "operation",
        recipient: "recipient",
        status: "status",
    }))),
});
export const createInvestigateMove = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: CreateInvestigateMoveRequest,
    output: CreateInvestigateMoveResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const BulkInvestigateMoveRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    destination: Schema.Literals([
        "Inbox",
        "JunkEmail",
        "DeletedItems",
        "RecoverableItemsDeletions",
        "RecoverableItemsPurges",
    ]),
    postfixIds: Schema.Array(Schema.String),
}).pipe(Schema.encodeKeys({
    destination: "destination",
    postfixIds: "postfix_ids",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/investigate/move",
}));
export const BulkInvestigateMoveResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        completedTimestamp: Schema.String,
        itemCount: Schema.Number,
        success: Schema.Boolean,
        destination: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        messageId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        operation: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        recipient: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        completedTimestamp: "completed_timestamp",
        itemCount: "item_count",
        success: "success",
        destination: "destination",
        messageId: "message_id",
        operation: "operation",
        recipient: "recipient",
        status: "status",
    }))),
});
export const bulkInvestigateMove = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkInvestigateMoveRequest,
    output: BulkInvestigateMoveResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const GetInvestigatePreviewRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    postfixId: Schema.String.pipe(T.HttpPath("postfixId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/investigate/{postfixId}/preview",
}));
export const GetInvestigatePreviewResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    screenshot: Schema.String,
}).pipe(T.ResponsePath("result"));
export const getInvestigatePreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInvestigatePreviewRequest,
    output: GetInvestigatePreviewResponse,
    errors: [],
}));
export const CreateInvestigatePreviewRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    postfixId: Schema.String,
}).pipe(Schema.encodeKeys({ postfixId: "postfix_id" }), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/investigate/preview",
}));
export const CreateInvestigatePreviewResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    screenshot: Schema.String,
}).pipe(T.ResponsePath("result"));
export const createInvestigatePreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateInvestigatePreviewRequest,
    output: CreateInvestigatePreviewResponse,
    errors: [],
}));
export const GetInvestigateRawRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    postfixId: Schema.String.pipe(T.HttpPath("postfixId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/investigate/{postfixId}/raw",
}));
export const GetInvestigateRawResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    raw: Schema.String,
}).pipe(T.ResponsePath("result"));
export const getInvestigateRaw = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInvestigateRawRequest,
    output: GetInvestigateRawResponse,
    errors: [],
}));
export const CreateInvestigateReclassifyRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    postfixId: Schema.String.pipe(T.HttpPath("postfixId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    expectedDisposition: Schema.Literals([
        "NONE",
        "BULK",
        "MALICIOUS",
        "SPAM",
        "SPOOF",
        "SUSPICIOUS",
    ]),
    emlContent: Schema.optional(Schema.String),
    escalatedSubmissionId: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    expectedDisposition: "expected_disposition",
    emlContent: "eml_content",
    escalatedSubmissionId: "escalated_submission_id",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/investigate/{postfixId}/reclassify",
}));
export const CreateInvestigateReclassifyResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const createInvestigateReclassify = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateInvestigateReclassifyRequest,
    output: CreateInvestigateReclassifyResponse,
    errors: [],
}));
export const BulkInvestigateReleaseRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    body: Schema.Array(Schema.String).pipe(T.HttpBody()),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/investigate/release",
}));
export const BulkInvestigateReleaseResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        postfixId: Schema.String,
        delivered: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        failed: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
        undelivered: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    }).pipe(Schema.encodeKeys({
        postfixId: "postfix_id",
        delivered: "delivered",
        failed: "failed",
        undelivered: "undelivered",
    }))),
});
export const bulkInvestigateRelease = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkInvestigateReleaseRequest,
    output: BulkInvestigateReleaseResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const GetInvestigateTraceRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    postfixId: Schema.String.pipe(T.HttpPath("postfixId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/investigate/{postfixId}/trace",
}));
export const GetInvestigateTraceResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    inbound: Schema.Struct({
        lines: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                lineno: Schema.Number,
                message: Schema.String,
                ts: Schema.String,
            })),
            Schema.Null,
        ])),
        pending: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    }),
    outbound: Schema.Struct({
        lines: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                lineno: Schema.Number,
                message: Schema.String,
                ts: Schema.String,
            })),
            Schema.Null,
        ])),
        pending: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    }),
}).pipe(T.ResponsePath("result"));
export const getInvestigateTrace = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInvestigateTraceRequest,
    output: GetInvestigateTraceResponse,
    errors: [],
}));
export const GetSettingAllowPolicyRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    policyId: Schema.Number.pipe(T.HttpPath("policyId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/allow_policies/{policyId}",
}));
export const GetSettingAllowPolicyResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isAcceptableSender: Schema.Boolean,
    isExemptRecipient: Schema.Boolean,
    isRegex: Schema.Boolean,
    isTrustedSender: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    verifySender: Schema.Boolean,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isRecipient: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isSender: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isSpoof: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isAcceptableSender: "is_acceptable_sender",
    isExemptRecipient: "is_exempt_recipient",
    isRegex: "is_regex",
    isTrustedSender: "is_trusted_sender",
    lastModified: "last_modified",
    pattern: "pattern",
    patternType: "pattern_type",
    verifySender: "verify_sender",
    comments: "comments",
    isRecipient: "is_recipient",
    isSender: "is_sender",
    isSpoof: "is_spoof",
}))
    .pipe(T.ResponsePath("result"));
export const getSettingAllowPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingAllowPolicyRequest,
    output: GetSettingAllowPolicyResponse,
    errors: [],
}));
export const ListSettingAllowPoliciesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    isAcceptableSender: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_acceptable_sender")),
    isExemptRecipient: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_exempt_recipient")),
    isRecipient: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_recipient")),
    isSender: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_sender")),
    isSpoof: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_spoof")),
    isTrustedSender: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_trusted_sender")),
    order: Schema.optional(Schema.Literals(["pattern", "created_at"])).pipe(T.HttpQuery("order")),
    pattern: Schema.optional(Schema.String).pipe(T.HttpQuery("pattern")),
    patternType: Schema.optional(Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"])).pipe(T.HttpQuery("pattern_type")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
    verifySender: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("verify_sender")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/allow_policies",
}));
export const ListSettingAllowPoliciesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.Number,
        createdAt: Schema.String,
        isAcceptableSender: Schema.Boolean,
        isExemptRecipient: Schema.Boolean,
        isRegex: Schema.Boolean,
        isTrustedSender: Schema.Boolean,
        lastModified: Schema.String,
        pattern: Schema.String,
        patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
        verifySender: Schema.Boolean,
        comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        isRecipient: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        isSender: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        isSpoof: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        isAcceptableSender: "is_acceptable_sender",
        isExemptRecipient: "is_exempt_recipient",
        isRegex: "is_regex",
        isTrustedSender: "is_trusted_sender",
        lastModified: "last_modified",
        pattern: "pattern",
        patternType: "pattern_type",
        verifySender: "verify_sender",
        comments: "comments",
        isRecipient: "is_recipient",
        isSender: "is_sender",
        isSpoof: "is_spoof",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listSettingAllowPolicies = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSettingAllowPoliciesRequest,
    output: ListSettingAllowPoliciesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateSettingAllowPolicyRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    isAcceptableSender: Schema.Boolean,
    isExemptRecipient: Schema.Boolean,
    isRegex: Schema.Boolean,
    isTrustedSender: Schema.Boolean,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    verifySender: Schema.Boolean,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isRecipient: Schema.optional(Schema.Boolean),
    isSender: Schema.optional(Schema.Boolean),
    isSpoof: Schema.optional(Schema.Boolean),
}).pipe(Schema.encodeKeys({
    isAcceptableSender: "is_acceptable_sender",
    isExemptRecipient: "is_exempt_recipient",
    isRegex: "is_regex",
    isTrustedSender: "is_trusted_sender",
    pattern: "pattern",
    patternType: "pattern_type",
    verifySender: "verify_sender",
    comments: "comments",
    isRecipient: "is_recipient",
    isSender: "is_sender",
    isSpoof: "is_spoof",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/settings/allow_policies",
}));
export const CreateSettingAllowPolicyResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isAcceptableSender: Schema.Boolean,
    isExemptRecipient: Schema.Boolean,
    isRegex: Schema.Boolean,
    isTrustedSender: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    verifySender: Schema.Boolean,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isRecipient: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isSender: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isSpoof: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isAcceptableSender: "is_acceptable_sender",
    isExemptRecipient: "is_exempt_recipient",
    isRegex: "is_regex",
    isTrustedSender: "is_trusted_sender",
    lastModified: "last_modified",
    pattern: "pattern",
    patternType: "pattern_type",
    verifySender: "verify_sender",
    comments: "comments",
    isRecipient: "is_recipient",
    isSender: "is_sender",
    isSpoof: "is_spoof",
}))
    .pipe(T.ResponsePath("result"));
export const createSettingAllowPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSettingAllowPolicyRequest,
    output: CreateSettingAllowPolicyResponse,
    errors: [],
}));
export const PatchSettingAllowPolicyRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    policyId: Schema.Number.pipe(T.HttpPath("policyId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isAcceptableSender: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isExemptRecipient: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isRegex: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isTrustedSender: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    pattern: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    patternType: Schema.optional(Schema.Union([
        Schema.Literal("EMAIL"),
        Schema.Literal("DOMAIN"),
        Schema.Literal("IP"),
        Schema.Literal("UNKNOWN"),
        Schema.Null,
    ])),
    verifySender: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
}).pipe(Schema.encodeKeys({
    comments: "comments",
    isAcceptableSender: "is_acceptable_sender",
    isExemptRecipient: "is_exempt_recipient",
    isRegex: "is_regex",
    isTrustedSender: "is_trusted_sender",
    pattern: "pattern",
    patternType: "pattern_type",
    verifySender: "verify_sender",
}), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/email-security/settings/allow_policies/{policyId}",
}));
export const PatchSettingAllowPolicyResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isAcceptableSender: Schema.Boolean,
    isExemptRecipient: Schema.Boolean,
    isRegex: Schema.Boolean,
    isTrustedSender: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    verifySender: Schema.Boolean,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isRecipient: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isSender: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    isSpoof: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isAcceptableSender: "is_acceptable_sender",
    isExemptRecipient: "is_exempt_recipient",
    isRegex: "is_regex",
    isTrustedSender: "is_trusted_sender",
    lastModified: "last_modified",
    pattern: "pattern",
    patternType: "pattern_type",
    verifySender: "verify_sender",
    comments: "comments",
    isRecipient: "is_recipient",
    isSender: "is_sender",
    isSpoof: "is_spoof",
}))
    .pipe(T.ResponsePath("result"));
export const patchSettingAllowPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSettingAllowPolicyRequest,
    output: PatchSettingAllowPolicyResponse,
    errors: [],
}));
export const DeleteSettingAllowPolicyRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    policyId: Schema.Number.pipe(T.HttpPath("policyId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/email-security/settings/allow_policies/{policyId}",
}));
export const DeleteSettingAllowPolicyResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
}).pipe(T.ResponsePath("result"));
export const deleteSettingAllowPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSettingAllowPolicyRequest,
    output: DeleteSettingAllowPolicyResponse,
    errors: [],
}));
export const GetSettingBlockSenderRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    patternId: Schema.Number.pipe(T.HttpPath("patternId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/block_senders/{patternId}",
}));
export const GetSettingBlockSenderResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isRegex: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isRegex: "is_regex",
    lastModified: "last_modified",
    pattern: "pattern",
    patternType: "pattern_type",
    comments: "comments",
}))
    .pipe(T.ResponsePath("result"));
export const getSettingBlockSender = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingBlockSenderRequest,
    output: GetSettingBlockSenderResponse,
    errors: [],
}));
export const ListSettingBlockSendersRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    order: Schema.optional(Schema.Literals(["pattern", "created_at"])).pipe(T.HttpQuery("order")),
    pattern: Schema.optional(Schema.String).pipe(T.HttpQuery("pattern")),
    patternType: Schema.optional(Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"])).pipe(T.HttpQuery("pattern_type")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/block_senders",
}));
export const ListSettingBlockSendersResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.Number,
        createdAt: Schema.String,
        isRegex: Schema.Boolean,
        lastModified: Schema.String,
        pattern: Schema.String,
        patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
        comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        isRegex: "is_regex",
        lastModified: "last_modified",
        pattern: "pattern",
        patternType: "pattern_type",
        comments: "comments",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listSettingBlockSenders = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSettingBlockSendersRequest,
    output: ListSettingBlockSendersResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateSettingBlockSenderRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    isRegex: Schema.Boolean,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    isRegex: "is_regex",
    pattern: "pattern",
    patternType: "pattern_type",
    comments: "comments",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/settings/block_senders",
}));
export const CreateSettingBlockSenderResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isRegex: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isRegex: "is_regex",
    lastModified: "last_modified",
    pattern: "pattern",
    patternType: "pattern_type",
    comments: "comments",
}))
    .pipe(T.ResponsePath("result"));
export const createSettingBlockSender = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSettingBlockSenderRequest,
    output: CreateSettingBlockSenderResponse,
    errors: [],
}));
export const PatchSettingBlockSenderRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    patternId: Schema.Number.pipe(T.HttpPath("patternId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isRegex: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    pattern: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    patternType: Schema.optional(Schema.Union([
        Schema.Literal("EMAIL"),
        Schema.Literal("DOMAIN"),
        Schema.Literal("IP"),
        Schema.Literal("UNKNOWN"),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({
    comments: "comments",
    isRegex: "is_regex",
    pattern: "pattern",
    patternType: "pattern_type",
}), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/email-security/settings/block_senders/{patternId}",
}));
export const PatchSettingBlockSenderResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isRegex: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    patternType: Schema.Literals(["EMAIL", "DOMAIN", "IP", "UNKNOWN"]),
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isRegex: "is_regex",
    lastModified: "last_modified",
    pattern: "pattern",
    patternType: "pattern_type",
    comments: "comments",
}))
    .pipe(T.ResponsePath("result"));
export const patchSettingBlockSender = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSettingBlockSenderRequest,
    output: PatchSettingBlockSenderResponse,
    errors: [],
}));
export const DeleteSettingBlockSenderRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    patternId: Schema.Number.pipe(T.HttpPath("patternId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/email-security/settings/block_senders/{patternId}",
}));
export const DeleteSettingBlockSenderResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
}).pipe(T.ResponsePath("result"));
export const deleteSettingBlockSender = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSettingBlockSenderRequest,
    output: DeleteSettingBlockSenderResponse,
    errors: [],
}));
export const GetSettingDomainRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domainId: Schema.Number.pipe(T.HttpPath("domainId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/domains/{domainId}",
}));
export const GetSettingDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    allowedDeliveryModes: Schema.Array(Schema.Literals(["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"])),
    createdAt: Schema.String,
    domain: Schema.String,
    dropDispositions: Schema.Array(Schema.Literals([
        "MALICIOUS",
        "MALICIOUS-BEC",
        "SUSPICIOUS",
        "SPOOF",
        "SPAM",
        "BULK",
        "ENCRYPTED",
        "EXTERNAL",
        "UNKNOWN",
        "NONE",
    ])),
    ipRestrictions: Schema.Array(Schema.String),
    lastModified: Schema.String,
    lookbackHops: Schema.Number,
    regions: Schema.Array(Schema.Literals(["GLOBAL", "AU", "DE", "IN", "US"])),
    transport: Schema.String,
    authorization: Schema.optional(Schema.Union([
        Schema.Struct({
            authorized: Schema.Boolean,
            timestamp: Schema.String,
            statusMessage: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            authorized: "authorized",
            timestamp: "timestamp",
            statusMessage: "status_message",
        })),
        Schema.Null,
    ])),
    dmarcStatus: Schema.optional(Schema.Union([
        Schema.Literal("none"),
        Schema.Literal("good"),
        Schema.Literal("invalid"),
        Schema.Null,
    ])),
    emailsProcessed: Schema.optional(Schema.Union([
        Schema.Struct({
            timestamp: Schema.String,
            totalEmailsProcessed: Schema.Number,
            totalEmailsProcessedPrevious: Schema.Number,
        }).pipe(Schema.encodeKeys({
            timestamp: "timestamp",
            totalEmailsProcessed: "total_emails_processed",
            totalEmailsProcessedPrevious: "total_emails_processed_previous",
        })),
        Schema.Null,
    ])),
    folder: Schema.optional(Schema.Union([
        Schema.Literal("AllItems"),
        Schema.Literal("Inbox"),
        Schema.Null,
    ])),
    inboxProvider: Schema.optional(Schema.Union([
        Schema.Literal("Microsoft"),
        Schema.Literal("Google"),
        Schema.Null,
    ])),
    integrationId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    o365TenantId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    requireTlsInbound: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    requireTlsOutbound: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    spfStatus: Schema.optional(Schema.Union([
        Schema.Literal("none"),
        Schema.Literal("good"),
        Schema.Literal("neutral"),
        Schema.Literal("open"),
        Schema.Literal("invalid"),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    allowedDeliveryModes: "allowed_delivery_modes",
    createdAt: "created_at",
    domain: "domain",
    dropDispositions: "drop_dispositions",
    ipRestrictions: "ip_restrictions",
    lastModified: "last_modified",
    lookbackHops: "lookback_hops",
    regions: "regions",
    transport: "transport",
    authorization: "authorization",
    dmarcStatus: "dmarc_status",
    emailsProcessed: "emails_processed",
    folder: "folder",
    inboxProvider: "inbox_provider",
    integrationId: "integration_id",
    o365TenantId: "o365_tenant_id",
    requireTlsInbound: "require_tls_inbound",
    requireTlsOutbound: "require_tls_outbound",
    spfStatus: "spf_status",
}))
    .pipe(T.ResponsePath("result"));
export const getSettingDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingDomainRequest,
    output: GetSettingDomainResponse,
    errors: [],
}));
export const ListSettingDomainsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    activeDeliveryMode: Schema.optional(Schema.Literals(["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"])).pipe(T.HttpQuery("active_delivery_mode")),
    allowedDeliveryMode: Schema.optional(Schema.Literals(["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"])).pipe(T.HttpQuery("allowed_delivery_mode")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    domain: Schema.optional(Schema.Array(Schema.String)).pipe(T.HttpQuery("domain")),
    integrationId: Schema.optional(Schema.String).pipe(T.HttpQuery("integration_id")),
    order: Schema.optional(Schema.Literals(["domain", "created_at"])).pipe(T.HttpQuery("order")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/domains",
}));
export const ListSettingDomainsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.Number,
        allowedDeliveryModes: Schema.Array(Schema.Literals(["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"])),
        createdAt: Schema.String,
        domain: Schema.String,
        dropDispositions: Schema.Array(Schema.Literals([
            "MALICIOUS",
            "MALICIOUS-BEC",
            "SUSPICIOUS",
            "SPOOF",
            "SPAM",
            "BULK",
            "ENCRYPTED",
            "EXTERNAL",
            "UNKNOWN",
            "NONE",
        ])),
        ipRestrictions: Schema.Array(Schema.String),
        lastModified: Schema.String,
        lookbackHops: Schema.Number,
        regions: Schema.Array(Schema.Literals(["GLOBAL", "AU", "DE", "IN", "US"])),
        transport: Schema.String,
        authorization: Schema.optional(Schema.Union([
            Schema.Struct({
                authorized: Schema.Boolean,
                timestamp: Schema.String,
                statusMessage: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                authorized: "authorized",
                timestamp: "timestamp",
                statusMessage: "status_message",
            })),
            Schema.Null,
        ])),
        dmarcStatus: Schema.optional(Schema.Union([
            Schema.Literal("none"),
            Schema.Literal("good"),
            Schema.Literal("invalid"),
            Schema.Null,
        ])),
        emailsProcessed: Schema.optional(Schema.Union([
            Schema.Struct({
                timestamp: Schema.String,
                totalEmailsProcessed: Schema.Number,
                totalEmailsProcessedPrevious: Schema.Number,
            }).pipe(Schema.encodeKeys({
                timestamp: "timestamp",
                totalEmailsProcessed: "total_emails_processed",
                totalEmailsProcessedPrevious: "total_emails_processed_previous",
            })),
            Schema.Null,
        ])),
        folder: Schema.optional(Schema.Union([
            Schema.Literal("AllItems"),
            Schema.Literal("Inbox"),
            Schema.Null,
        ])),
        inboxProvider: Schema.optional(Schema.Union([
            Schema.Literal("Microsoft"),
            Schema.Literal("Google"),
            Schema.Null,
        ])),
        integrationId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        o365TenantId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        requireTlsInbound: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        requireTlsOutbound: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        spfStatus: Schema.optional(Schema.Union([
            Schema.Literal("none"),
            Schema.Literal("good"),
            Schema.Literal("neutral"),
            Schema.Literal("open"),
            Schema.Literal("invalid"),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        allowedDeliveryModes: "allowed_delivery_modes",
        createdAt: "created_at",
        domain: "domain",
        dropDispositions: "drop_dispositions",
        ipRestrictions: "ip_restrictions",
        lastModified: "last_modified",
        lookbackHops: "lookback_hops",
        regions: "regions",
        transport: "transport",
        authorization: "authorization",
        dmarcStatus: "dmarc_status",
        emailsProcessed: "emails_processed",
        folder: "folder",
        inboxProvider: "inbox_provider",
        integrationId: "integration_id",
        o365TenantId: "o365_tenant_id",
        requireTlsInbound: "require_tls_inbound",
        requireTlsOutbound: "require_tls_outbound",
        spfStatus: "spf_status",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listSettingDomains = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSettingDomainsRequest,
    output: ListSettingDomainsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PatchSettingDomainRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domainId: Schema.Number.pipe(T.HttpPath("domainId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ipRestrictions: Schema.Array(Schema.String),
    allowedDeliveryModes: Schema.optional(Schema.Array(Schema.Literals(["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]))),
    domain: Schema.optional(Schema.String),
    dropDispositions: Schema.optional(Schema.Array(Schema.Literals([
        "MALICIOUS",
        "MALICIOUS-BEC",
        "SUSPICIOUS",
        "SPOOF",
        "SPAM",
        "BULK",
        "ENCRYPTED",
        "EXTERNAL",
        "UNKNOWN",
        "NONE",
    ]))),
    folder: Schema.optional(Schema.Literals(["AllItems", "Inbox"])),
    integrationId: Schema.optional(Schema.String),
    lookbackHops: Schema.optional(Schema.Number),
    regions: Schema.optional(Schema.Array(Schema.Literals(["GLOBAL", "AU", "DE", "IN", "US"]))),
    requireTlsInbound: Schema.optional(Schema.Boolean),
    requireTlsOutbound: Schema.optional(Schema.Boolean),
    transport: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    ipRestrictions: "ip_restrictions",
    allowedDeliveryModes: "allowed_delivery_modes",
    domain: "domain",
    dropDispositions: "drop_dispositions",
    folder: "folder",
    integrationId: "integration_id",
    lookbackHops: "lookback_hops",
    regions: "regions",
    requireTlsInbound: "require_tls_inbound",
    requireTlsOutbound: "require_tls_outbound",
    transport: "transport",
}), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/email-security/settings/domains/{domainId}",
}));
export const PatchSettingDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    allowedDeliveryModes: Schema.Array(Schema.Literals(["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"])),
    createdAt: Schema.String,
    domain: Schema.String,
    dropDispositions: Schema.Array(Schema.Literals([
        "MALICIOUS",
        "MALICIOUS-BEC",
        "SUSPICIOUS",
        "SPOOF",
        "SPAM",
        "BULK",
        "ENCRYPTED",
        "EXTERNAL",
        "UNKNOWN",
        "NONE",
    ])),
    ipRestrictions: Schema.Array(Schema.String),
    lastModified: Schema.String,
    lookbackHops: Schema.Number,
    regions: Schema.Array(Schema.Literals(["GLOBAL", "AU", "DE", "IN", "US"])),
    transport: Schema.String,
    authorization: Schema.optional(Schema.Union([
        Schema.Struct({
            authorized: Schema.Boolean,
            timestamp: Schema.String,
            statusMessage: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            authorized: "authorized",
            timestamp: "timestamp",
            statusMessage: "status_message",
        })),
        Schema.Null,
    ])),
    dmarcStatus: Schema.optional(Schema.Union([
        Schema.Literal("none"),
        Schema.Literal("good"),
        Schema.Literal("invalid"),
        Schema.Null,
    ])),
    emailsProcessed: Schema.optional(Schema.Union([
        Schema.Struct({
            timestamp: Schema.String,
            totalEmailsProcessed: Schema.Number,
            totalEmailsProcessedPrevious: Schema.Number,
        }).pipe(Schema.encodeKeys({
            timestamp: "timestamp",
            totalEmailsProcessed: "total_emails_processed",
            totalEmailsProcessedPrevious: "total_emails_processed_previous",
        })),
        Schema.Null,
    ])),
    folder: Schema.optional(Schema.Union([
        Schema.Literal("AllItems"),
        Schema.Literal("Inbox"),
        Schema.Null,
    ])),
    inboxProvider: Schema.optional(Schema.Union([
        Schema.Literal("Microsoft"),
        Schema.Literal("Google"),
        Schema.Null,
    ])),
    integrationId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    o365TenantId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    requireTlsInbound: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    requireTlsOutbound: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    spfStatus: Schema.optional(Schema.Union([
        Schema.Literal("none"),
        Schema.Literal("good"),
        Schema.Literal("neutral"),
        Schema.Literal("open"),
        Schema.Literal("invalid"),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    allowedDeliveryModes: "allowed_delivery_modes",
    createdAt: "created_at",
    domain: "domain",
    dropDispositions: "drop_dispositions",
    ipRestrictions: "ip_restrictions",
    lastModified: "last_modified",
    lookbackHops: "lookback_hops",
    regions: "regions",
    transport: "transport",
    authorization: "authorization",
    dmarcStatus: "dmarc_status",
    emailsProcessed: "emails_processed",
    folder: "folder",
    inboxProvider: "inbox_provider",
    integrationId: "integration_id",
    o365TenantId: "o365_tenant_id",
    requireTlsInbound: "require_tls_inbound",
    requireTlsOutbound: "require_tls_outbound",
    spfStatus: "spf_status",
}))
    .pipe(T.ResponsePath("result"));
export const patchSettingDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSettingDomainRequest,
    output: PatchSettingDomainResponse,
    errors: [],
}));
export const DeleteSettingDomainRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    domainId: Schema.Number.pipe(T.HttpPath("domainId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/email-security/settings/domains/{domainId}",
}));
export const DeleteSettingDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
}).pipe(T.ResponsePath("result"));
export const deleteSettingDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSettingDomainRequest,
    output: DeleteSettingDomainResponse,
    errors: [],
}));
export const BulkDeleteSettingDomainsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/email-security/settings/domains",
}));
export const BulkDeleteSettingDomainsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.Number,
    })),
});
export const bulkDeleteSettingDomains = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkDeleteSettingDomainsRequest,
    output: BulkDeleteSettingDomainsResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const GetSettingImpersonationRegistryRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    displayNameId: Schema.Number.pipe(T.HttpPath("displayNameId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/impersonation_registry/{displayNameId}",
}));
export const GetSettingImpersonationRegistryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    email: Schema.String,
    isEmailRegex: Schema.Boolean,
    lastModified: Schema.String,
    name: Schema.String,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    directoryId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    directoryNodeId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    externalDirectoryNodeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    provenance: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    email: "email",
    isEmailRegex: "is_email_regex",
    lastModified: "last_modified",
    name: "name",
    comments: "comments",
    directoryId: "directory_id",
    directoryNodeId: "directory_node_id",
    externalDirectoryNodeId: "external_directory_node_id",
    provenance: "provenance",
}))
    .pipe(T.ResponsePath("result"));
export const getSettingImpersonationRegistry = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingImpersonationRegistryRequest,
    output: GetSettingImpersonationRegistryResponse,
    errors: [],
}));
export const ListSettingImpersonationRegistriesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    order: Schema.optional(Schema.Literals(["name", "email", "created_at"])).pipe(T.HttpQuery("order")),
    provenance: Schema.optional(Schema.Literals([
        "A1S_INTERNAL",
        "SNOOPY-CASB_OFFICE_365",
        "SNOOPY-OFFICE_365",
        "SNOOPY-GOOGLE_DIRECTORY",
    ])).pipe(T.HttpQuery("provenance")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/impersonation_registry",
}));
export const ListSettingImpersonationRegistriesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.Number,
        createdAt: Schema.String,
        email: Schema.String,
        isEmailRegex: Schema.Boolean,
        lastModified: Schema.String,
        name: Schema.String,
        comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        directoryId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        directoryNodeId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        externalDirectoryNodeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        provenance: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        email: "email",
        isEmailRegex: "is_email_regex",
        lastModified: "last_modified",
        name: "name",
        comments: "comments",
        directoryId: "directory_id",
        directoryNodeId: "directory_node_id",
        externalDirectoryNodeId: "external_directory_node_id",
        provenance: "provenance",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listSettingImpersonationRegistries = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSettingImpersonationRegistriesRequest,
    output: ListSettingImpersonationRegistriesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateSettingImpersonationRegistryRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    email: Schema.String,
    isEmailRegex: Schema.Boolean,
    name: Schema.String,
}).pipe(Schema.encodeKeys({
    email: "email",
    isEmailRegex: "is_email_regex",
    name: "name",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/settings/impersonation_registry",
}));
export const CreateSettingImpersonationRegistryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    email: Schema.String,
    isEmailRegex: Schema.Boolean,
    lastModified: Schema.String,
    name: Schema.String,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    directoryId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    directoryNodeId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    externalDirectoryNodeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    provenance: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    email: "email",
    isEmailRegex: "is_email_regex",
    lastModified: "last_modified",
    name: "name",
    comments: "comments",
    directoryId: "directory_id",
    directoryNodeId: "directory_node_id",
    externalDirectoryNodeId: "external_directory_node_id",
    provenance: "provenance",
}))
    .pipe(T.ResponsePath("result"));
export const createSettingImpersonationRegistry = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSettingImpersonationRegistryRequest,
    output: CreateSettingImpersonationRegistryResponse,
    errors: [],
}));
export const PatchSettingImpersonationRegistryRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    displayNameId: Schema.Number.pipe(T.HttpPath("displayNameId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    email: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    isEmailRegex: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    email: "email",
    isEmailRegex: "is_email_regex",
    name: "name",
}), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/email-security/settings/impersonation_registry/{displayNameId}",
}));
export const PatchSettingImpersonationRegistryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    email: Schema.String,
    isEmailRegex: Schema.Boolean,
    lastModified: Schema.String,
    name: Schema.String,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    directoryId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    directoryNodeId: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    externalDirectoryNodeId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    provenance: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    email: "email",
    isEmailRegex: "is_email_regex",
    lastModified: "last_modified",
    name: "name",
    comments: "comments",
    directoryId: "directory_id",
    directoryNodeId: "directory_node_id",
    externalDirectoryNodeId: "external_directory_node_id",
    provenance: "provenance",
}))
    .pipe(T.ResponsePath("result"));
export const patchSettingImpersonationRegistry = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSettingImpersonationRegistryRequest,
    output: PatchSettingImpersonationRegistryResponse,
    errors: [],
}));
export const DeleteSettingImpersonationRegistryRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    displayNameId: Schema.Number.pipe(T.HttpPath("displayNameId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/email-security/settings/impersonation_registry/{displayNameId}",
}));
export const DeleteSettingImpersonationRegistryResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
}).pipe(T.ResponsePath("result"));
export const deleteSettingImpersonationRegistry = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSettingImpersonationRegistryRequest,
    output: DeleteSettingImpersonationRegistryResponse,
    errors: [],
}));
export const GetSettingTrustedDomainRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    trustedDomainId: Schema.Number.pipe(T.HttpPath("trustedDomainId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/trusted_domains/{trustedDomainId}",
}));
export const GetSettingTrustedDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isRecent: Schema.Boolean,
    isRegex: Schema.Boolean,
    isSimilarity: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isRecent: "is_recent",
    isRegex: "is_regex",
    isSimilarity: "is_similarity",
    lastModified: "last_modified",
    pattern: "pattern",
    comments: "comments",
}))
    .pipe(T.ResponsePath("result"));
export const getSettingTrustedDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingTrustedDomainRequest,
    output: GetSettingTrustedDomainResponse,
    errors: [],
}));
export const ListSettingTrustedDomainsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    isRecent: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_recent")),
    isSimilarity: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("is_similarity")),
    order: Schema.optional(Schema.Literals(["pattern", "created_at"])).pipe(T.HttpQuery("order")),
    pattern: Schema.optional(Schema.String).pipe(T.HttpQuery("pattern")),
    search: Schema.optional(Schema.String).pipe(T.HttpQuery("search")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/settings/trusted_domains",
}));
export const ListSettingTrustedDomainsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.Number,
        createdAt: Schema.String,
        isRecent: Schema.Boolean,
        isRegex: Schema.Boolean,
        isSimilarity: Schema.Boolean,
        lastModified: Schema.String,
        pattern: Schema.String,
        comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        isRecent: "is_recent",
        isRegex: "is_regex",
        isSimilarity: "is_similarity",
        lastModified: "last_modified",
        pattern: "pattern",
        comments: "comments",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listSettingTrustedDomains = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSettingTrustedDomainsRequest,
    output: ListSettingTrustedDomainsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateSettingTrustedDomainRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    isRecent: Schema.Boolean,
    isRegex: Schema.Boolean,
    isSimilarity: Schema.Boolean,
    pattern: Schema.String,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(Schema.encodeKeys({
    isRecent: "is_recent",
    isRegex: "is_regex",
    isSimilarity: "is_similarity",
    pattern: "pattern",
    comments: "comments",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/email-security/settings/trusted_domains",
}));
export const CreateSettingTrustedDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        id: Schema.Number,
        createdAt: Schema.String,
        isRecent: Schema.Boolean,
        isRegex: Schema.Boolean,
        isSimilarity: Schema.Boolean,
        lastModified: Schema.String,
        pattern: Schema.String,
        comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        isRecent: "is_recent",
        isRegex: "is_regex",
        isSimilarity: "is_similarity",
        lastModified: "last_modified",
        pattern: "pattern",
        comments: "comments",
    })),
    Schema.Array(Schema.Struct({
        id: Schema.Number,
        createdAt: Schema.String,
        isRecent: Schema.Boolean,
        isRegex: Schema.Boolean,
        isSimilarity: Schema.Boolean,
        lastModified: Schema.String,
        pattern: Schema.String,
        comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        createdAt: "created_at",
        isRecent: "is_recent",
        isRegex: "is_regex",
        isSimilarity: "is_similarity",
        lastModified: "last_modified",
        pattern: "pattern",
        comments: "comments",
    }))),
]).pipe(T.ResponsePath("result"));
export const createSettingTrustedDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSettingTrustedDomainRequest,
    output: CreateSettingTrustedDomainResponse,
    errors: [],
}));
export const PatchSettingTrustedDomainRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    trustedDomainId: Schema.Number.pipe(T.HttpPath("trustedDomainId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    comments: Schema.optional(Schema.String),
    isRecent: Schema.optional(Schema.Boolean),
    isRegex: Schema.optional(Schema.Boolean),
    isSimilarity: Schema.optional(Schema.Boolean),
    pattern: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    comments: "comments",
    isRecent: "is_recent",
    isRegex: "is_regex",
    isSimilarity: "is_similarity",
    pattern: "pattern",
}), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/email-security/settings/trusted_domains/{trustedDomainId}",
}));
export const PatchSettingTrustedDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
    createdAt: Schema.String,
    isRecent: Schema.Boolean,
    isRegex: Schema.Boolean,
    isSimilarity: Schema.Boolean,
    lastModified: Schema.String,
    pattern: Schema.String,
    comments: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    createdAt: "created_at",
    isRecent: "is_recent",
    isRegex: "is_regex",
    isSimilarity: "is_similarity",
    lastModified: "last_modified",
    pattern: "pattern",
    comments: "comments",
}))
    .pipe(T.ResponsePath("result"));
export const patchSettingTrustedDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSettingTrustedDomainRequest,
    output: PatchSettingTrustedDomainResponse,
    errors: [],
}));
export const DeleteSettingTrustedDomainRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    trustedDomainId: Schema.Number.pipe(T.HttpPath("trustedDomainId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/email-security/settings/trusted_domains/{trustedDomainId}",
}));
export const DeleteSettingTrustedDomainResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.Number,
}).pipe(T.ResponsePath("result"));
export const deleteSettingTrustedDomain = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSettingTrustedDomainRequest,
    output: DeleteSettingTrustedDomainResponse,
    errors: [],
}));
export const ListSubmissionsRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    end: Schema.optional(Schema.String).pipe(T.HttpQuery("end")),
    originalDisposition: Schema.optional(Schema.Literals([
        "MALICIOUS",
        "SUSPICIOUS",
        "SPOOF",
        "SPAM",
        "BULK",
        "NONE",
    ])).pipe(T.HttpQuery("original_disposition")),
    outcomeDisposition: Schema.optional(Schema.Literals([
        "MALICIOUS",
        "SUSPICIOUS",
        "SPOOF",
        "SPAM",
        "BULK",
        "NONE",
    ])).pipe(T.HttpQuery("outcome_disposition")),
    query: Schema.optional(Schema.Union([Schema.String, Schema.Null])).pipe(T.HttpQuery("query")),
    requestedDisposition: Schema.optional(Schema.Literals([
        "MALICIOUS",
        "SUSPICIOUS",
        "SPOOF",
        "SPAM",
        "BULK",
        "NONE",
    ])).pipe(T.HttpQuery("requested_disposition")),
    start: Schema.optional(Schema.String).pipe(T.HttpQuery("start")),
    status: Schema.optional(Schema.String).pipe(T.HttpQuery("status")),
    submissionId: Schema.optional(Schema.String).pipe(T.HttpQuery("submission_id")),
    type: Schema.optional(Schema.Literals(["TEAM", "USER"])).pipe(T.HttpQuery("type")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/email-security/submissions",
}));
export const ListSubmissionsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        requestedTs: Schema.String,
        submissionId: Schema.String,
        originalDisposition: Schema.optional(Schema.Union([
            Schema.Literal("MALICIOUS"),
            Schema.Literal("MALICIOUS-BEC"),
            Schema.Literal("SUSPICIOUS"),
            Schema.Literal("SPOOF"),
            Schema.Literal("SPAM"),
            Schema.Literal("BULK"),
            Schema.Literal("ENCRYPTED"),
            Schema.Literal("EXTERNAL"),
            Schema.Literal("UNKNOWN"),
            Schema.Literal("NONE"),
            Schema.Null,
        ])),
        originalEdfHash: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        outcome: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        outcomeDisposition: Schema.optional(Schema.Union([
            Schema.Literal("MALICIOUS"),
            Schema.Literal("MALICIOUS-BEC"),
            Schema.Literal("SUSPICIOUS"),
            Schema.Literal("SPOOF"),
            Schema.Literal("SPAM"),
            Schema.Literal("BULK"),
            Schema.Literal("ENCRYPTED"),
            Schema.Literal("EXTERNAL"),
            Schema.Literal("UNKNOWN"),
            Schema.Literal("NONE"),
            Schema.Null,
        ])),
        requestedBy: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        requestedDisposition: Schema.optional(Schema.Union([
            Schema.Literal("MALICIOUS"),
            Schema.Literal("MALICIOUS-BEC"),
            Schema.Literal("SUSPICIOUS"),
            Schema.Literal("SPOOF"),
            Schema.Literal("SPAM"),
            Schema.Literal("BULK"),
            Schema.Literal("ENCRYPTED"),
            Schema.Literal("EXTERNAL"),
            Schema.Literal("UNKNOWN"),
            Schema.Literal("NONE"),
            Schema.Null,
        ])),
        status: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        subject: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        type: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        requestedTs: "requested_ts",
        submissionId: "submission_id",
        originalDisposition: "original_disposition",
        originalEdfHash: "original_edf_hash",
        outcome: "outcome",
        outcomeDisposition: "outcome_disposition",
        requestedBy: "requested_by",
        requestedDisposition: "requested_disposition",
        status: "status",
        subject: "subject",
        type: "type",
    }))),
    resultInfo: Schema.optional(Schema.Union([
        Schema.Struct({
            count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            totalCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        }).pipe(Schema.encodeKeys({
            count: "count",
            page: "page",
            perPage: "per_page",
            totalCount: "total_count",
        })),
        Schema.Null,
    ])),
}).pipe(Schema.encodeKeys({ result: "result", resultInfo: "result_info" }));
export const listSubmissions = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSubmissionsRequest,
    output: ListSubmissionsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
//# sourceMappingURL=email-security.js.map