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 { Components } from '../../../core/models/common/Components';
/**
 * Constructor.
 * @class
 * @extends Components
 * @author eric.wittmann@gmail.com
 */
var Oas30Components = /** @class */ (function (_super) {
    __extends(Oas30Components, _super);
    function Oas30Components() {
        var _this = _super.call(this) || this;
        _this.schemas = ({});
        _this.responses = ({});
        _this.parameters = ({});
        _this.examples = ({});
        _this.requestBodies = ({});
        _this.headers = ({});
        _this.securitySchemes = ({});
        _this.links = ({});
        _this.callbacks = ({});
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas30Components.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitComponents(this);
    };
    /**
     * Creates a schema definition.
     * @param {string} name
     * @return {Oas30SchemaDefinition}
     */
    Oas30Components.prototype.createSchemaDefinition = function (name) {
        var rval = new Oas30SchemaDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a schema definition.
     * @param {string} name
     * @param {Oas30SchemaDefinition} schemaDefinition
     */
    Oas30Components.prototype.addSchemaDefinition = function (name, schemaDefinition) {
        /* put */ (this.schemas[name] = schemaDefinition);
    };
    /**
     * Gets a single schema definition by name.
     * @param {string} name
     * @return {Oas30SchemaDefinition}
     */
    Oas30Components.prototype.getSchemaDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.schemas, name);
    };
    /**
     * Removes a single schema definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30SchemaDefinition}
     */
    Oas30Components.prototype.removeSchemaDefinition = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.schemas[name]; delete _this.schemas[name]; return deleted; })(this.schemas);
    };
    /**
     * Gets a list of all schema definitions.
     * @return {Oas30SchemaDefinition[]}
     */
    Oas30Components.prototype.getSchemaDefinitions = 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.schemas));
        return rval;
    };
    /**
     * Creates a response definition.
     * @param {string} name
     * @return {Oas30ResponseDefinition}
     */
    Oas30Components.prototype.createResponseDefinition = function (name) {
        var rval = new Oas30ResponseDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a response definition.
     * @param {string} name
     * @param {Oas30ResponseDefinition} responseDefinition
     */
    Oas30Components.prototype.addResponseDefinition = function (name, responseDefinition) {
        /* put */ (this.responses[name] = responseDefinition);
    };
    /**
     * Gets a single response definition by name.
     * @param {string} name
     * @return {Oas30ResponseDefinition}
     */
    Oas30Components.prototype.getResponseDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.responses, name);
    };
    /**
     * Removes a single response definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30ResponseDefinition}
     */
    Oas30Components.prototype.removeResponseDefinition = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.responses[name]; delete _this.responses[name]; return deleted; })(this.responses);
    };
    /**
     * Gets a list of all response definitions.
     * @return {Oas30ResponseDefinition[]}
     */
    Oas30Components.prototype.getResponseDefinitions = 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.responses));
        return rval;
    };
    /**
     * Creates a parameter definition.
     * @param {string} name
     * @return {Oas30ParameterDefinition}
     */
    Oas30Components.prototype.createParameterDefinition = function (name) {
        var rval = new Oas30ParameterDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a parameter definition.
     * @param {string} name
     * @param {Oas30ParameterDefinition} parameterDefinition
     */
    Oas30Components.prototype.addParameterDefinition = function (name, parameterDefinition) {
        /* put */ (this.parameters[name] = parameterDefinition);
    };
    /**
     * Gets a single parameter definition by name.
     * @param {string} name
     * @return {Oas30ParameterDefinition}
     */
    Oas30Components.prototype.getParameterDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.parameters, name);
    };
    /**
     * Removes a single parameter definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30ParameterDefinition}
     */
    Oas30Components.prototype.removeParameterDefinition = 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 parameter definitions.
     * @return {Oas30ParameterDefinition[]}
     */
    Oas30Components.prototype.getParameterDefinitions = 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 example definition.
     * @param {string} name
     * @return {Oas30ExampleDefinition}
     */
    Oas30Components.prototype.createExampleDefinition = function (name) {
        var rval = new Oas30ExampleDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a example definition.
     * @param {string} name
     * @param {Oas30ExampleDefinition} exampleDefinition
     */
    Oas30Components.prototype.addExampleDefinition = function (name, exampleDefinition) {
        /* put */ (this.examples[name] = exampleDefinition);
    };
    /**
     * Gets a single example definition by name.
     * @param {string} name
     * @return {Oas30ExampleDefinition}
     */
    Oas30Components.prototype.getExampleDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.examples, name);
    };
    /**
     * Removes a single example definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30ExampleDefinition}
     */
    Oas30Components.prototype.removeExampleDefinition = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.examples[name]; delete _this.examples[name]; return deleted; })(this.examples);
    };
    /**
     * Gets a list of all example definitions.
     * @return {Oas30ExampleDefinition[]}
     */
    Oas30Components.prototype.getExampleDefinitions = 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.examples));
        return rval;
    };
    /**
     * Creates a request body definition.
     * @param {string} name
     * @return {Oas30RequestBodyDefinition}
     */
    Oas30Components.prototype.createRequestBodyDefinition = function (name) {
        var rval = new Oas30RequestBodyDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a request body definition.
     * @param {string} name
     * @param {Oas30RequestBodyDefinition} requestBodyDefinition
     */
    Oas30Components.prototype.addRequestBodyDefinition = function (name, requestBodyDefinition) {
        /* put */ (this.requestBodies[name] = requestBodyDefinition);
    };
    /**
     * Gets a single request body definition by name.
     * @param {string} name
     * @return {Oas30RequestBodyDefinition}
     */
    Oas30Components.prototype.getRequestBodyDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.requestBodies, name);
    };
    /**
     * Removes a single request body definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30RequestBodyDefinition}
     */
    Oas30Components.prototype.removeRequestBodyDefinition = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.requestBodies[name]; delete _this.requestBodies[name]; return deleted; })(this.requestBodies);
    };
    /**
     * Gets a list of all request body definitions.
     * @return {Oas30RequestBodyDefinition[]}
     */
    Oas30Components.prototype.getRequestBodyDefinitions = 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.requestBodies));
        return rval;
    };
    /**
     * Creates a header definition.
     * @param {string} name
     * @return {Oas30HeaderDefinition}
     */
    Oas30Components.prototype.createHeaderDefinition = function (name) {
        var rval = new Oas30HeaderDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a header definition.
     * @param {string} name
     * @param {Oas30HeaderDefinition} headerDefinition
     */
    Oas30Components.prototype.addHeaderDefinition = function (name, headerDefinition) {
        /* put */ (this.headers[name] = headerDefinition);
    };
    /**
     * Gets a single header definition by name.
     * @param {string} name
     * @return {Oas30HeaderDefinition}
     */
    Oas30Components.prototype.getHeaderDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.headers, name);
    };
    /**
     * Removes a single header definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30HeaderDefinition}
     */
    Oas30Components.prototype.removeHeaderDefinition = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.headers[name]; delete _this.headers[name]; return deleted; })(this.headers);
    };
    /**
     * Gets a list of all header definitions.
     * @return {Oas30HeaderDefinition[]}
     */
    Oas30Components.prototype.getHeaderDefinitions = 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.headers));
        return rval;
    };
    /**
     * Creates a security scheme definition.
     * @param {string} name
     * @return {Oas30SecurityScheme}
     */
    Oas30Components.prototype.createSecurityScheme = function (name) {
        var rval = new Oas30SecurityScheme(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a security scheme definition.
     * @param {string} name
     * @param {Oas30SecurityScheme} securityScheme
     */
    Oas30Components.prototype.addSecurityScheme = function (name, securityScheme) {
        /* put */ (this.securitySchemes[name] = securityScheme);
    };
    /**
     * Gets a single security scheme definition by name.
     * @param {string} name
     * @return {Oas30SecurityScheme}
     */
    Oas30Components.prototype.getSecurityScheme = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.securitySchemes, name);
    };
    /**
     * Removes a single security scheme definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30SecurityScheme}
     */
    Oas30Components.prototype.removeSecurityScheme = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.securitySchemes[name]; delete _this.securitySchemes[name]; return deleted; })(this.securitySchemes);
    };
    /**
     * Gets a list of all security scheme definitions.
     * @return {Oas30SecurityScheme[]}
     */
    Oas30Components.prototype.getSecuritySchemes = 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.securitySchemes));
        return rval;
    };
    /**
     * Creates a link definition.
     * @param {string} name
     * @return {Oas30LinkDefinition}
     */
    Oas30Components.prototype.createLinkDefinition = function (name) {
        var rval = new Oas30LinkDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a link definition.
     * @param {string} name
     * @param {Oas30LinkDefinition} linkDefinition
     */
    Oas30Components.prototype.addLinkDefinition = function (name, linkDefinition) {
        /* put */ (this.links[name] = linkDefinition);
    };
    /**
     * Gets a single link definition by name.
     * @param {string} name
     * @return {Oas30LinkDefinition}
     */
    Oas30Components.prototype.getLinkDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.links, name);
    };
    /**
     * Removes a single link definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30LinkDefinition}
     */
    Oas30Components.prototype.removeLinkDefinition = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.links[name]; delete _this.links[name]; return deleted; })(this.links);
    };
    /**
     * Gets a list of all link definitions.
     * @return {Oas30LinkDefinition[]}
     */
    Oas30Components.prototype.getLinkDefinitions = 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.links));
        return rval;
    };
    /**
     * Creates a callback definition.
     * @param {string} name
     * @return {Oas30CallbackDefinition}
     */
    Oas30Components.prototype.createCallbackDefinition = function (name) {
        var rval = new Oas30CallbackDefinition(name);
        rval._ownerDocument = this._ownerDocument;
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a callback definition.
     * @param {string} name
     * @param {Oas30CallbackDefinition} callbackDefinition
     */
    Oas30Components.prototype.addCallbackDefinition = function (name, callbackDefinition) {
        /* put */ (this.callbacks[name] = callbackDefinition);
    };
    /**
     * Gets a single callback definition by name.
     * @param {string} name
     * @return {Oas30CallbackDefinition}
     */
    Oas30Components.prototype.getCallbackDefinition = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.callbacks, name);
    };
    /**
     * Removes a single callback definition and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30CallbackDefinition}
     */
    Oas30Components.prototype.removeCallbackDefinition = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.callbacks[name]; delete _this.callbacks[name]; return deleted; })(this.callbacks);
    };
    /**
     * Gets a list of all callback definitions.
     * @return {Oas30CallbackDefinition[]}
     */
    Oas30Components.prototype.getCallbackDefinitions = 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.callbacks));
        return rval;
    };
    return Oas30Components;
}(Components));
export { Oas30Components };
Oas30Components["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Components";
Oas30Components["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable"];
import { Oas30CallbackDefinition } from './Oas30CallbackDefinition';
import { Oas30LinkDefinition } from './Oas30LinkDefinition';
import { Oas30SecurityScheme } from './Oas30SecurityScheme';
import { Oas30HeaderDefinition } from './Oas30HeaderDefinition';
import { Oas30RequestBodyDefinition } from './Oas30RequestBodyDefinition';
import { Oas30ExampleDefinition } from './Oas30ExampleDefinition';
import { Oas30ParameterDefinition } from './Oas30ParameterDefinition';
import { Oas30ResponseDefinition } from './Oas30ResponseDefinition';
import { Oas30SchemaDefinition } from './Oas30SchemaDefinition';
//# sourceMappingURL=Oas30Components.js.map