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 { ExtensibleNode } from '../../../core/models/ExtensibleNode';
/**
 * Constructor.
 * @param {string} name
 * @class
 * @extends ExtensibleNode
 * @author eric.wittmann@gmail.com
 */
var Oas30Link = /** @class */ (function (_super) {
    __extends(Oas30Link, _super);
    function Oas30Link(name) {
        var _this = _super.call(this) || this;
        if (_this._name === undefined)
            _this._name = null;
        if (_this.$ref === undefined)
            _this.$ref = null;
        if (_this.operationRef === undefined)
            _this.operationRef = null;
        if (_this.operationId === undefined)
            _this.operationId = null;
        _this.parameters = ({});
        if (_this.requestBody === undefined)
            _this.requestBody = null;
        if (_this.description === undefined)
            _this.description = null;
        if (_this.server === undefined)
            _this.server = null;
        _this._name = name;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas30Link.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitLink(this);
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#getName()
     * @return {string}
     */
    Oas30Link.prototype.getName = function () {
        return this._name;
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#rename(java.lang.String)
     * @param {string} newName
     */
    Oas30Link.prototype.rename = function (newName) {
        this._name = newName;
    };
    /**
     *
     * @return {string}
     */
    Oas30Link.prototype.getReference = function () {
        return this.$ref;
    };
    /**
     *
     * @param {string} reference
     */
    Oas30Link.prototype.setReference = function (reference) {
        this.$ref = reference;
    };
    /**
     * Creates a link parameter expression.
     * @param {string} name
     * @param {string} value
     * @return {Oas30LinkParameterExpression}
     */
    Oas30Link.prototype.createLinkParameterExpression = function (name, value) {
        var rval = new Oas30LinkParameterExpression(name, value);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a link parameter expression.
     * @param {string} name
     * @param {Oas30LinkParameterExpression} expression
     */
    Oas30Link.prototype.addLinkParameterExpression = function (name, expression) {
        /* put */ (this.parameters[name] = expression);
    };
    /**
     * Adds a link parameter expression.
     * @param {string} name
     * @param {string} expression
     * @return {Oas30LinkParameterExpression}
     */
    Oas30Link.prototype.addLinkParameter = function (name, expression) {
        var model = this.createLinkParameterExpression(name, expression);
        this.addLinkParameterExpression(name, model);
        return model;
    };
    /**
     * Gets a single link parameter expression by name.
     * @param {string} name
     * @return {Oas30LinkParameterExpression}
     */
    Oas30Link.prototype.getLinkParameterExpression = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.parameters, name);
    };
    /**
     * Removes a single link parameter expression and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30LinkParameterExpression}
     */
    Oas30Link.prototype.removeLinkParameterExpression = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.parameters[name]; delete _this.parameters[name]; return deleted; })(this.parameters);
    };
    /**
     * Gets a list of all link parameter expressions.
     * @return {Oas30LinkParameterExpression[]}
     */
    Oas30Link.prototype.getLinkParameterExpressions = function () {
        var rval = ([]);
        /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(rval, /* values */ (function (obj) { return Object.keys(obj).map(function (key) { return obj[key]; }); })(this.parameters));
        return rval;
    };
    /**
     * Creates a link request body expression.
     * @param {string} value
     * @return {Oas30LinkRequestBodyExpression}
     */
    Oas30Link.prototype.createLinkRequestBodyExpression = function (value) {
        var rval = new Oas30LinkRequestBodyExpression(value);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Creates an OAS 3.0 Server object.
     * @return {Oas30LinkServer}
     */
    Oas30Link.prototype.createServer = function () {
        var rval = new Oas30LinkServer();
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    return Oas30Link;
}(ExtensibleNode));
export { Oas30Link };
Oas30Link["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Link";
Oas30Link["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.common.INamed"];
import { Oas30LinkServer } from './Oas30LinkServer';
import { Oas30LinkRequestBodyExpression } from './Oas30LinkRequestBodyExpression';
import { Oas30LinkParameterExpression } from './Oas30LinkParameterExpression';
//# sourceMappingURL=Oas30Link.js.map