UNPKG

ravendb

Version:
51 lines 1.53 kB
import { throwError } from "../../../Exceptions/index.js"; import { RavenCommand } from "../../../Http/RavenCommand.js"; import { RaftIdGenerator } from "../../../Utility/RaftIdGenerator.js"; export class ToggleServerWideTaskStateOperation { _name; _type; _disable; constructor(name, type, disable) { if (!name) { throwError("InvalidArgumentException", "Name cannot be null"); } this._name = name; this._type = type; this._disable = disable; } get resultType() { return "CommandResult"; } getCommand(conventions) { return new ToggleServerWideTaskStateCommand(this._name, this._type, this._disable); } } class ToggleServerWideTaskStateCommand extends RavenCommand { _name; _type; _disable; constructor(name, type, disable) { super(); if (!name) { throwError("InvalidArgumentException", "Name cannot be null"); } this._name = name; this._type = type; this._disable = disable; } get isReadRequest() { return false; } getRaftUniqueRequestId() { return RaftIdGenerator.newId(); } createRequest(node) { const uri = node.url + "/admin/configuration/server-wide/state?type=" + this._type + "&name=" + this._urlEncode(this._name) + "&disable=" + this._disable; return { uri, method: "POST" }; } } //# sourceMappingURL=ToggleServerWideTaskStateOperation.js.map