// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import { isRequestOptions } from 'cloudflaredev/core';
import * as LockdownsAPI from 'cloudflaredev/resources/firewall/lockdowns';
import { V4PagePaginationArray } from 'cloudflaredev/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`, LockdownsV4PagePaginationArray, { 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 LockdownsV4PagePaginationArray extends V4PagePaginationArray {
}
(function (Lockdowns) {
    Lockdowns.LockdownsV4PagePaginationArray = LockdownsAPI.LockdownsV4PagePaginationArray;
})(Lockdowns || (Lockdowns = {}));
//# sourceMappingURL=lockdowns.mjs.map