// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as ContentAPI from 'cloudflare/resources/workers-for-platforms/dispatch/namespaces/scripts/content/content';
import { maybeMultipartFormRequestOptions } from 'cloudflare/core';
export class Scripts extends APIResource {
    constructor() {
        super(...arguments);
        this.content = new ContentAPI.Content(this._client);
    }
    /**
     * Upload a worker module to a Workers for Platforms namespace.
     */
    update(dispatchNamespace, scriptName, params, options) {
        const { account_id, ...body } = params;
        return this._client.put(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, maybeMultipartFormRequestOptions({ body, ...options }))._thenUnwrap((obj) => obj.result);
    }
    /**
     * Delete a worker from a Workers for Platforms namespace. This call has no
     * response body on a successful delete.
     */
    delete(dispatchNamespace, scriptName, params, options) {
        const { account_id, force } = params;
        return this._client.delete(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, { query: { force }, ...options, headers: { Accept: '*/*', ...options?.headers } });
    }
    /**
     * Fetch information about a script uploaded to a Workers for Platforms namespace.
     */
    get(dispatchNamespace, scriptName, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, options)._thenUnwrap((obj) => obj.result);
    }
}
(function (Scripts) {
    Scripts.Content = ContentAPI.Content;
})(Scripts || (Scripts = {}));
//# sourceMappingURL=scripts.mjs.map