// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as ScriptsAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts';
export class Namespaces extends APIResource {
    constructor() {
        super(...arguments);
        this.scripts = new ScriptsAPI.Scripts(this._client);
    }
    /**
     * Create a new Workers for Platforms namespace.
     */
    create(params, options) {
        const { account_id, ...body } = params;
        return this._client.post(`/accounts/${account_id}/workers/dispatch/namespaces`, {
            body,
            ...options,
        })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetch a list of Workers for Platforms namespaces.
     */
    list(params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Delete a Workers for Platforms namespace.
     */
    delete(dispatchNamespace, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}`, options)._thenUnwrap((obj) => obj.result);
    }
    /**
     * Fetch a Workers for Platforms namespace.
     */
    get(dispatchNamespace, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}`, options)._thenUnwrap((obj) => obj.result);
    }
}
(function (Namespaces) {
    Namespaces.Scripts = ScriptsAPI.Scripts;
})(Namespaces || (Namespaces = {}));
//# sourceMappingURL=namespaces.mjs.map