// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflaredev/resource';
import * as ConsumersAPI from 'cloudflaredev/resources/queues/consumers';
import * as MessagesAPI from 'cloudflaredev/resources/queues/messages';
import { SinglePage } from 'cloudflaredev/pagination';
export class Queues extends APIResource {
    constructor() {
        super(...arguments);
        this.consumers = new ConsumersAPI.Consumers(this._client);
        this.messages = new MessagesAPI.Messages(this._client);
    }
    /**
     * Creates a new queue.
     */
    create(params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/queues`, { body: body, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates a queue.
     */
    update(queueId, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/queues/${queueId}`, {
            body: body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Returns the queues owned by an account.
     */
    list(params, options) {
        const { account_id } = params;
        return this._client.getAPIList(`/accounts/${account_id}/queues`, QueuesSinglePage, options);
    }
    /**
     * Deletes a queue.
     */
    delete(queueId, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/queues/${queueId}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Get information about a specific queue.
     */
    get(queueId, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/queues/${queueId}`, options)._thenUnwrap((obj) => obj.result);
    }
}
export class QueuesSinglePage extends SinglePage {
}
(function (Queues) {
    Queues.Consumers = ConsumersAPI.Consumers;
    Queues.Messages = MessagesAPI.Messages;
})(Queues || (Queues = {}));
//# sourceMappingURL=queues.mjs.map