var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
/* Generated from Java with JSweet 2.3.7 - http://www.jsweet.org */
import { Library } from '../../Library';
import { Constants } from '../../core/Constants';
import { Oas30Operation } from '../../openapi/v3/models/Oas30Operation';
import { DeleteNodeCommand } from './DeleteNodeCommand';
/**
 * A command used to delete an operation.
 *
 * @author eric.wittmann@gmail.com
 * @extends DeleteNodeCommand
 * @class
 */
var DeleteRequestBodyCommand = /** @class */ (function (_super) {
    __extends(DeleteRequestBodyCommand, _super);
    function DeleteRequestBodyCommand(operation) {
        var _this = this;
        if (((operation != null && operation instanceof Oas30Operation) || operation === null)) {
            var __args = arguments;
            _this = _super.call(this, Constants.PROP_REQUEST_BODY, operation) || this;
        }
        else if (operation === undefined) {
            var __args = arguments;
            _this = _super.call(this) || this;
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.cmd.commands.DeleteNodeCommand#readNode(io.apicurio.datamodels.core.models.Document,
     * java.lang.Object)
     * @param {Document} doc
     * @param {*} node
     * @return {Oas30RequestBody}
     */
    DeleteRequestBodyCommand.prototype.readNode = function (doc, node) {
        var operation = this._parentPath.resolve(doc);
        var requestBody = operation.createRequestBody();
        Library.readNode(node, requestBody);
        return requestBody;
    };
    return DeleteRequestBodyCommand;
}(DeleteNodeCommand));
export { DeleteRequestBodyCommand };
DeleteRequestBodyCommand["__class"] = "io.apicurio.datamodels.cmd.commands.DeleteRequestBodyCommand";
DeleteRequestBodyCommand["__interfaces"] = ["io.apicurio.datamodels.cmd.ICommand"];
//# sourceMappingURL=DeleteRequestBodyCommand.js.map