/**
 * Cloudflare FIREWALL API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service firewall
 */
import * as Schema from "effect/Schema";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import {} from "../errors.js";
// =============================================================================
// AccessRule
// =============================================================================
const GetAccessRuleBaseFields = {
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
};
export const GetAccessRuleForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...GetAccessRuleBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/firewall/access_rules/rules/{ruleId}",
}));
export const GetAccessRuleForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...GetAccessRuleBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/access_rules/rules/{ruleId}",
}));
export const GetAccessRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    allowedModes: Schema.Array(Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ])),
    configuration: Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip6"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("asn"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("country"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    ]),
    mode: Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ]),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    notes: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    scope: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            email: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([
                Schema.Literals(["user", "organization"]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    allowedModes: "allowed_modes",
    configuration: "configuration",
    mode: "mode",
    createdOn: "created_on",
    modifiedOn: "modified_on",
    notes: "notes",
    scope: "scope",
}))
    .pipe(T.ResponsePath("result"));
export const getAccessRuleForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAccessRuleForAccountRequest,
    output: GetAccessRuleResponse,
    errors: [],
}));
export const getAccessRuleForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAccessRuleForZoneRequest,
    output: GetAccessRuleResponse,
    errors: [],
}));
const ListAccessRulesBaseFields = {};
export const ListAccessRulesForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...ListAccessRulesBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/accounts/{account_id}/firewall/access_rules/rules",
}));
export const ListAccessRulesForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...ListAccessRulesBaseFields,
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/access_rules/rules",
}));
export const ListAccessRulesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        allowedModes: Schema.Array(Schema.Literals([
            "block",
            "challenge",
            "whitelist",
            "js_challenge",
            "managed_challenge",
        ])),
        configuration: Schema.Union([
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.Literal("ip6"), Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.Literal("asn"), Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.Literal("country"), Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
        ]),
        mode: Schema.Literals([
            "block",
            "challenge",
            "whitelist",
            "js_challenge",
            "managed_challenge",
        ]),
        createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        notes: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        scope: Schema.optional(Schema.Union([
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                email: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                type: Schema.optional(Schema.Union([
                    Schema.Literals(["user", "organization"]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        allowedModes: "allowed_modes",
        configuration: "configuration",
        mode: "mode",
        createdOn: "created_on",
        modifiedOn: "modified_on",
        notes: "notes",
        scope: "scope",
    }))),
    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 listAccessRulesForAccount = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAccessRulesForAccountRequest,
    output: ListAccessRulesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const listAccessRulesForZone = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAccessRulesForZoneRequest,
    output: ListAccessRulesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
const CreateAccessRuleBaseFields = {
    configuration: Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip6")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip_range")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("asn")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("country")),
            value: Schema.optional(Schema.String),
        }),
    ]),
    mode: Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ]),
    notes: Schema.optional(Schema.String),
};
export const CreateAccessRuleForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...CreateAccessRuleBaseFields,
}).pipe(T.Http({
    method: "POST",
    path: "/accounts/{account_id}/firewall/access_rules/rules",
}));
export const CreateAccessRuleForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...CreateAccessRuleBaseFields,
}).pipe(T.Http({
    method: "POST",
    path: "/zones/{zone_id}/firewall/access_rules/rules",
}));
export const CreateAccessRuleResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    allowedModes: Schema.Array(Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ])),
    configuration: Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip6"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("asn"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("country"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    ]),
    mode: Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ]),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    notes: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    scope: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            email: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([
                Schema.Literals(["user", "organization"]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    allowedModes: "allowed_modes",
    configuration: "configuration",
    mode: "mode",
    createdOn: "created_on",
    modifiedOn: "modified_on",
    notes: "notes",
    scope: "scope",
}))
    .pipe(T.ResponsePath("result"));
