"use strict";
// File generated from our OpenAPI spec by Stainless.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Consumers = void 0;
const resource_1 = require("cloudflare/resource");
class Consumers extends resource_1.APIResource {
    /**
     * Creates a new consumer for a queue.
     */
    create(name, params, options) {
        const { account_id, body } = params;
        return this._client.post(`/accounts/${account_id}/workers/queues/${name}/consumers`, {
            body: body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Updates the consumer for a queue, or creates one if it does not exist.
     */
    update(name, consumerName, params, options) {
        const { account_id, body } = params;
        return this._client.put(`/accounts/${account_id}/workers/queues/${name}/consumers/${consumerName}`, {
            body: body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Deletes the consumer for a queue.
     */
    delete(name, consumerName, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/queues/${name}/consumers/${consumerName}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Returns the consumers for a queue.
     */
    get(name, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/queues/${name}/consumers`, options)._thenUnwrap((obj) => obj.result);
    }
}
exports.Consumers = Consumers;
(function (Consumers) {
})(Consumers = exports.Consumers || (exports.Consumers = {}));
//# sourceMappingURL=consumers.js.map