UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

53 lines 2.14 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'cloudflare/resource'; import * as RulesAPI from 'cloudflare/resources/waiting-rooms/rules'; import { SinglePage } from 'cloudflare/pagination'; export class Rules extends APIResource { /** * Only available for the Waiting Room Advanced subscription. Creates a rule for a * waiting room. */ create(zoneIdentifier, waitingRoomId, body, options) { return this._client.post(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Only available for the Waiting Room Advanced subscription. Replaces all rules * for a waiting room. */ update(zoneIdentifier, waitingRoomId, body, options) { return this._client.put(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules`, { body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Lists rules for a waiting room. */ list(zoneIdentifier, waitingRoomId, options) { return this._client.getAPIList(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules`, WaitingroomRulesSinglePage, options); } /** * Deletes a rule for a waiting room. */ delete(zoneIdentifier, waitingRoomId, ruleId, options) { return this._client.delete(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules/${ruleId}`, options)._thenUnwrap((obj) => obj.result); } /** * Patches a rule for a waiting room. */ edit(zoneIdentifier, waitingRoomId, ruleId, body, options) { return this._client.patch(`/zones/${zoneIdentifier}/waiting_rooms/${waitingRoomId}/rules/${ruleId}`, { body, ...options, })._thenUnwrap((obj) => obj.result); } } export class WaitingroomRulesSinglePage extends SinglePage { } (function (Rules) { Rules.WaitingroomRulesSinglePage = RulesAPI.WaitingroomRulesSinglePage; })(Rules || (Rules = {})); //# sourceMappingURL=rules.mjs.map