// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as ListsAPI from 'cloudflaredev/resources/zero-trust/gateway/lists/lists';
import * as ItemsAPI from 'cloudflaredev/resources/zero-trust/gateway/lists/items';
import { SinglePage } from 'cloudflaredev/pagination';
export class Lists extends APIResource {
    constructor() {
        super(...arguments);
        this.items = new ItemsAPI.Items(this._client);
    }
    /**
     * Creates a new Zero Trust list.
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/gateway/lists`, { body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates a configured Zero Trust list.
     */
    update(listId, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/gateway/lists/${listId}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetches all Zero Trust lists for an account.
     */
    list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/gateway/lists`, GatewayListsSinglePage, options);
    }
    /**
     * Deletes a Zero Trust list.
     */
    delete(listId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/gateway/lists/${listId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Appends or removes an item from a configured Zero Trust list.
     */
    edit(listId, params, options) {
        const { account_id, ...body } = params;
        return this._client.patch(`/accounts/${account_id}/gateway/lists/${listId}`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetches a single Zero Trust list.
     */
    get(listId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/gateway/lists/${listId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class GatewayListsSinglePage extends SinglePage {
}
(function (Lists) {
    Lists.GatewayListsSinglePage = ListsAPI.GatewayListsSinglePage;
    Lists.Items = ItemsAPI.Items;
    Lists.ItemListResponsesSinglePage = ItemsAPI.ItemListResponsesSinglePage;
})(Lists || (Lists = {}));
//# sourceMappingURL=lists.mjs.map