// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as OverridesAPI from 'cloudflare/resources/firewall/waf/overrides';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Overrides extends APIResource {
    /**
     * Creates a URI-based WAF override for a zone.
     *
     * **Note:** Applies only to the
     * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
     */
    create(zoneIdentifier, body, options) {
        return this._client.post(`/zones/${zoneIdentifier}/firewall/waf/overrides`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates an existing URI-based WAF override.
     *
     * **Note:** Applies only to the
     * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
     */
    update(zoneIdentifier, id, body, options) {
        return this._client.put(`/zones/${zoneIdentifier}/firewall/waf/overrides/${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}/firewall/waf/overrides`, LegacyJhsOverridesV4PagePaginationArray, { query, ...options });
    }
    /**
     * Deletes an existing URI-based WAF override.
     *
     * **Note:** Applies only to the
     * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
     */
    delete(zoneIdentifier, id, options) {
        return this._client.delete(`/zones/${zoneIdentifier}/firewall/waf/overrides/${id}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetches the details of a URI-based WAF override.
     *
     * **Note:** Applies only to the
     * [previous version of WAF managed rules](https://developers.cloudflare.com/support/firewall/managed-rules-web-application-firewall-waf/understanding-waf-managed-rules-web-application-firewall/).
     */
    get(zoneIdentifier, id, options) {
        return this._client.get(`/zones/${zoneIdentifier}/firewall/waf/overrides/${id}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class LegacyJhsOverridesV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Overrides) {
    Overrides.LegacyJhsOverridesV4PagePaginationArray = OverridesAPI.LegacyJhsOverridesV4PagePaginationArray;
})(Overrides || (Overrides = {}));
//# sourceMappingURL=overrides.mjs.map