// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import { isRequestOptions } from 'cloudflare/core';
import * as LockdownsAPI from 'cloudflare/resources/firewall/lockdowns';
import { V4PagePaginationArray } from 'cloudflare/pagination';
export class Lockdowns extends APIResource {
    /**
     * Creates a new Zone Lockdown rule.
     */
    create(zoneIdentifier, body, options) {
        return this._client.post(`/zones/${zoneIdentifier}/firewall/lockdowns`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates an existing Zone Lockdown rule.
     */
    update(zoneIdentifier, id, body, options) {
        return this._client.put(`/zones/${zoneIdentifier}/firewall/lockdowns/${id}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    list(zoneIdentifier, query = {}, options) {
        if (isRequestOptions(query)) {
            return this.list(zoneIdentifier, {}, query);
        }
        return this._client.getAPIList(`/zones/${zoneIdentifier}/firewall/lockdowns`, LegacyJhsZonelockdownsV4PagePaginationArray, { query, ...options });
    }
    /**
     * Deletes an existing Zone Lockdown rule.
     */
    delete(zoneIdentifier, id, options) {
        return this._client.delete(`/zones/${zoneIdentifier}/firewall/lockdowns/${id}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetches the details of a Zone Lockdown rule.
     */
    get(zoneIdentifier, id, options) {
        return this._client.get(`/zones/${zoneIdentifier}/firewall/lockdowns/${id}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class LegacyJhsZonelockdownsV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Lockdowns) {
    Lockdowns.LegacyJhsZonelockdownsV4PagePaginationArray = LockdownsAPI.LegacyJhsZonelockdownsV4PagePaginationArray;
})(Lockdowns || (Lockdowns = {}));
//# sourceMappingURL=lockdowns.mjs.map