export const createAccessRuleForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAccessRuleForAccountRequest,
    output: CreateAccessRuleResponse,
    errors: [],
}));
export const createAccessRuleForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAccessRuleForZoneRequest,
    output: CreateAccessRuleResponse,
    errors: [],
}));
const PatchAccessRuleBaseFields = {
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    configuration: Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip6")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip_range")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("asn")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("country")),
            value: Schema.optional(Schema.String),
        }),
    ]),
    mode: Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ]),
    notes: Schema.optional(Schema.String),
};
export const PatchAccessRuleForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...PatchAccessRuleBaseFields,
}).pipe(T.Http({
    method: "PATCH",
    path: "/accounts/{account_id}/firewall/access_rules/rules/{ruleId}",
}));
export const PatchAccessRuleForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...PatchAccessRuleBaseFields,
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/firewall/access_rules/rules/{ruleId}",
}));
export const PatchAccessRuleResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    allowedModes: Schema.Array(Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ])),
    configuration: Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip6"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("asn"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("country"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    ]),
    mode: Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ]),
    createdOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    modifiedOn: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    notes: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    scope: Schema.optional(Schema.Union([
        Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            email: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            type: Schema.optional(Schema.Union([
                Schema.Literals(["user", "organization"]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    allowedModes: "allowed_modes",
    configuration: "configuration",
    mode: "mode",
    createdOn: "created_on",
    modifiedOn: "modified_on",
    notes: "notes",
    scope: "scope",
}))
    .pipe(T.ResponsePath("result"));
export const patchAccessRuleForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchAccessRuleForAccountRequest,
    output: PatchAccessRuleResponse,
    errors: [],
}));
export const patchAccessRuleForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchAccessRuleForZoneRequest,
    output: PatchAccessRuleResponse,
    errors: [],
}));
const DeleteAccessRuleBaseFields = {
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
};
export const DeleteAccessRuleForAccountRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    accountId: Schema.String.pipe(T.HttpPath("account_id")),
    ...DeleteAccessRuleBaseFields,
}).pipe(T.Http({
    method: "DELETE",
    path: "/accounts/{account_id}/firewall/access_rules/rules/{ruleId}",
}));
export const DeleteAccessRuleForZoneRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    ...DeleteAccessRuleBaseFields,
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/firewall/access_rules/rules/{ruleId}",
}));
export const DeleteAccessRuleResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
}).pipe(T.ResponsePath("result"));
export const deleteAccessRuleForAccount = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAccessRuleForAccountRequest,
    output: DeleteAccessRuleResponse,
    errors: [],
}));
export const deleteAccessRuleForZone = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAccessRuleForZoneRequest,
    output: DeleteAccessRuleResponse,
    errors: [],
}));
export const GetLockdownRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    lockDownsId: Schema.String.pipe(T.HttpPath("lockDownsId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/lockdowns/{lockDownsId}",
}));
export const GetLockdownResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    configurations: Schema.Array(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    ])),
    createdOn: Schema.String,
    description: Schema.String,
    modifiedOn: Schema.String,
    paused: Schema.Boolean,
    urls: Schema.Array(Schema.String),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    configurations: "configurations",
    createdOn: "created_on",
    description: "description",
    modifiedOn: "modified_on",
    paused: "paused",
    urls: "urls",
}))
    .pipe(T.ResponsePath("result"));
