/**
 * Cloudflare SCHEMA-VALIDATION API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service schema-validation
 */
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 GetSchemaRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemaId: Schema.String.pipe(T.HttpPath("schemaId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    omitSource: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("omit_source")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/schema_validation/schemas/{schemaId}",
}));
export const GetSchemaResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    createdAt: Schema.String,
    kind: Schema.Literal("openapi_v3"),
    name: Schema.String,
    schemaId: Schema.String,
    source: Schema.String,
    validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    createdAt: "created_at",
    kind: "kind",
    name: "name",
    schemaId: "schema_id",
    source: "source",
    validationEnabled: "validation_enabled",
}))
    .pipe(T.ResponsePath("result"));
export const getSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSchemaRequest,
    output: GetSchemaResponse,
    errors: [],
}));
export const ListSchemasRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    page: Schema.optional(Schema.Number).pipe(T.HttpQuery("page")),
    perPage: Schema.optional(Schema.Number).pipe(T.HttpQuery("per_page")),
    omitSource: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("omit_source")),
    validationEnabled: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("validation_enabled")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/schema_validation/schemas" }));
export const ListSchemasResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        createdAt: Schema.String,
        kind: Schema.Literal("openapi_v3"),
        name: Schema.String,
        schemaId: Schema.String,
        source: Schema.String,
        validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        createdAt: "created_at",
        kind: "kind",
        name: "name",
        schemaId: "schema_id",
        source: "source",
        validationEnabled: "validation_enabled",
    }))),
    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 listSchemas = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSchemasRequest,
    output: ListSchemasResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateSchemaRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    kind: Schema.Literal("openapi_v3"),
    name: Schema.String,
    source: Schema.String,
    validationEnabled: Schema.Boolean,
}).pipe(Schema.encodeKeys({
    kind: "kind",
    name: "name",
    source: "source",
    validationEnabled: "validation_enabled",
}), T.Http({
    method: "POST",
    path: "/zones/{zone_id}/schema_validation/schemas",
}));
export const CreateSchemaResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    createdAt: Schema.String,
    kind: Schema.Literal("openapi_v3"),
    name: Schema.String,
    schemaId: Schema.String,
    source: Schema.String,
    validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    createdAt: "created_at",
    kind: "kind",
    name: "name",
    schemaId: "schema_id",
    source: "source",
    validationEnabled: "validation_enabled",
}))
    .pipe(T.ResponsePath("result"));
export const createSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateSchemaRequest,
    output: CreateSchemaResponse,
    errors: [],
}));
export const PatchSchemaRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemaId: Schema.String.pipe(T.HttpPath("schemaId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    validationEnabled: Schema.optional(Schema.Boolean),
}).pipe(Schema.encodeKeys({ validationEnabled: "validation_enabled" }), T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/schema_validation/schemas/{schemaId}",
}));
export const PatchSchemaResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    createdAt: Schema.String,
    kind: Schema.Literal("openapi_v3"),
    name: Schema.String,
    schemaId: Schema.String,
    source: Schema.String,
    validationEnabled: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    createdAt: "created_at",
    kind: "kind",
    name: "name",
    schemaId: "schema_id",
    source: "source",
    validationEnabled: "validation_enabled",
}))
    .pipe(T.ResponsePath("result"));
export const patchSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSchemaRequest,
    output: PatchSchemaResponse,
    errors: [],
}));
export const DeleteSchemaRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    schemaId: Schema.String.pipe(T.HttpPath("schemaId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/schema_validation/schemas/{schemaId}",
}));
export const DeleteSchemaResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
}).pipe(T.ResponsePath("result"));
export const deleteSchema = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSchemaRequest,
    output: DeleteSchemaResponse,
    errors: [],
}));
export const GetSettingRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/schema_validation/settings",
}));
export const GetSettingResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    validationDefaultMitigationAction: Schema.Literals(["none", "log", "block"]),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}))
    .pipe(T.ResponsePath("result"));
