UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

62 lines 2.49 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 FirewallResource 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`, FirewallsV4PagePaginationArray, { query, ...options, }); } /** * Delete a configured DNS Firewall Cluster. */ delete(dnsFirewallId, params, options) { const { account_id, body } = params; return this._client.delete(`/accounts/${account_id}/dns_firewall/${dnsFirewallId}`, { body: body, ...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 FirewallsV4PagePaginationArray extends V4PagePaginationArray { } (function (FirewallResource) { FirewallResource.FirewallsV4PagePaginationArray = FirewallAPI.FirewallsV4PagePaginationArray; FirewallResource.Analytics = AnalyticsAPI.Analytics; })(FirewallResource || (FirewallResource = {})); //# sourceMappingURL=firewall.mjs.map