/**
 * Cloudflare FILTERS API
 *
 * Generated from Cloudflare TypeScript SDK.
 * DO NOT EDIT - regenerate with: bun scripts/generate.ts --service filters
 */
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 GetFilterRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    filterId: Schema.String.pipe(T.HttpPath("filterId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/filters/{filterId}" }));
export const GetFilterResponse = /*@__PURE__*/ /*#__PURE__*/ 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])),
}).pipe(T.ResponsePath("result"));
export const getFilter = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetFilterRequest,
    output: GetFilterResponse,
    errors: [],
}));
export const ListFiltersRequest = /*@__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")),
    description: Schema.optional(Schema.String).pipe(T.HttpQuery("description")),
    expression: Schema.optional(Schema.String).pipe(T.HttpQuery("expression")),
    paused: Schema.optional(Schema.Boolean).pipe(T.HttpQuery("paused")),
    ref: Schema.optional(Schema.String).pipe(T.HttpQuery("ref")),
}).pipe(T.Http({ method: "GET", path: "/zones/{zone_id}/filters" }));
export const ListFiltersResponse = /*@__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])),
        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])),
    })),
    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 listFilters = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListFiltersRequest,
    output: ListFiltersResponse,
    errors: [],
    pagination: {
        mode: "page",
        inputToken: "page",
        outputToken: "resultInfo.page",
        items: "result",
        pageSize: "perPage",
    },
}));
export const CreateFilterRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    body: Schema.Array(Schema.Struct({
        description: Schema.optional(Schema.String),
        expression: Schema.optional(Schema.String),
        paused: Schema.optional(Schema.Boolean),
        ref: Schema.optional(Schema.String),
    })).pipe(T.HttpBody()),
}).pipe(T.Http({ method: "POST", path: "/zones/{zone_id}/filters" }));
export const CreateFilterResponse = /*@__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])),
        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])),
    })),
});
export const createFilter = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: CreateFilterRequest,
    output: CreateFilterResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
export const UpdateFilterRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    filterId: Schema.String.pipe(T.HttpPath("filterId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    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}/filters/{filterId}" }));
export const UpdateFilterResponse = /*@__PURE__*/ /*#__PURE__*/ 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])),
}).pipe(T.ResponsePath("result"));
export const updateFilter = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateFilterRequest,
    output: UpdateFilterResponse,
    errors: [],
}));
export const DeleteFilterRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    filterId: Schema.String.pipe(T.HttpPath("filterId")),
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
}).pipe(T.Http({ method: "DELETE", path: "/zones/{zone_id}/filters/{filterId}" }));
export const DeleteFilterResponse = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    id: Schema.String,
}).pipe(T.ResponsePath("result"));
export const deleteFilter = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteFilterRequest,
    output: DeleteFilterResponse,
    errors: [],
}));
export const BulkDeleteFiltersRequest = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    id: Schema.Array(Schema.String).pipe(T.HttpQuery("id")),
}).pipe(T.Http({ method: "DELETE", path: "/zones/{zone_id}/filters" }));
export const BulkDeleteFiltersResponse = 
/*@__PURE__*/ /*#__PURE__*/ Schema.Array(Schema.Struct({
    id: Schema.optional(Schema.Union([Schema.String, Schema.Null])),
})).pipe(T.ResponsePath("result"));
export const bulkDeleteFilters = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BulkDeleteFiltersRequest,
    output: BulkDeleteFiltersResponse,
    errors: [],
}));
export const BulkPutFiltersRequest = /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
    zoneId: Schema.String.pipe(T.HttpPath("zone_id")),
    body: Schema.Array(Schema.Struct({
        description: Schema.optional(Schema.String),
        expression: Schema.optional(Schema.String),
        paused: Schema.optional(Schema.Boolean),
        ref: Schema.optional(Schema.String),
    })).pipe(T.HttpBody()),
}).pipe(T.Http({ method: "PUT", path: "/zones/{zone_id}/filters" }));
export const BulkPutFiltersResponse = /*@__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])),
        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])),
    })),
});
export const bulkPutFilters = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: BulkPutFiltersRequest,
    output: BulkPutFiltersResponse,
    errors: [],
    pagination: {
        mode: "single",
        items: "result",
    },
}));
//# sourceMappingURL=filters.js.map