"use strict";
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.FirewallFiltersV4PagePaginationArray = exports.Filters = void 0;
const resource_1 = require("cloudflaredev/resource");
const core_1 = require("cloudflaredev/core");
const pagination_1 = require("cloudflaredev/pagination");
class Filters extends resource_1.APIResource {
    /**
     * Creates one or more filters.
     */
    create(zoneIdentifier, body, options) {
        return this._client.post(`/zones/${zoneIdentifier}/filters`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates an existing filter.
     */
    update(zoneIdentifier, id, body, options) {
        return this._client.put(`/zones/${zoneIdentifier}/filters/${id}`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    list(zoneIdentifier, query = {}, options) {
        if ((0, core_1.isRequestOptions)(query)) {
            return this.list(zoneIdentifier, {}, query);
        }
        return this._client.getAPIList(`/zones/${zoneIdentifier}/filters`, FirewallFiltersV4PagePaginationArray, {
            query,
            ...options,
        });
    }
    /**
     * Deletes an existing filter.
     */
    delete(zoneIdentifier, id, options) {
        return this._client.delete(`/zones/${zoneIdentifier}/filters/${id}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetches the details of a filter.
     */
    get(zoneIdentifier, id, options) {
        return this._client.get(`/zones/${zoneIdentifier}/filters/${id}`, options)._thenUnwrap((obj) => obj.result);
    }
}
exports.Filters = Filters;
class FirewallFiltersV4PagePaginationArray extends pagination_1.V4PagePaginationArray {
}
exports.FirewallFiltersV4PagePaginationArray = FirewallFiltersV4PagePaginationArray;
//# sourceMappingURL=filters.js.map