// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as FirewallAPI from 'cloudflare/resources/dns/firewall/firewall';
import * as AnalyticsAPI from 'cloudflare/resources/dns/firewall/analytics/analytics';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Firewall extends APIResource {
    constructor() {
        super(...arguments);
        this.analytics = new AnalyticsAPI.Analytics(this._client);
    }
    /**
     * Create a configured DNS Firewall Cluster.
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/dns_firewall`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * List configured DNS Firewall clusters for an account.
     */
    list(params, options) {
        const { account_id, ...query } = params;
        return this._client.getAPIList(`/accounts/${account_id}/dns_firewall`, DNSFirewallDNSFirewallsV4PagePaginationArray, { query, ...options });
    }
    /**
     * Delete a configured DNS Firewall Cluster.
     */
    delete(dnsFirewallId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Modify a DNS Firewall Cluster configuration.
     */
    edit(dnsFirewallId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Show a single configured DNS Firewall cluster for an account.
     */
    get(dnsFirewallId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class DNSFirewallDNSFirewallsV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Firewall) {
    Firewall.DNSFirewallDNSFirewallsV4PagePaginationArray = FirewallAPI.DNSFirewallDNSFirewallsV4PagePaginationArray;
    Firewall.Analytics = AnalyticsAPI.Analytics;
})(Firewall || (Firewall = {}));
//# sourceMappingURL=firewall.mjs.map