UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

56 lines 2.37 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. 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`, DNSFirewallsV4PagePaginationArray, { 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 DNSFirewallsV4PagePaginationArray extends V4PagePaginationArray { } (function (Firewall) { Firewall.DNSFirewallsV4PagePaginationArray = FirewallAPI.DNSFirewallsV4PagePaginationArray; Firewall.Analytics = AnalyticsAPI.Analytics; })(Firewall || (Firewall = {})); //# sourceMappingURL=firewall.mjs.map