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