// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import { isRequestOptions } from 'cloudflaredev/core';
import * as OverridesAPI from 'cloudflaredev/resources/firewall/waf/overrides';
import { V4PagePaginationArray } from 'cloudflaredev/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`, OverridesV4PagePaginationArray, { 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 OverridesV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Overrides) {
    Overrides.OverridesV4PagePaginationArray = OverridesAPI.OverridesV4PagePaginationArray;
})(Overrides || (Overrides = {}));
//# sourceMappingURL=overrides.mjs.map