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 __());
    };
})();
import { ExtensibleNode } from '../../core/models/ExtensibleNode';
import { Node } from '../../core/models/Node';
/**
 * @author Jakub Senko <jsenko@redhat.com>
 * @param {Node} parent
 * @param {string} name
 * @class
 * @extends ExtensibleNode
 */
var AaiCorrelationId = /** @class */ (function (_super) {
    __extends(AaiCorrelationId, _super);
    function AaiCorrelationId(parent, name) {
        var _this = this;
        if (((parent != null && parent instanceof Node) || parent === null) && ((typeof name === 'string') || name === null)) {
            var __args = arguments;
            {
                var __args_1 = arguments;
                _this = _super.call(this) || this;
                if (_this._name === undefined)
                    _this._name = null;
                if (_this.$ref === undefined)
                    _this.$ref = null;
                if (_this.location === undefined)
                    _this.location = null;
                if (_this.description === undefined)
                    _this.description = null;
                if (_this._name === undefined)
                    _this._name = null;
                if (_this.$ref === undefined)
                    _this.$ref = null;
                if (_this.location === undefined)
                    _this.location = null;
                if (_this.description === undefined)
                    _this.description = null;
                (function () {
                    if (parent != null) {
                        _this._parent = parent;
                        _this._ownerDocument = parent.ownerDocument();
                    }
                })();
            }
            (function () {
                _this._name = name;
            })();
        }
        else if (((typeof parent === 'string') || parent === null) && name === undefined) {
            var __args = arguments;
            var name_1 = __args[0];
            _this = _super.call(this) || this;
            if (_this._name === undefined)
                _this._name = null;
            if (_this.$ref === undefined)
                _this.$ref = null;
            if (_this.location === undefined)
                _this.location = null;
            if (_this.description === undefined)
                _this.description = null;
            if (_this._name === undefined)
                _this._name = null;
            if (_this.$ref === undefined)
                _this.$ref = null;
            if (_this.location === undefined)
                _this.location = null;
            if (_this.description === undefined)
                _this.description = null;
            (function () {
                _this._name = name_1;
            })();
        }
        else if (((parent != null && parent instanceof Node) || parent === null) && name === undefined) {
            var __args = arguments;
            _this = _super.call(this) || this;
            if (_this._name === undefined)
                _this._name = null;
            if (_this.$ref === undefined)
                _this.$ref = null;
            if (_this.location === undefined)
                _this.location = null;
            if (_this.description === undefined)
                _this.description = null;
            if (_this._name === undefined)
                _this._name = null;
            if (_this.$ref === undefined)
                _this.$ref = null;
            if (_this.location === undefined)
                _this.location = null;
            if (_this.description === undefined)
                _this.description = null;
            (function () {
                if (parent != null) {
                    _this._parent = parent;
                    _this._ownerDocument = parent.ownerDocument();
                }
            })();
        }
        else
            throw new Error('invalid overload');
        return _this;
    }
    /**
     *
     * @param {*} visitor
     */
    AaiCorrelationId.prototype.accept = function (visitor) {
        var v = visitor;
        v.visitCorrelationId(this);
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#getName()
     * @return {string}
     */
    AaiCorrelationId.prototype.getName = function () {
        return this._name;
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#rename(java.lang.String)
     * @param {string} newName
     */
    AaiCorrelationId.prototype.rename = function (newName) {
        this._name = newName;
    };
    /**
     *
     * @return {string}
     */
    AaiCorrelationId.prototype.getReference = function () {
        return this.$ref;
    };
    /**
     *
     * @param {string} reference
     */
    AaiCorrelationId.prototype.setReference = function (reference) {
        this.$ref = reference;
    };
    return AaiCorrelationId;
}(ExtensibleNode));
export { AaiCorrelationId };
AaiCorrelationId["__class"] = "io.apicurio.datamodels.asyncapi.models.AaiCorrelationId";
AaiCorrelationId["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.INamed"];
//# sourceMappingURL=AaiCorrelationId.js.map