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 { Node } from '../../core/models/Node';
import { AaiOperationBase } from './AaiOperationBase';
/**
 * Constructor.
 * @param {Node} parent
 * @param {string} opType
 * @class
 * @extends AaiOperationBase
 * @author eric.wittmann@gmail.com
 */
var AaiOperation = /** @class */ (function (_super) {
    __extends(AaiOperation, _super);
    function AaiOperation(parent, opType) {
        var _this = this;
        if (((parent != null && parent instanceof Node) || parent === null) && ((typeof opType === 'string') || opType === null)) {
            var __args = arguments;
            _this = _super.call(this, parent, opType) || this;
            if (_this.traits === undefined)
                _this.traits = null;
            if (_this.message === undefined)
                _this.message = null;
            if (_this.traits === undefined)
                _this.traits = null;
            if (_this.message === undefined)
                _this.message = null;
        }
        else if (((typeof parent === 'string') || parent === null) && opType === undefined) {
            var __args = arguments;
            var opType_1 = __args[0];
            _this = _super.call(this, opType_1) || this;
            if (_this.traits === undefined)
                _this.traits = null;
            if (_this.message === undefined)
                _this.message = null;
            if (_this.traits === undefined)
                _this.traits = null;
            if (_this.message === undefined)
                _this.message = null;
        }
        else if (((parent != null && parent instanceof Node) || parent === null) && opType === undefined) {
            var __args = arguments;
            _this = _super.call(this, parent) || this;
            if (_this.traits === undefined)
                _this.traits = null;
            if (_this.message === undefined)
                _this.message = null;
            if (_this.traits === undefined)
                _this.traits = null;
            if (_this.message === undefined)
                _this.message = null;
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    /**
     * Adds a tag.
     * @param tag
     * @param {AaiOperationTrait} trait
     */
    AaiOperation.prototype.addTrait = function (trait) {
        if (this.traits == null)
            this.traits = ([]);
        /* add */ (this.traits.push(trait) > 0);
    };
    return AaiOperation;
}(AaiOperationBase));
export { AaiOperation };
AaiOperation["__class"] = "io.apicurio.datamodels.asyncapi.models.AaiOperation";
AaiOperation["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
//# sourceMappingURL=AaiOperation.js.map