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 { OasPathItem } from '../../openapi/models/OasPathItem';
import { DeleteNodeCommand } from './DeleteNodeCommand';
/**
 * A command used to delete an operation.
 * @author eric.wittmann@gmail.com
 * @extends DeleteNodeCommand
 * @class
 */
var DeleteOperationCommand = /** @class */ (function (_super) {
    __extends(DeleteOperationCommand, _super);
    function DeleteOperationCommand(opMethod, pathItem) {
        var _this = this;
        if (((typeof opMethod === 'string') || opMethod === null) && ((pathItem != null && pathItem instanceof OasPathItem) || pathItem === null)) {
            var __args = arguments;
            _this = _super.call(this, opMethod, pathItem) || this;
        }
        else if (opMethod === undefined && pathItem === 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 {Operation}
     */
    DeleteOperationCommand.prototype.readNode = function (doc, node) {
        var pathItem = this._parentPath.resolve(doc);
        var operation = pathItem.createOperation(this._property);
        Library.readNode(node, operation);
        return operation;
    };
    return DeleteOperationCommand;
}(DeleteNodeCommand));
export { DeleteOperationCommand };
DeleteOperationCommand["__class"] = "io.apicurio.datamodels.cmd.commands.DeleteOperationCommand";
DeleteOperationCommand["__interfaces"] = ["io.apicurio.datamodels.cmd.ICommand"];
//# sourceMappingURL=DeleteOperationCommand.js.map