// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as FiltersAPI from 'cloudflare/resources/filters';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Filters extends 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 (isRequestOptions(query)) {
            return this.list(zoneIdentifier, {}, query);
        }
        return this._client.getAPIList(`/zones/${zoneIdentifier}/filters`, LegacyJhsFiltersV4PagePaginationArray, { 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);
    }
}
export class LegacyJhsFiltersV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Filters) {
    Filters.LegacyJhsFiltersV4PagePaginationArray = FiltersAPI.LegacyJhsFiltersV4PagePaginationArray;
})(Filters || (Filters = {}));
//# sourceMappingURL=filters.mjs.map