export const getLockdown = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetLockdownRequest,
    output: GetLockdownResponse,
    errors: [],
}));
export const ListLockdownsRequest = /*@__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")),
    createdOn: Schema.optional(Schema.String).pipe(T.HttpQuery("created_on")),
    description: Schema.optional(Schema.String).pipe(T.HttpQuery("description")),
    descriptionSearch: Schema.optional(Schema.String).pipe(T.HttpQuery("description_search")),
    ip: Schema.optional(Schema.String).pipe(T.HttpQuery("ip")),
    ipRangeSearch: Schema.optional(Schema.String).pipe(T.HttpQuery("ip_range_search")),
    ipSearch: Schema.optional(Schema.String).pipe(T.HttpQuery("ip_search")),
    modifiedOn: Schema.optional(Schema.String).pipe(T.HttpQuery("modified_on")),
    priority: Schema.optional(Schema.Number).pipe(T.HttpQuery("priority")),
    uriSearch: Schema.optional(Schema.String).pipe(T.HttpQuery("uri_search")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/firewall/lockdowns" }));
export const ListLockdownsResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        configurations: Schema.Array(Schema.Union([
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
        ])),
        createdOn: Schema.String,
        description: Schema.String,
        modifiedOn: Schema.String,
        paused: Schema.Boolean,
        urls: Schema.Array(Schema.String),
    }).pipe(Schema.encodeKeys({
        id: "id",
        configurations: "configurations",
        createdOn: "created_on",
        description: "description",
        modifiedOn: "modified_on",
        paused: "paused",
        urls: "urls",
    }))),
    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 listLockdowns = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListLockdownsRequest,
    output: ListLockdownsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateLockdownRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    configurations: Schema.Array(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip_range")),
            value: Schema.optional(Schema.String),
        }),
    ])),
    urls: Schema.Array(Schema.String),
    description: Schema.optional(Schema.String),
    paused: Schema.optional(Schema.Boolean),
    priority: Schema.optional(Schema.Number),
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/firewall/lockdowns" }));
export const CreateLockdownResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    configurations: Schema.Array(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    ])),
    createdOn: Schema.String,
    description: Schema.String,
    modifiedOn: Schema.String,
    paused: Schema.Boolean,
    urls: Schema.Array(Schema.String),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    configurations: "configurations",
    createdOn: "created_on",
    description: "description",
    modifiedOn: "modified_on",
    paused: "paused",
    urls: "urls",
}))
    .pipe(T.ResponsePath("result"));
export const createLockdown = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateLockdownRequest,
    output: CreateLockdownResponse,
    errors: [],
}));
export const UpdateLockdownRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    lockDownsId: Schema.String.pipe(T.HttpPath("lockDownsId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    configurations: Schema.Array(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip_range")),
            value: Schema.optional(Schema.String),
        }),
    ])),
    urls: Schema.Array(Schema.String),
}).pipe(T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/firewall/lockdowns/{lockDownsId}",
}));
export const UpdateLockdownResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
    configurations: Schema.Array(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.Literal("ip_range"), Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
    ])),
    createdOn: Schema.String,
    description: Schema.String,
    modifiedOn: Schema.String,
    paused: Schema.Boolean,
    urls: Schema.Array(Schema.String),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    configurations: "configurations",
    createdOn: "created_on",
    description: "description",
    modifiedOn: "modified_on",
    paused: "paused",
    urls: "urls",
}))
    .pipe(T.ResponsePath("result"));
export const updateLockdown = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateLockdownRequest,
    output: UpdateLockdownResponse,
    errors: [],
}));
export const DeleteLockdownRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    lockDownsId: Schema.String.pipe(T.HttpPath("lockDownsId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/firewall/lockdowns/{lockDownsId}",
}));
export const DeleteLockdownResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteLockdown = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteLockdownRequest,
    output: DeleteLockdownResponse,
    errors: [],
}));
export const BulkPutRulesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    body: Schema.Unknown.pipe(T.HttpBody()),
}).pipe(T.Http({ method: "PUT", path: "/zones/{zone_id}/firewall/rules" }));
export const BulkPutRulesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        action: Schema.optional(Schema.Union([
            Schema.Literals([
                "block",
                "challenge",
                "js_challenge",
                "managed_challenge",
                "allow",
                "log",
                "bypass",
            ]),
            Schema.Null,
        ])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        filter: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    id: Schema.String,
                    deleted: Schema.Boolean,
                }),
                Schema.Struct({
                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        products: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "zoneLockdown",
                "uaBlock",
                "bic",
                "hot",
                "securityLevel",
                "rateLimit",
                "waf",
            ])),
            Schema.Null,
        ])),
        ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const bulkPutRules = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkPutRulesRequest,
    output: BulkPutRulesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const GetRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/firewall/rules/{ruleId}" }));
export const GetRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    action: Schema.optional(Schema.Union([
        Schema.Literals([
            "block",
            "challenge",
            "js_challenge",
            "managed_challenge",
            "allow",
            "log",
            "bypass",
        ]),
        Schema.Null,
    ])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    filter: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                id: Schema.String,
                deleted: Schema.Boolean,
            }),
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
        ]),
        Schema.Null,
    ])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    products: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "zoneLockdown",
            "uaBlock",
            "bic",
            "hot",
            "securityLevel",
            "rateLimit",
            "waf",
        ])),
        Schema.Null,
    ])),
    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const getRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetRuleRequest,
    output: GetRuleResponse,
    errors: [],
}));
export const ListRulesRequest = /*@__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")),
    id: Schema.optional(Schema.String).pipe(T.HttpQuery("id")),
    action: Schema.optional(Schema.String).pipe(T.HttpQuery("action")),
    description: Schema.optional(Schema.String).pipe(T.HttpQuery("description")),
    paused: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("paused")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/firewall/rules" }));
export const ListRulesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        action: Schema.optional(Schema.Union([
            Schema.Literals([
                "block",
                "challenge",
                "js_challenge",
                "managed_challenge",
                "allow",
                "log",
                "bypass",
            ]),
            Schema.Null,
        ])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        filter: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    id: Schema.String,
                    deleted: Schema.Boolean,
                }),
                Schema.Struct({
                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        products: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "zoneLockdown",
                "uaBlock",
                "bic",
                "hot",
                "securityLevel",
                "rateLimit",
                "waf",
            ])),
            Schema.Null,
        ])),
        ref: 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 listRules = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListRulesRequest,
    output: ListRulesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    action: Schema.Struct({
        mode: Schema.optional(Schema.Literals([
            "simulate",
            "ban",
            "challenge",
            "js_challenge",
            "managed_challenge",
        ])),
        response: Schema.optional(Schema.Struct({
            body: Schema.optional(Schema.String),
            contentType: Schema.optional(Schema.String),
        }).pipe(Schema.encodeKeys({ body: "body", contentType: "content_type" }))),
        timeout: Schema.optional(Schema.Number),
    }),
    filter: Schema.Struct({
        description: Schema.optional(Schema.String),
        expression: Schema.optional(Schema.String),
        paused: Schema.optional(Schema.Boolean),
        ref: Schema.optional(Schema.String),
    }),
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/firewall/rules" }));
export const CreateRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        action: Schema.optional(Schema.Union([
            Schema.Literals([
                "block",
                "challenge",
                "js_challenge",
                "managed_challenge",
                "allow",
                "log",
                "bypass",
            ]),
            Schema.Null,
        ])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        filter: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    id: Schema.String,
                    deleted: Schema.Boolean,
                }),
                Schema.Struct({
                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        products: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "zoneLockdown",
                "uaBlock",
                "bic",
                "hot",
                "securityLevel",
                "rateLimit",
                "waf",
            ])),
            Schema.Null,
        ])),
        ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const createRule = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: CreateRuleRequest,
    output: CreateRuleResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const UpdateRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    action: Schema.Struct({
        mode: Schema.optional(Schema.Literals([
            "simulate",
            "ban",
            "challenge",
            "js_challenge",
            "managed_challenge",
        ])),
        response: Schema.optional(Schema.Struct({
            body: Schema.optional(Schema.String),
            contentType: Schema.optional(Schema.String),
        }).pipe(Schema.encodeKeys({ body: "body", contentType: "content_type" }))),
        timeout: Schema.optional(Schema.Number),
    }),
    filter: Schema.Struct({
        description: Schema.optional(Schema.String),
        expression: Schema.optional(Schema.String),
        paused: Schema.optional(Schema.Boolean),
        ref: Schema.optional(Schema.String),
    }),
}).pipe(T.Http({ method: "PUT", path: "/zones/{zone_id}/firewall/rules/{ruleId}" }));
export const UpdateRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    action: Schema.optional(Schema.Union([
        Schema.Literals([
            "block",
            "challenge",
            "js_challenge",
            "managed_challenge",
            "allow",
            "log",
            "bypass",
        ]),
        Schema.Null,
    ])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    filter: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                id: Schema.String,
                deleted: Schema.Boolean,
            }),
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
        ]),
        Schema.Null,
    ])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    products: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "zoneLockdown",
            "uaBlock",
            "bic",
            "hot",
            "securityLevel",
            "rateLimit",
            "waf",
        ])),
        Schema.Null,
    ])),
    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const updateRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateRuleRequest,
    output: UpdateRuleResponse,
    errors: [],
}));
export const PatchRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "PATCH", path: "/zones/{zone_id}/firewall/rules/{ruleId}" }));
export const PatchRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        action: Schema.optional(Schema.Union([
            Schema.Literals([
                "block",
                "challenge",
                "js_challenge",
                "managed_challenge",
                "allow",
                "log",
                "bypass",
            ]),
            Schema.Null,
        ])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        filter: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    id: Schema.String,
                    deleted: Schema.Boolean,
                }),
                Schema.Struct({
                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        products: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "zoneLockdown",
                "uaBlock",
                "bic",
                "hot",
                "securityLevel",
                "rateLimit",
                "waf",
            ])),
            Schema.Null,
        ])),
        ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const patchRule = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: PatchRuleRequest,
    output: PatchRuleResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const DeleteRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/firewall/rules/{ruleId}",
}));
export const DeleteRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    action: Schema.optional(Schema.Union([
        Schema.Literals([
            "block",
            "challenge",
            "js_challenge",
            "managed_challenge",
            "allow",
            "log",
            "bypass",
        ]),
        Schema.Null,
    ])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    filter: Schema.optional(Schema.Union([
        Schema.Union([
            Schema.Struct({
                id: Schema.String,
                deleted: Schema.Boolean,
            }),
            Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
        ]),
        Schema.Null,
    ])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    products: Schema.optional(Schema.Union([
        Schema.Array(Schema.Literals([
            "zoneLockdown",
            "uaBlock",
            "bic",
            "hot",
            "securityLevel",
            "rateLimit",
            "waf",
        ])),
        Schema.Null,
    ])),
    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteRuleRequest,
    output: DeleteRuleResponse,
    errors: [],
}));
export const BulkPatchRulesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    body: Schema.Unknown.pipe(T.HttpBody()),
}).pipe(T.Http({ method: "PATCH", path: "/zones/{zone_id}/firewall/rules" }));
export const BulkPatchRulesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        action: Schema.optional(Schema.Union([
            Schema.Literals([
                "block",
                "challenge",
                "js_challenge",
                "managed_challenge",
                "allow",
                "log",
                "bypass",
            ]),
            Schema.Null,
        ])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        filter: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    id: Schema.String,
                    deleted: Schema.Boolean,
                }),
                Schema.Struct({
                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        products: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "zoneLockdown",
                "uaBlock",
                "bic",
                "hot",
                "securityLevel",
                "rateLimit",
                "waf",
            ])),
            Schema.Null,
        ])),
        ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const bulkPatchRules = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkPatchRulesRequest,
    output: BulkPatchRulesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const BulkDeleteRulesRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "DELETE", path: "/zones/{zone_id}/firewall/rules" }));
export const BulkDeleteRulesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        action: Schema.optional(Schema.Union([
            Schema.Literals([
                "block",
                "challenge",
                "js_challenge",
                "managed_challenge",
                "allow",
                "log",
                "bypass",
            ]),
            Schema.Null,
        ])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        filter: Schema.optional(Schema.Union([
            Schema.Union([
                Schema.Struct({
                    id: Schema.String,
                    deleted: Schema.Boolean,
                }),
                Schema.Struct({
                    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    expression: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
                    ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                }),
            ]),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        products: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals([
                "zoneLockdown",
                "uaBlock",
                "bic",
                "hot",
                "securityLevel",
                "rateLimit",
                "waf",
            ])),
            Schema.Null,
        ])),
        ref: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    })),
});
export const bulkDeleteRules = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkDeleteRulesRequest,
    output: BulkDeleteRulesResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const GetUaRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    uaRuleId: Schema.String.pipe(T.HttpPath("uaRuleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/ua_rules/{uaRuleId}",
}));
export const GetUaRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    configuration: Schema.optional(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    mode: Schema.optional(Schema.Union([
        Schema.Literals([
            "block",
            "challenge",
            "js_challenge",
            "managed_challenge",
        ]),
        Schema.Null,
    ])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const getUaRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetUaRuleRequest,
    output: GetUaRuleResponse,
    errors: [],
}));
export const ListUaRulesRequest = /*@__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")),
    description: Schema.optional(Schema.String).pipe(T.HttpQuery("description")),
    paused: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("paused")),
    userAgent: Schema.optional(Schema.String).pipe(T.HttpQuery("user_agent")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/firewall/ua_rules" }));
export const ListUaRulesResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        configuration: Schema.optional(Schema.Union([
            Schema.Struct({
                target: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            Schema.Null,
        ])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        mode: Schema.optional(Schema.Union([
            Schema.Literals([
                "block",
                "challenge",
                "js_challenge",
                "managed_challenge",
            ]),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, 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 listUaRules = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListUaRulesRequest,
    output: ListUaRulesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateUaRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    configuration: Schema.Struct({
        target: Schema.optional(Schema.Literal("ua")),
        value: Schema.optional(Schema.String),
    }),
    mode: Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ]),
    description: Schema.optional(Schema.String),
    paused: Schema.optional(Schema.Boolean),
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/firewall/ua_rules" }));
export const CreateUaRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    configuration: Schema.optional(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    mode: Schema.optional(Schema.Union([
        Schema.Literals([
            "block",
            "challenge",
            "js_challenge",
            "managed_challenge",
        ]),
        Schema.Null,
    ])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const createUaRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateUaRuleRequest,
    output: CreateUaRuleResponse,
    errors: [],
}));
export const UpdateUaRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    uaRuleId: Schema.String.pipe(T.HttpPath("uaRuleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    configuration: Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip6")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("ip_range")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("asn")),
            value: Schema.optional(Schema.String),
        }),
        Schema.Struct({
            target: Schema.optional(Schema.Literal("country")),
            value: Schema.optional(Schema.String),
        }),
    ]),
    mode: Schema.Literals([
        "block",
        "challenge",
        "whitelist",
        "js_challenge",
        "managed_challenge",
    ]),
    description: Schema.optional(Schema.String),
    paused: Schema.optional(Schema.Boolean),
}).pipe(T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/firewall/ua_rules/{uaRuleId}",
}));
export const UpdateUaRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    configuration: Schema.optional(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    mode: Schema.optional(Schema.Union([
        Schema.Literals([
            "block",
            "challenge",
            "js_challenge",
            "managed_challenge",
        ]),
        Schema.Null,
    ])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const updateUaRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateUaRuleRequest,
    output: UpdateUaRuleResponse,
    errors: [],
}));
export const DeleteUaRuleRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    uaRuleId: Schema.String.pipe(T.HttpPath("uaRuleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/firewall/ua_rules/{uaRuleId}",
}));
export const DeleteUaRuleResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    configuration: Schema.optional(Schema.Union([
        Schema.Struct({
            target: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            value: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        Schema.Null,
    ])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    mode: Schema.optional(Schema.Union([
        Schema.Literals([
            "block",
            "challenge",
            "js_challenge",
            "managed_challenge",
        ]),
        Schema.Null,
    ])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteUaRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteUaRuleRequest,
    output: DeleteUaRuleResponse,
    errors: [],
}));
export const GetWafOverrideRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    overridesId: Schema.String.pipe(T.HttpPath("overridesId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/waf/overrides/{overridesId}",
}));
export const GetWafOverrideResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    groups: Schema.optional(Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    rewriteAction: Schema.optional(Schema.Union([
        Schema.Struct({
            block: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            challenge: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            default: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            disable: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            simulate: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    rules: Schema.optional(Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null])),
    urls: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    description: "description",
    groups: "groups",
    paused: "paused",
    priority: "priority",
    rewriteAction: "rewrite_action",
    rules: "rules",
    urls: "urls",
}))
    .pipe(T.ResponsePath("result"));
export const getWafOverride = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetWafOverrideRequest,
    output: GetWafOverrideResponse,
    errors: [],
}));
export const ListWafOverridesRequest = 
/*@__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}/firewall/waf/overrides" }));
export const ListWafOverridesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        groups: Schema.optional(Schema.Union([
            Schema.Record(Schema.String, Schema.Unknown),
            Schema.Null,
        ])),
        paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
        priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        rewriteAction: Schema.optional(Schema.Union([
            Schema.Struct({
                block: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "challenge",
                        "block",
                        "simulate",
                        "disable",
                        "default",
                    ]),
                    Schema.Null,
                ])),
                challenge: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "challenge",
                        "block",
                        "simulate",
                        "disable",
                        "default",
                    ]),
                    Schema.Null,
                ])),
                default: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "challenge",
                        "block",
                        "simulate",
                        "disable",
                        "default",
                    ]),
                    Schema.Null,
                ])),
                disable: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "challenge",
                        "block",
                        "simulate",
                        "disable",
                        "default",
                    ]),
                    Schema.Null,
                ])),
                simulate: Schema.optional(Schema.Union([
                    Schema.Literals([
                        "challenge",
                        "block",
                        "simulate",
                        "disable",
                        "default",
                    ]),
                    Schema.Null,
                ])),
            }),
            Schema.Null,
        ])),
        rules: Schema.optional(Schema.Union([
            Schema.Record(Schema.String, Schema.Unknown),
            Schema.Null,
        ])),
        urls: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        description: "description",
        groups: "groups",
        paused: "paused",
        priority: "priority",
        rewriteAction: "rewrite_action",
        rules: "rules",
        urls: "urls",
    }))),
    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 listWafOverrides = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListWafOverridesRequest,
    output: ListWafOverridesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateWafOverrideRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    urls: Schema.Array(Schema.String),
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/firewall/waf/overrides" }));
export const CreateWafOverrideResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    groups: Schema.optional(Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    rewriteAction: Schema.optional(Schema.Union([
        Schema.Struct({
            block: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            challenge: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            default: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            disable: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            simulate: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    rules: Schema.optional(Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null])),
    urls: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    description: "description",
    groups: "groups",
    paused: "paused",
    priority: "priority",
    rewriteAction: "rewrite_action",
    rules: "rules",
    urls: "urls",
}))
    .pipe(T.ResponsePath("result"));
export const createWafOverride = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateWafOverrideRequest,
    output: CreateWafOverrideResponse,
    errors: [],
}));
export const UpdateWafOverrideRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    overridesId: Schema.String.pipe(T.HttpPath("overridesId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    id: Schema.String,
    rewriteAction: Schema.Struct({
        block: Schema.optional(Schema.Literals([
            "challenge",
            "block",
            "simulate",
            "disable",
            "default",
        ])),
        challenge: Schema.optional(Schema.Literals([
            "challenge",
            "block",
            "simulate",
            "disable",
            "default",
        ])),
        default: Schema.optional(Schema.Literals([
            "challenge",
            "block",
            "simulate",
            "disable",
            "default",
        ])),
        disable: Schema.optional(Schema.Literals([
            "challenge",
            "block",
            "simulate",
            "disable",
            "default",
        ])),
        simulate: Schema.optional(Schema.Literals([
            "challenge",
            "block",
            "simulate",
            "disable",
            "default",
        ])),
    }),
    rules: Schema.Record(Schema.String, Schema.Unknown),
    urls: Schema.Array(Schema.String),
}).pipe(Schema.encodeKeys({
    id: "id",
    rewriteAction: "rewrite_action",
    rules: "rules",
    urls: "urls",
}), T.Http({
    method: "PUT",
    path: "/zones/{zone_id}/firewall/waf/overrides/{overridesId}",
}));
export const UpdateWafOverrideResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    description: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    groups: Schema.optional(Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null])),
    paused: Schema.optional(Schema.Union([Schema.Boolean, Schema.Null])),
    priority: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
    rewriteAction: Schema.optional(Schema.Union([
        Schema.Struct({
            block: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            challenge: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            default: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            disable: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
            simulate: Schema.optional(Schema.Union([
                Schema.Literals([
                    "challenge",
                    "block",
                    "simulate",
                    "disable",
                    "default",
                ]),
                Schema.Null,
            ])),
        }),
        Schema.Null,
    ])),
    rules: Schema.optional(Schema.Union([Schema.Record(Schema.String, Schema.Unknown), Schema.Null])),
    urls: Schema.optional(Schema.Union([Schema.Array(Schema.String), Schema.Null])),
})
    .pipe(Schema.encodeKeys({
    id: "id",
    description: "description",
    groups: "groups",
    paused: "paused",
    priority: "priority",
    rewriteAction: "rewrite_action",
    rules: "rules",
    urls: "urls",
}))
    .pipe(T.ResponsePath("result"));
export const updateWafOverride = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateWafOverrideRequest,
    output: UpdateWafOverrideResponse,
    errors: [],
}));
export const DeleteWafOverrideRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    overridesId: Schema.String.pipe(T.HttpPath("overridesId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "DELETE",
    path: "/zones/{zone_id}/firewall/waf/overrides/{overridesId}",
}));
export const DeleteWafOverrideResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
}).pipe(T.ResponsePath("result"));
export const deleteWafOverride = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteWafOverrideRequest,
    output: DeleteWafOverrideResponse,
    errors: [],
}));
export const GetWafPackageRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    packageId: Schema.String.pipe(T.HttpPath("packageId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/waf/packages/{packageId}",
}));
export const GetWafPackageResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    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",
        }))),
        result: Schema.Union([Schema.String, Schema.Null]),
        success: Schema.Literal(true),
    }),
    Schema.Struct({
        result: Schema.optional(Schema.Union([Schema.Unknown, Schema.Null])),
    }),
]);
export const getWafPackage = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetWafPackageRequest,
    output: GetWafPackageResponse,
    errors: [],
}));
export const ListWafPackagesRequest = /*@__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")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    match: Schema.optional(Schema.Literals(["any", "all"])).pipe(T.HttpQuery("match")),
    name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
    order: Schema.optional(Schema.Literal("name")).pipe(T.HttpQuery("order")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/firewall/waf/packages" }));
export const ListWafPackagesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Unknown),
    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 listWafPackages = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListWafPackagesRequest,
    output: ListWafPackagesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const GetWafPackageGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    packageId: Schema.String.pipe(T.HttpPath("packageId")),
    groupId: Schema.String.pipe(T.HttpPath("groupId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/waf/packages/{packageId}/groups/{groupId}",
}));
export const GetWafPackageGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.String, Schema.Null]).pipe(T.ResponsePath("result"));
export const getWafPackageGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetWafPackageGroupRequest,
    output: GetWafPackageGroupResponse,
    errors: [],
}));
export const ListWafPackageGroupsRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    packageId: Schema.String.pipe(T.HttpPath("packageId")),
    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")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    match: Schema.optional(Schema.Literals(["any", "all"])).pipe(T.HttpQuery("match")),
    mode: Schema.optional(Schema.Literals(["on", "off"])).pipe(T.HttpQuery("mode")),
    name: Schema.optional(Schema.String).pipe(T.HttpQuery("name")),
    order: Schema.optional(Schema.Literals(["mode", "rules_count"])).pipe(T.HttpQuery("order")),
    rulesCount: Schema.optional(Schema.Number).pipe(T.HttpQuery("rules_count")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/waf/packages/{packageId}/groups",
}));
export const ListWafPackageGroupsResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Struct({
        id: Schema.String,
        description: Schema.Union([Schema.String, Schema.Null]),
        mode: Schema.Literals(["on", "off"]),
        name: Schema.String,
        rulesCount: Schema.Number,
        allowedModes: Schema.optional(Schema.Union([
            Schema.Array(Schema.Literals(["on", "off"])),
            Schema.Null,
        ])),
        modifiedRulesCount: Schema.optional(Schema.Union([Schema.Number, Schema.Null])),
        packageId: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
    }).pipe(Schema.encodeKeys({
        id: "id",
        description: "description",
        mode: "mode",
        name: "name",
        rulesCount: "rules_count",
        allowedModes: "allowed_modes",
        modifiedRulesCount: "modified_rules_count",
        packageId: "package_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 listWafPackageGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListWafPackageGroupsRequest,
    output: ListWafPackageGroupsResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PatchWafPackageGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    packageId: Schema.String.pipe(T.HttpPath("packageId")),
    groupId: Schema.String.pipe(T.HttpPath("groupId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    mode: Schema.optional(Schema.Literals(["on", "off"])),
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/firewall/waf/packages/{packageId}/groups/{groupId}",
}));
export const PatchWafPackageGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.String, Schema.Null]).pipe(T.ResponsePath("result"));
export const patchWafPackageGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchWafPackageGroupRequest,
    output: PatchWafPackageGroupResponse,
    errors: [],
}));
export const GetWafPackageRuleRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    packageId: Schema.String.pipe(T.HttpPath("packageId")),
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/waf/packages/{packageId}/rules/{ruleId}",
}));
export const GetWafPackageRuleResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Union([Schema.String, Schema.Null]).pipe(T.ResponsePath("result"));
export const getWafPackageRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetWafPackageRuleRequest,
    output: GetWafPackageRuleResponse,
    errors: [],
}));
export const ListWafPackageRulesRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    packageId: Schema.String.pipe(T.HttpPath("packageId")),
    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")),
    description: Schema.optional(Schema.String).pipe(T.HttpQuery("description")),
    direction: Schema.optional(Schema.Literals(["asc", "desc"])).pipe(T.HttpQuery("direction")),
    groupId: Schema.optional(Schema.String).pipe(T.HttpQuery("group_id")),
    match: Schema.optional(Schema.Literals(["any", "all"])).pipe(T.HttpQuery("match")),
    mode: Schema.optional(Schema.Literals(["DIS", "CHL", "BLK", "SIM"])).pipe(T.HttpQuery("mode")),
    order: Schema.optional(Schema.Literals(["priority", "group_id", "description"])).pipe(T.HttpQuery("order")),
    priority: Schema.optional(Schema.String).pipe(T.HttpQuery("priority")),
}).pipe(T.Http({
    method: "GET",
    path: "/zones/{zone_id}/firewall/waf/packages/{packageId}/rules",
}));
export const ListWafPackageRulesResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    result: Schema.Array(Schema.Union([
        Schema.Struct({
            id: Schema.String,
            allowedModes: Schema.Array(Schema.Literals([
                "default",
                "disable",
                "simulate",
                "block",
                "challenge",
            ])),
            defaultMode: Schema.Literals([
                "disable",
                "simulate",
                "block",
                "challenge",
            ]),
            description: Schema.String,
            group: Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            mode: Schema.Literals([
                "default",
                "disable",
                "simulate",
                "block",
                "challenge",
            ]),
            packageId: Schema.String,
            priority: Schema.String,
        }).pipe(Schema.encodeKeys({
            id: "id",
            allowedModes: "allowed_modes",
            defaultMode: "default_mode",
            description: "description",
            group: "group",
            mode: "mode",
            packageId: "package_id",
            priority: "priority",
        })),
        Schema.Struct({
            id: Schema.String,
            allowedModes: Schema.Array(Schema.Literals(["on", "off"])),
            description: Schema.String,
            group: Schema.Struct({
                id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
                name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            }),
            mode: Schema.Literals(["on", "off"]),
            packageId: Schema.String,
            priority: Schema.String,
        }).pipe(Schema.encodeKeys({
            id: "id",
            allowedModes: "allowed_modes",
            description: "description",
            group: "group",
            mode: "mode",
            packageId: "package_id",
            priority: "priority",
        })),
    ])),
    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 listWafPackageRules = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListWafPackageRulesRequest,
    output: ListWafPackageRulesResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const PatchWafPackageRuleRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    packageId: Schema.String.pipe(T.HttpPath("packageId")),
    ruleId: Schema.String.pipe(T.HttpPath("ruleId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    mode: Schema.optional(Schema.Literals([
        "default",
        "disable",
        "simulate",
        "block",
        "challenge",
        "on",
        "off",
    ])),
}).pipe(T.Http({
    method: "PATCH",
    path: "/zones/{zone_id}/firewall/waf/packages/{packageId}/rules/{ruleId}",
}));
export const PatchWafPackageRuleResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Union([
    Schema.Struct({
        id: Schema.String,
        allowedModes: Schema.Array(Schema.Literals([
            "default",
            "disable",
            "simulate",
            "block",
            "challenge",
        ])),
        defaultMode: Schema.Literals([
            "disable",
            "simulate",
            "block",
            "challenge",
        ]),
        description: Schema.String,
        group: Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        mode: Schema.Literals([
            "default",
            "disable",
            "simulate",
            "block",
            "challenge",
        ]),
        packageId: Schema.String,
        priority: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        allowedModes: "allowed_modes",
        defaultMode: "default_mode",
        description: "description",
        group: "group",
        mode: "mode",
        packageId: "package_id",
        priority: "priority",
    })),
    Schema.Struct({
        id: Schema.String,
        allowedModes: Schema.Array(Schema.Literals(["on", "off"])),
        description: Schema.String,
        group: Schema.Struct({
            id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
            name: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
        }),
        mode: Schema.Literals(["on", "off"]),
        packageId: Schema.String,
        priority: Schema.String,
    }).pipe(Schema.encodeKeys({
        id: "id",
        allowedModes: "allowed_modes",
        description: "description",
        group: "group",
        mode: "mode",
        packageId: "package_id",
        priority: "priority",
    })),
]).pipe(T.ResponsePath("result"));
export const patchWafPackageRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PatchWafPackageRuleRequest,
    output: PatchWafPackageRuleResponse,
    errors: [],
}));
//# sourceMappingURL=firewall.js.map