/**
 * Cloudflare SECURITY-CENTER API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service security-center
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
// =============================================================================
// Insight
// =============================================================================
const ListInsightsBaseFields = {};
export const ListInsightsForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...ListInsightsBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/security-center/insights",
}));
export const ListInsightsForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...ListInsightsBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/security-center/insights",
}));
export const ListInsightsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Struct({
        items: Schema.optional(Schema.Union([
            Schema.Array(Schema.Struct({
                count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                issues: Schema.optional(Schema.Union([
                    Schema.Array(Schema.Struct({
                        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        dismissed: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                        issueClass: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        issueType: Schema.optional(Schema.Union([
                            Schema.Literals([
                                "compliance_violation",
                                "email_security",
                                "exposed_infrastructure",
                                "insecure_configuration",
                                "weak_authentication",
                                "configuration_suggestion",
                            ]),
                            Schema.Null,
                        ])),
                        payload: Schema.optional(Schema.Union([
                            Schema.Struct({
                                detectionMethod: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                                zoneTag: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                detectionMethod: "detection_method",
                                zoneTag: "zone_tag",
                            })),
                            Schema.Null,
                        ])),
                        resolveLink: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        resolveText: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        severity: Schema.optional(Schema.Union([
                            Schema.Literals(["Low", "Moderate", "Critical"]),
                            Schema.Null,
                        ])),
                        since: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        subject: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                        timestamp: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    }).pipe(Schema.encodeKeys({
                        id: "id",
                        dismissed: "dismissed",
                        issueClass: "issue_class",
                        issueType: "issue_type",
                        payload: "payload",
                        resolveLink: "resolve_link",
                        resolveText: "resolve_text",
                        severity: "severity",
                        since: "since",
                        subject: "subject",
                        timestamp: "timestamp",
                    }))),
                    Schema.Null,
                ])),
                page: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                perPage: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
            }).pipe(Schema.encodeKeys({
                count: "count",
                issues: "issues",
                page: "page",
                perPage: "per_page",
            }))),
            Schema.Null,
        ])),
    }),
    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 listInsightsForAccount = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListInsightsForAccountRequest,
    output: ListInsightsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result.items",
        pageSize: "perPage",
    },
}));
export const listInsightsForZone = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListInsightsForZoneRequest,
    output: ListInsightsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result.items",
        pageSize: "perPage",
    },
}));
const DismissInsightBaseFields = {
    issueId: Schema.String.pipe(T.HttpPath("issueId")),
    dismiss: Schema.optional(Schema.Boolean),
};
export const DismissInsightForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...DismissInsightBaseFields,
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/security-center/insights/{issueId}/dismiss",
}));
export const DismissInsightForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...DismissInsightBaseFields,
}).pipe(T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/security-center/insights/{issueId}/dismiss",
}));
export const DismissInsightResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    errors: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    messages: Schema.Array(Schema.Struct({
        code: Schema.Number,
        message: Schema.String,
        documentationUrl: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        source: Schema.optional(Schema.Union([
            Schema.Struct({
                pointer: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        code: "code",
        message: "message",
        documentationUrl: "documentation_url",
        source: "source",
    }))),
    success: Schema.Literal(true),
});
export const dismissInsightForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DismissInsightForAccountRequest,
    output: DismissInsightResponse,
    errors: [],
}));
export const dismissInsightForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DismissInsightForZoneRequest,
    output: DismissInsightResponse,
    errors: [],
}));
// =============================================================================
// InsightClass
// =============================================================================
const GetInsightClassBaseFields = {};
export const GetInsightClassForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...GetInsightClassBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/security-center/insights/class",
}));
export const GetInsightClassForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...GetInsightClassBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/security-center/insights/class",
}));
export const GetInsightClassResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})).pipe(T.ResponsePath("result"));
export const getInsightClassForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInsightClassForAccountRequest,
    output: GetInsightClassResponse,
    errors: [],
}));
export const getInsightClassForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInsightClassForZoneRequest,
    output: GetInsightClassResponse,
    errors: [],
}));
// =============================================================================
// InsightSeverity
// =============================================================================
const GetInsightSeverityBaseFields = {};
export const GetInsightSeverityForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...GetInsightSeverityBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/security-center/insights/severity",
}));
export const GetInsightSeverityForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...GetInsightSeverityBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/security-center/insights/severity",
}));
export const GetInsightSeverityResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})).pipe(T.ResponsePath("result"));
export const getInsightSeverityForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInsightSeverityForAccountRequest,
    output: GetInsightSeverityResponse,
    errors: [],
}));
export const getInsightSeverityForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInsightSeverityForZoneRequest,
    output: GetInsightSeverityResponse,
    errors: [],
}));
// =============================================================================
// InsightType
// =============================================================================
const GetInsightTypeBaseFields = {};
export const GetInsightTypeForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...GetInsightTypeBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/security-center/insights/type",
}));
export const GetInsightTypeForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...GetInsightTypeBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/security-center/insights/type",
}));
export const GetInsightTypeResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    count: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})).pipe(T.ResponsePath("result"));
export const getInsightTypeForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInsightTypeForAccountRequest,
    output: GetInsightTypeResponse,
    errors: [],
}));
export const getInsightTypeForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInsightTypeForZoneRequest,
    output: GetInsightTypeResponse,
    errors: [],
}));
//# sourceMappingURL=security-center.js.map