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 Oas30Callback = /** @class */ (function (_super) {
    __extends(Oas30Callback, _super);
    function Oas30Callback(name) {
        var _this = _super.call(this) || this;
        _this.items = ({});
        if (_this._name === undefined)
            _this._name = null;
        if (_this.$ref === undefined)
            _this.$ref = null;
        _this._name = name;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas30Callback.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitCallback(this);
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#getName()
     * @return {string}
     */
    Oas30Callback.prototype.getName = function () {
        return this._name;
    };
    /**
     * @see io.apicurio.datamodels.core.models.common.INamed#rename(java.lang.String)
     * @param {string} newName
     */
    Oas30Callback.prototype.rename = function (newName) {
        this._name = newName;
    };
    /**
     *
     * @return {string}
     */
    Oas30Callback.prototype.getReference = function () {
        return this.$ref;
    };
    /**
     *
     * @param {string} reference
     */
    Oas30Callback.prototype.setReference = function (reference) {
        this.$ref = reference;
    };
    /**
     * Returns a single path item by name.
     * @param {string} name
     * @return {Oas30CallbackPathItem}
     */
    Oas30Callback.prototype.getPathItem = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.items, name);
    };
    /**
     * Returns an array of all the path items.
     * @return {Oas30CallbackPathItem[]}
     */
    Oas30Callback.prototype.getPathItems = 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.items));
        return rval;
    };
    /**
     * Adds a path item.
     * @param {string} name
     * @param {Oas30CallbackPathItem} pathItem
     * @return {Oas30CallbackPathItem}
     */
    Oas30Callback.prototype.addPathItem = function (name, pathItem) {
        /* put */ (this.items[name] = pathItem);
        return pathItem;
    };
    /**
     * Gets a list of all the path names.
     * @return {string[]}
     */
    Oas30Callback.prototype.getPathItemNames = function () {
        var rval = ([]);
        /* addAll */ (function (l1, l2) { return l1.push.apply(l1, l2); })(rval, /* keySet */ Object.keys(this.items));
        return rval;
    };
    /**
     * Removes a single path item child model by name.
     * @param {string} path
     * @return {Oas30CallbackPathItem}
     */
    Oas30Callback.prototype.removePathItem = function (path) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.items[path]; delete _this.items[path]; return deleted; })(this.items);
    };
    /**
     * Creates an OAS path item object.
     * @param {string} path
     * @return {Oas30CallbackPathItem}
     */
    Oas30Callback.prototype.createPathItem = function (path) {
        var rval = new Oas30CallbackPathItem(path);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.core.models.IIndexedNode#getItem(java.lang.String)
     * @param {string} name
     * @return {Oas30CallbackPathItem}
     */
    Oas30Callback.prototype.getItem = function (name) {
        return this.getPathItem(name);
    };
    /**
     * @see io.apicurio.datamodels.core.models.IIndexedNode#getItems()
     * @return {Oas30CallbackPathItem[]}
     */
    Oas30Callback.prototype.getItems = function () {
        return this.getPathItems();
    };
    /**
     * @see io.apicurio.datamodels.core.models.IIndexedNode#getItemNames()
     * @return {string[]}
     */
    Oas30Callback.prototype.getItemNames = function () {
        return this.getPathItemNames();
    };
    Oas30Callback.prototype.addItem$java_lang_String$io_apicurio_datamodels_openapi_v3_models_Oas30CallbackPathItem = function (name, item) {
        this.addPathItem(name, item);
    };
    /**
     * @see io.apicurio.datamodels.core.models.IIndexedNode#addItem(java.lang.String, io.apicurio.datamodels.core.models.Node)
     * @param {string} name
     * @param {Oas30CallbackPathItem} item
     */
    Oas30Callback.prototype.addItem = function (name, item) {
        if (((typeof name === 'string') || name === null) && ((item != null && item instanceof Oas30CallbackPathItem) || item === null)) {
            return this.addItem$java_lang_String$io_apicurio_datamodels_openapi_v3_models_Oas30CallbackPathItem(name, item);
        }
        else
            throw new Error('invalid overload');
    };
    /**
     * @see io.apicurio.datamodels.core.models.IIndexedNode#deleteItem(java.lang.String)
     * @param {string} name
     * @return {Oas30CallbackPathItem}
     */
    Oas30Callback.prototype.deleteItem = function (name) {
        return this.removePathItem(name);
    };
    return Oas30Callback;
}(ExtensibleNode));
export { Oas30Callback };
Oas30Callback["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Callback";
Oas30Callback["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.core.models.IIndexedNode", "io.apicurio.datamodels.core.models.common.INamed"];
import { Oas30CallbackPathItem } from './Oas30CallbackPathItem';
//# sourceMappingURL=Oas30Callback.js.map