// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as PackagesAPI from 'cloudflare/resources/firewall/waf/packages/packages';
import * as GroupsAPI from 'cloudflare/resources/firewall/waf/packages/groups';
import * as RulesAPI from 'cloudflare/resources/firewall/waf/packages/rules';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Packages extends APIResource {
    constructor() {
        super(...arguments);
        this.groups = new GroupsAPI.Groups(this._client);
        this.rules = new RulesAPI.Rules(this._client);
    }
    list(zoneIdentifier, query = {}, options) {
        if (isRequestOptions(query)) {
            return this.list(zoneIdentifier, {}, query);
        }
        return this._client.getAPIList(`/zones/${zoneIdentifier}/firewall/waf/packages`, PackageListResponsesV4PagePaginationArray, { query, ...options });
    }
    /**
     * Fetches the details of a WAF package.
     *
     * **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, identifier, options) {
        return this._client.get(`/zones/${zoneIdentifier}/firewall/waf/packages/${identifier}`, options);
    }
}
export class PackageListResponsesV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Packages) {
    Packages.PackageListResponsesV4PagePaginationArray = PackagesAPI.PackageListResponsesV4PagePaginationArray;
    Packages.Groups = GroupsAPI.Groups;
    Packages.WAFManagedRulesSchemasGroupsV4PagePaginationArray = GroupsAPI.WAFManagedRulesSchemasGroupsV4PagePaginationArray;
    Packages.Rules = RulesAPI.Rules;
    Packages.WAFManagedRulesRulesV4PagePaginationArray = RulesAPI.WAFManagedRulesRulesV4PagePaginationArray;
})(Packages || (Packages = {}));
//# sourceMappingURL=packages.mjs.map