/**
 * Cloudflare VULNERABILITY-SCANNER API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service vulnerability-scanner
 */
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 GetCredentialSetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}",
}));
export const GetCredentialSetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
}).pipe(T.ResponsePath("result"));
export const getCredentialSet = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCredentialSetRequest,
    output: GetCredentialSetResponse,
    errors: [],
}));
export const ListCredentialSetsRequest = 
/*@__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")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets",
}));
export const ListCredentialSetsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        name: Schema.String,
    })),
    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 listCredentialSets = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListCredentialSetsRequest,
    output: ListCredentialSetsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateCredentialSetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    name: Schema.String,
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets",
}));
export const CreateCredentialSetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
}).pipe(T.ResponsePath("result"));
export const createCredentialSet = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateCredentialSetRequest,
    output: CreateCredentialSetResponse,
    errors: [],
}));
export const UpdateCredentialSetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    name: Schema.String,
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}",
}));
export const UpdateCredentialSetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
}).pipe(T.ResponsePath("result"));
export const updateCredentialSet = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateCredentialSetRequest,
    output: UpdateCredentialSetResponse,
    errors: [],
}));
export const PatchCredentialSetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    name: Schema.optional(Schema.String),
}).pipe(T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}",
}));
export const PatchCredentialSetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
}).pipe(T.ResponsePath("result"));
export const patchCredentialSet = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchCredentialSetRequest,
    output: PatchCredentialSetResponse,
    errors: [],
}));
export const DeleteCredentialSetRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}",
}));
export const DeleteCredentialSetResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const deleteCredentialSet = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteCredentialSetRequest,
    output: DeleteCredentialSetResponse,
    errors: [],
}));
export const GetCredentialSetCredentialRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    credentialId: Schema.String.pipe(T.HttpPath("credentialId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}/credentials/{credentialId}",
}));
export const GetCredentialSetCredentialResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    credentialSetId: Schema.String,
    location: Schema.Union([
        Schema.Literals(["header", "cookie"]),
        Schema.String,
    ]),
    locationName: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    credentialSetId: "credential_set_id",
    location: "location",
    locationName: "location_name",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const getCredentialSetCredential = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCredentialSetCredentialRequest,
    output: GetCredentialSetCredentialResponse,
    errors: [],
}));
export const ListCredentialSetCredentialsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    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")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}/credentials",
}));
export const ListCredentialSetCredentialsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        credentialSetId: Schema.String,
        location: Schema.Union([
            Schema.Literals(["header", "cookie"]),
            Schema.String,
        ]),
        locationName: Schema.String,
        name: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        credentialSetId: "credential_set_id",
        location: "location",
        locationName: "location_name",
        name: "name",
    }))),
    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 listCredentialSetCredentials = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListCredentialSetCredentialsRequest,
    output: ListCredentialSetCredentialsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateCredentialSetCredentialRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    location: Schema.Union([
        Schema.Literals(["header", "cookie"]),
        Schema.String,
    ]),
    locationName: Schema.String,
    name: Schema.String,
    value: Schema.String,
}).pipe(Schema.encodeKeys({
    location: "location",
    locationName: "location_name",
    name: "name",
    value: "value",
}), T.Http({
    method: "POST",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}/credentials",
}));
export const CreateCredentialSetCredentialResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    credentialSetId: Schema.String,
    location: Schema.Union([
        Schema.Literals(["header", "cookie"]),
        Schema.String,
    ]),
    locationName: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    credentialSetId: "credential_set_id",
    location: "location",
    locationName: "location_name",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const createCredentialSetCredential = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateCredentialSetCredentialRequest,
    output: CreateCredentialSetCredentialResponse,
    errors: [],
}));
export const UpdateCredentialSetCredentialRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    credentialId: Schema.String.pipe(T.HttpPath("credentialId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    location: Schema.Union([
        Schema.Literals(["header", "cookie"]),
        Schema.String,
    ]),
    locationName: Schema.String,
    name: Schema.String,
    value: Schema.String,
}).pipe(Schema.encodeKeys({
    location: "location",
    locationName: "location_name",
    name: "name",
    value: "value",
}), T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}/credentials/{credentialId}",
}));
export const UpdateCredentialSetCredentialResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    credentialSetId: Schema.String,
    location: Schema.Union([
        Schema.Literals(["header", "cookie"]),
        Schema.String,
    ]),
    locationName: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    credentialSetId: "credential_set_id",
    location: "location",
    locationName: "location_name",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const updateCredentialSetCredential = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateCredentialSetCredentialRequest,
    output: UpdateCredentialSetCredentialResponse,
    errors: [],
}));
export const PatchCredentialSetCredentialRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    credentialId: Schema.String.pipe(T.HttpPath("credentialId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    location: Schema.optional(Schema.Union([Schema.Literals(["header", "cookie"]), Schema.String])),
    locationName: Schema.optional(Schema.String),
    name: Schema.optional(Schema.String),
    value: Schema.optional(Schema.String),
}).pipe(Schema.encodeKeys({
    location: "location",
    locationName: "location_name",
    name: "name",
    value: "value",
}), T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}/credentials/{credentialId}",
}));
export const PatchCredentialSetCredentialResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    credentialSetId: Schema.String,
    location: Schema.Union([
        Schema.Literals(["header", "cookie"]),
        Schema.String,
    ]),
    locationName: Schema.String,
    name: Schema.String,
})
    .pipe(Schema.encodeKeys({
    id: "id",
    credentialSetId: "credential_set_id",
    location: "location",
    locationName: "location_name",
    name: "name",
}))
    .pipe(T.ResponsePath("result"));
export const patchCredentialSetCredential = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchCredentialSetCredentialRequest,
    output: PatchCredentialSetCredentialResponse,
    errors: [],
}));
export const DeleteCredentialSetCredentialRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    credentialSetId: Schema.String.pipe(T.HttpPath("credentialSetId")),
    credentialId: Schema.String.pipe(T.HttpPath("credentialId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/vuln_scanner/credential_sets/{credentialSetId}/credentials/{credentialId}",
}));
export const DeleteCredentialSetCredentialResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const deleteCredentialSetCredential = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteCredentialSetCredentialRequest,
    output: DeleteCredentialSetCredentialResponse,
    errors: [],
}));
export const GetScanRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    scanId: Schema.String.pipe(T.HttpPath("scanId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/vuln_scanner/scans/{scanId}",
}));
export const GetScanResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    scanType: Schema.Literal("bola"),
    status: Schema.Union([
        Schema.Literals([
            "created",
            "scheduled",
            "planning",
            "running",
            "finished",
            "failed",
        ]),
        Schema.String,
    ]),
    targetEnvironmentId: Schema.String,
    report: Schema.optional(Schema.Union([
        Schema.Struct({
            report: Schema.Struct({
                summary: Schema.Struct({
                    verdict: Schema.Union([
                        Schema.Literals(["ok", "warning", "inconclusive"]),
                        Schema.String,
                    ]),
                }),
                tests: Schema.Array(Schema.Struct({
                    steps: Schema.Array(Schema.Struct({
                        assertions: Schema.Array(Schema.Struct({
                            description: Schema.String,
                            kind: Schema.Struct({
                                parameters: Schema.Struct({
                                    max: Schema.Unknown,
                                    min: Schema.Unknown,
                                }),
                                type: Schema.Literal("http_status_within_range"),
                            }),
                            observed: Schema.Union([Schema.Number, Schema.Null]),
                            outcome: Schema.Union([
                                Schema.Literals(["ok", "fail", "inconclusive"]),
                                Schema.String,
                            ]),
                        })),
                        errors: Schema.optional(Schema.Union([
                            Schema.Array(Schema.Struct({
                                description: Schema.String,
                                errorCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                description: "description",
                                errorCode: "error_code",
                            }))),
                            Schema.Null,
                        ])),
                        request: Schema.optional(Schema.Union([
                            Schema.Struct({
                                credentialSet: Schema.Struct({
                                    id: Schema.String,
                                    role: Schema.Union([
                                        Schema.Literals(["owner", "attacker"]),
                                        Schema.String,
                                    ]),
                                }),
                                headerNames: Schema.Array(Schema.String),
                                method: Schema.Union([
                                    Schema.Literals([
                                        "GET",
                                        "DELETE",
                                        "PATCH",
                                        "POST",
                                        "PUT",
                                    ]),
                                    Schema.String,
                                ]),
                                url: Schema.String,
                                variableCaptures: Schema.Array(Schema.Struct({
                                    jsonPath: Schema.Unknown,
                                    name: Schema.Unknown,
                                }).pipe(Schema.encodeKeys({
                                    jsonPath: "json_path",
                                    name: "name",
                                }))),
                                body: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                credentialSet: "credential_set",
                                headerNames: "header_names",
                                method: "method",
                                url: "url",
                                variableCaptures: "variable_captures",
                                body: "body",
                            })),
                            Schema.Null,
                        ])),
                        response: Schema.optional(Schema.Union([
                            Schema.Struct({
                                body: Schema.Union([
                                    Schema.Struct({
                                        contents: Schema.Unknown,
                                        kind: Schema.Unknown,
                                        truncated: Schema.Unknown,
                                    }),
                                    Schema.Struct({
                                        kind: Schema.Unknown,
                                    }),
                                ]),
                                headerNames: Schema.Array(Schema.String),
                                status: Schema.Number,
                                statusText: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                body: "body",
                                headerNames: "header_names",
                                status: "status",
                                statusText: "status_text",
                            })),
                            Schema.Null,
                        ])),
                    })),
                    verdict: Schema.Union([
                        Schema.Literals(["ok", "warning", "inconclusive"]),
                        Schema.String,
                    ]),
                    preflightErrors: Schema.optional(Schema.Union([
                        Schema.Array(Schema.Struct({
                            description: Schema.String,
                            errorCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        }).pipe(Schema.encodeKeys({
                            description: "description",
                            errorCode: "error_code",
                        }))),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({
                    steps: "steps",
                    verdict: "verdict",
                    preflightErrors: "preflight_errors",
                }))),
            }),
            reportSchemaVersion: Schema.Literal("v1"),
        }).pipe(Schema.encodeKeys({
            report: "report",
            reportSchemaVersion: "report_schema_version",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    scanType: "scan_type",
    status: "status",
    targetEnvironmentId: "target_environment_id",
    report: "report",
}))
    .pipe(T.ResponsePath("result"));
export const getScan = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetScanRequest,
    output: GetScanResponse,
    errors: [],
}));
export const ListScansRequest = /*@__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")),
}).pipe(T.Http({ method: "GET", path: "/accounts/{account_id}/vuln_scanner/scans" }));
export const ListScansResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        scanType: Schema.Literal("bola"),
        status: Schema.Union([
            Schema.Literals([
                "created",
                "scheduled",
                "planning",
                "running",
                "finished",
                "failed",
            ]),
            Schema.String,
        ]),
        targetEnvironmentId: Schema.String,
        report: Schema.optional(Schema.Union([
            Schema.Struct({
                report: Schema.Struct({
                    summary: Schema.Struct({
                        verdict: Schema.Union([
                            Schema.Literals(["ok", "warning", "inconclusive"]),
                            Schema.String,
                        ]),
                    }),
                    tests: Schema.Array(Schema.Struct({
                        steps: Schema.Array(Schema.Struct({
                            assertions: Schema.Array(Schema.Struct({
                                description: Schema.Unknown,
                                kind: Schema.Unknown,
                                observed: Schema.Unknown,
                                outcome: Schema.Unknown,
                            })),
                            errors: Schema.optional(Schema.Union([
                                Schema.Array(Schema.Struct({
                                    description: Schema.Unknown,
                                    errorCode: Schema.optional(Schema.Unknown),
                                }).pipe(Schema.encodeKeys({
                                    description: "description",
                                    errorCode: "error_code",
                                }))),
                                Schema.Null,
                            ])),
                            request: Schema.optional(Schema.Union([
                                Schema.Struct({
                                    credentialSet: Schema.Unknown,
                                    headerNames: Schema.Unknown,
                                    method: Schema.Unknown,
                                    url: Schema.Unknown,
                                    variableCaptures: Schema.Unknown,
                                    body: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
                                }).pipe(Schema.encodeKeys({
                                    credentialSet: "credential_set",
                                    headerNames: "header_names",
                                    method: "method",
                                    url: "url",
                                    variableCaptures: "variable_captures",
                                    body: "body",
                                })),
                                Schema.Null,
                            ])),
                            response: Schema.optional(Schema.Union([
                                Schema.Struct({
                                    body: Schema.Unknown,
                                    headerNames: Schema.Unknown,
                                    status: Schema.Unknown,
                                    statusText: Schema.optional(Schema.Unknown),
                                }).pipe(Schema.encodeKeys({
                                    body: "body",
                                    headerNames: "header_names",
                                    status: "status",
                                    statusText: "status_text",
                                })),
                                Schema.Null,
                            ])),
                        })),
                        verdict: Schema.Union([
                            Schema.Literals(["ok", "warning", "inconclusive"]),
                            Schema.String,
                        ]),
                        preflightErrors: Schema.optional(Schema.Union([
                            Schema.Array(Schema.Struct({
                                description: Schema.String,
                                errorCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                description: "description",
                                errorCode: "error_code",
                            }))),
                            Schema.Null,
                        ])),
                    }).pipe(Schema.encodeKeys({
                        steps: "steps",
                        verdict: "verdict",
                        preflightErrors: "preflight_errors",
                    }))),
                }),
                reportSchemaVersion: Schema.Literal("v1"),
            }).pipe(Schema.encodeKeys({
                report: "report",
                reportSchemaVersion: "report_schema_version",
            })),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        scanType: "scan_type",
        status: "status",
        targetEnvironmentId: "target_environment_id",
        report: "report",
    }))),
    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 listScans = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListScansRequest,
    output: ListScansResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateScanRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    credentialSets: Schema.Struct({
        attacker: Schema.String,
        owner: Schema.String,
    }),
    openApi: Schema.String,
    scanType: Schema.Literal("bola"),
    targetEnvironmentId: Schema.String,
}).pipe(Schema.encodeKeys({
    credentialSets: "credential_sets",
    openApi: "open_api",
    scanType: "scan_type",
    targetEnvironmentId: "target_environment_id",
}), T.Http({ method: "POST", path: "/accounts/{account_id}/vuln_scanner/scans" }));
export const CreateScanResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    scanType: Schema.Literal("bola"),
    status: Schema.Union([
        Schema.Literals([
            "created",
            "scheduled",
            "planning",
            "running",
            "finished",
            "failed",
        ]),
        Schema.String,
    ]),
    targetEnvironmentId: Schema.String,
    report: Schema.optional(Schema.Union([
        Schema.Struct({
            report: Schema.Struct({
                summary: Schema.Struct({
                    verdict: Schema.Union([
                        Schema.Literals(["ok", "warning", "inconclusive"]),
                        Schema.String,
                    ]),
                }),
                tests: Schema.Array(Schema.Struct({
                    steps: Schema.Array(Schema.Struct({
                        assertions: Schema.Array(Schema.Struct({
                            description: Schema.String,
                            kind: Schema.Struct({
                                parameters: Schema.Struct({
                                    max: Schema.Unknown,
                                    min: Schema.Unknown,
                                }),
                                type: Schema.Literal("http_status_within_range"),
                            }),
                            observed: Schema.Union([Schema.Number, Schema.Null]),
                            outcome: Schema.Union([
                                Schema.Literals(["ok", "fail", "inconclusive"]),
                                Schema.String,
                            ]),
                        })),
                        errors: Schema.optional(Schema.Union([
                            Schema.Array(Schema.Struct({
                                description: Schema.String,
                                errorCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                description: "description",
                                errorCode: "error_code",
                            }))),
                            Schema.Null,
                        ])),
                        request: Schema.optional(Schema.Union([
                            Schema.Struct({
                                credentialSet: Schema.Struct({
                                    id: Schema.String,
                                    role: Schema.Union([
                                        Schema.Literals(["owner", "attacker"]),
                                        Schema.String,
                                    ]),
                                }),
                                headerNames: Schema.Array(Schema.String),
                                method: Schema.Union([
                                    Schema.Literals([
                                        "GET",
                                        "DELETE",
                                        "PATCH",
                                        "POST",
                                        "PUT",
                                    ]),
                                    Schema.String,
                                ]),
                                url: Schema.String,
                                variableCaptures: Schema.Array(Schema.Struct({
                                    jsonPath: Schema.Unknown,
                                    name: Schema.Unknown,
                                }).pipe(Schema.encodeKeys({
                                    jsonPath: "json_path",
                                    name: "name",
                                }))),
                                body: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                credentialSet: "credential_set",
                                headerNames: "header_names",
                                method: "method",
                                url: "url",
                                variableCaptures: "variable_captures",
                                body: "body",
                            })),
                            Schema.Null,
                        ])),
                        response: Schema.optional(Schema.Union([
                            Schema.Struct({
                                body: Schema.Union([
                                    Schema.Struct({
                                        contents: Schema.Unknown,
                                        kind: Schema.Unknown,
                                        truncated: Schema.Unknown,
                                    }),
                                    Schema.Struct({
                                        kind: Schema.Unknown,
                                    }),
                                ]),
                                headerNames: Schema.Array(Schema.String),
                                status: Schema.Number,
                                statusText: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                            }).pipe(Schema.encodeKeys({
                                body: "body",
                                headerNames: "header_names",
                                status: "status",
                                statusText: "status_text",
                            })),
                            Schema.Null,
                        ])),
                    })),
                    verdict: Schema.Union([
                        Schema.Literals(["ok", "warning", "inconclusive"]),
                        Schema.String,
                    ]),
                    preflightErrors: Schema.optional(Schema.Union([
                        Schema.Array(Schema.Struct({
                            description: Schema.String,
                            errorCode: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
                        }).pipe(Schema.encodeKeys({
                            description: "description",
                            errorCode: "error_code",
                        }))),
                        Schema.Null,
                    ])),
                }).pipe(Schema.encodeKeys({
                    steps: "steps",
                    verdict: "verdict",
                    preflightErrors: "preflight_errors",
                }))),
            }),
            reportSchemaVersion: Schema.Literal("v1"),
        }).pipe(Schema.encodeKeys({
            report: "report",
            reportSchemaVersion: "report_schema_version",
        })),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    scanType: "scan_type",
    status: "status",
    targetEnvironmentId: "target_environment_id",
    report: "report",
}))
    .pipe(T.ResponsePath("result"));
export const createScan = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateScanRequest,
    output: CreateScanResponse,
    errors: [],
}));
export const GetTargetEnvironmentRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    targetEnvironmentId: Schema.String.pipe(T.HttpPath("targetEnvironmentId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/vuln_scanner/target_environments/{targetEnvironmentId}",
}));
export const GetTargetEnvironmentResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
    target: Schema.Struct({
        type: Schema.Literal("zone"),
        zoneTag: Schema.String,
    }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" })),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const getTargetEnvironment = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetTargetEnvironmentRequest,
    output: GetTargetEnvironmentResponse,
    errors: [],
}));
export const ListTargetEnvironmentsRequest = 
/*@__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")),
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/vuln_scanner/target_environments",
}));
export const ListTargetEnvironmentsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        name: Schema.String,
        target: Schema.Struct({
            type: Schema.Literal("zone"),
            zoneTag: Schema.String,
        }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" })),
        description: Schema.optional(Schema.Union([Schema.String, 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 listTargetEnvironments = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListTargetEnvironmentsRequest,
    output: ListTargetEnvironmentsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateTargetEnvironmentRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    name: Schema.String,
    target: Schema.Struct({
        type: Schema.Literal("zone"),
        zoneTag: Schema.String,
    }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" })),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/vuln_scanner/target_environments",
}));
export const CreateTargetEnvironmentResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
    target: Schema.Struct({
        type: Schema.Literal("zone"),
        zoneTag: Schema.String,
    }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" })),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const createTargetEnvironment = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateTargetEnvironmentRequest,
    output: CreateTargetEnvironmentResponse,
    errors: [],
}));
export const UpdateTargetEnvironmentRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    targetEnvironmentId: Schema.String.pipe(T.HttpPath("targetEnvironmentId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    name: Schema.String,
    target: Schema.Struct({
        type: Schema.Literal("zone"),
        zoneTag: Schema.String,
    }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" })),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.Http({
    method: "PUT",
    path: "/accounts/{account_id}/vuln_scanner/target_environments/{targetEnvironmentId}",
}));
export const UpdateTargetEnvironmentResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
    target: Schema.Struct({
        type: Schema.Literal("zone"),
        zoneTag: Schema.String,
    }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" })),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const updateTargetEnvironment = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateTargetEnvironmentRequest,
    output: UpdateTargetEnvironmentResponse,
    errors: [],
}));
export const PatchTargetEnvironmentRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    targetEnvironmentId: Schema.String.pipe(T.HttpPath("targetEnvironmentId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    name: Schema.optional(Schema.String),
    target: Schema.optional(Schema.Struct({
        type: Schema.Literal("zone"),
        zoneTag: Schema.String,
    }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" }))),
}).pipe(T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/vuln_scanner/target_environments/{targetEnvironmentId}",
}));
export const PatchTargetEnvironmentResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    name: Schema.String,
    target: Schema.Struct({
        type: Schema.Literal("zone"),
        zoneTag: Schema.String,
    }).pipe(Schema.encodeKeys({ type: "type", zoneTag: "zone_tag" })),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const patchTargetEnvironment = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchTargetEnvironmentRequest,
    output: PatchTargetEnvironmentResponse,
    errors: [],
}));
export const DeleteTargetEnvironmentRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    targetEnvironmentId: Schema.String.pipe(T.HttpPath("targetEnvironmentId")),
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/vuln_scanner/target_environments/{targetEnvironmentId}",
}));
export const DeleteTargetEnvironmentResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Unknown.pipe(T.ResponsePath("result"));
export const deleteTargetEnvironment = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteTargetEnvironmentRequest,
    output: DeleteTargetEnvironmentResponse,
    errors: [],
}));
//# sourceMappingURL=vulnerability-scanner.js.map