export const getSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingRequest,
    output: GetSettingResponse,
    errors: [],
}));
export const PutSettingRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    validationDefaultMitigationAction: Schema.Literals(["none", "log", "block"]),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
}).pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}), T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/schema_validation/settings",
}));
export const PutSettingResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    validationDefaultMitigationAction: Schema.Literals(["none", "log", "block"]),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}))
    .pipe(T.ResponsePath("result"));
export const putSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutSettingRequest,
    output: PutSettingResponse,
    errors: [],
}));
export const PatchSettingRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    validationDefaultMitigationAction: Schema.optional(Schema.Literals(["none", "log", "block"])),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
}).pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}), T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/schema_validation/settings",
}));
export const PatchSettingResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    validationDefaultMitigationAction: Schema.Literals(["none", "log", "block"]),
    validationOverrideMitigationAction: Schema.optional(Schema.Union([Schema.Literal("none"), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    validationDefaultMitigationAction: "validation_default_mitigation_action",
    validationOverrideMitigationAction: "validation_override_mitigation_action",
}))
    .pipe(T.ResponsePath("result"));
export const patchSetting = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchSettingRequest,
    output: PatchSettingResponse,
    errors: [],
}));
export const GetSettingOperationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/schema_validation/settings/operations/{operationId}",
}));
export const GetSettingOperationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    mitigationAction: Schema.Literals(["log", "block", "none"]),
    operationId: Schema.String,
})
    .pipe(Schema.encodeKeys({
    mitigationAction: "mitigation_action",
    operationId: "operation_id",
}))
    .pipe(T.ResponsePath("result"));
export const getSettingOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSettingOperationRequest,
    output: GetSettingOperationResponse,
    errors: [],
}));
export const ListSettingOperationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_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: "/zones/{zone_id}/schema_validation/settings/operations",
}));
export const ListSettingOperationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        mitigationAction: Schema.Literals(["log", "block", "none"]),
        operationId: Schema.String,
    }).pipe(Schema.encodeKeys({
        mitigationAction: "mitigation_action",
        operationId: "operation_id",
    }))),
    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 listSettingOperations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSettingOperationsRequest,
    output: ListSettingOperationsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PutSettingOperationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    mitigationAction: Schema.Union([
        Schema.Literal("log"),
        Schema.Literal("block"),
        Schema.Literal("none"),
        Schema.Null,
    ]),
}).pipe(Schema.encodeKeys({ mitigationAction: "mitigation_action" }), T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/schema_validation/settings/operations/{operationId}",
}));
export const PutSettingOperationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    mitigationAction: Schema.Literals(["log", "block", "none"]),
    operationId: Schema.String,
})
    .pipe(Schema.encodeKeys({
    mitigationAction: "mitigation_action",
    operationId: "operation_id",
}))
    .pipe(T.ResponsePath("result"));
export const putSettingOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutSettingOperationRequest,
    output: PutSettingOperationResponse,
    errors: [],
}));
export const DeleteSettingOperationRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.String.pipe(T.HttpPath("operationId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/schema_validation/settings/operations/{operationId}",
}));
export const DeleteSettingOperationResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    operationId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})
    .pipe(Schema.encodeKeys({ operationId: "operation_id" }))
    .pipe(T.ResponsePath("result"));
export const deleteSettingOperation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteSettingOperationRequest,
    output: DeleteSettingOperationResponse,
    errors: [],
}));
export const BulkPatchSettingOperationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    body: Schema.Record(Schema.String, Schema.Unknown).pipe(T.HttpBody()),
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/schema_validation/settings/operations",
}));
export const BulkPatchSettingOperationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Record(Schema.String, Schema.Unknown).pipe(T.ResponsePath("result"));
export const bulkPatchSettingOperations = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BulkPatchSettingOperationsRequest,
    output: BulkPatchSettingOperationsResponse,
    errors: [],
}));
//# sourceMappingURL=schema-validation.js.map