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 { OasResponse } from '../../models/OasResponse';
/**
 * Constructor.
 * @param {string} statusCode
 * @class
 * @extends OasResponse
 * @author eric.wittmann@gmail.com
 */
var Oas30Response = /** @class */ (function (_super) {
    __extends(Oas30Response, _super);
    function Oas30Response(statusCode) {
        var _this = _super.call(this, statusCode) || this;
        _this.headers = ({});
        _this.content = ({});
        _this.links = ({});
        return _this;
    }
    /**
     * Gets the status code.
     * @return {string}
     */
    Oas30Response.prototype.getStatusCode = function () {
        return this.getName();
    };
    /**
     * Creates a header.
     * @param {string} name
     * @return {Oas30Header}
     */
    Oas30Response.prototype.createHeader = function (name) {
        var rval = new Oas30Header(name);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a header.
     * @param {string} name
     * @param {Oas30Header} header
     */
    Oas30Response.prototype.addHeader = function (name, header) {
        /* put */ (this.headers[name] = header);
    };
    /**
     * Gets a single header by name.
     * @param {string} name
     * @return {Oas30Header}
     */
    Oas30Response.prototype.getHeader = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.headers, name);
    };
    /**
     * Removes a single header and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30Header}
     */
    Oas30Response.prototype.removeHeader = 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 headers.
     * @return {Oas30Header[]}
     */
    Oas30Response.prototype.getHeaders = 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;
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent#createMediaType(java.lang.String)
     * @param {string} name
     * @return {Oas30MediaType}
     */
    Oas30Response.prototype.createMediaType = function (name) {
        var rval = new Oas30MediaType(name);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent#addMediaType(java.lang.String, io.apicurio.datamodels.openapi.v3.models.Oas30MediaType)
     * @param {string} name
     * @param {Oas30MediaType} mediaType
     */
    Oas30Response.prototype.addMediaType = function (name, mediaType) {
        /* put */ (this.content[name] = mediaType);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent#getMediaType(java.lang.String)
     * @param {string} name
     * @return {Oas30MediaType}
     */
    Oas30Response.prototype.getMediaType = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.content, name);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent#removeMediaType(java.lang.String)
     * @param {string} name
     * @return {Oas30MediaType}
     */
    Oas30Response.prototype.removeMediaType = function (name) {
        var _this = this;
        return /* remove */ (function (map) { var deleted = _this.content[name]; delete _this.content[name]; return deleted; })(this.content);
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent#getMediaTypes()
     * @return {Oas30MediaType[]}
     */
    Oas30Response.prototype.getMediaTypes = 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.content));
        return rval;
    };
    /**
     * Creates a link.
     * @param {string} name
     * @return {Oas30Link}
     */
    Oas30Response.prototype.createLink = function (name) {
        var rval = new Oas30Link(name);
        rval._ownerDocument = this.ownerDocument();
        rval._parent = this;
        return rval;
    };
    /**
     * Adds a link.
     * @param {string} name
     * @param {Oas30Link} link
     */
    Oas30Response.prototype.addLink = function (name, link) {
        /* put */ (this.links[name] = link);
    };
    /**
     * Gets a single link by name.
     * @param {string} name
     * @return {Oas30Link}
     */
    Oas30Response.prototype.getLink = function (name) {
        return /* get */ (function (m, k) { return m[k] === undefined ? null : m[k]; })(this.links, name);
    };
    /**
     * Removes a single link and returns it.  This may return null or undefined if none found.
     * @param {string} name
     * @return {Oas30Link}
     */
    Oas30Response.prototype.removeLink = 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 links.
     * @return {Oas30Link[]}
     */
    Oas30Response.prototype.getLinks = 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;
    };
    return Oas30Response;
}(OasResponse));
export { Oas30Response };
Oas30Response["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30Response";
Oas30Response["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent", "io.apicurio.datamodels.core.models.common.INamed"];
import { Oas30Link } from './Oas30Link';
import { Oas30MediaType } from './Oas30MediaType';
import { Oas30Header } from './Oas30Header';
//# sourceMappingURL=Oas30Response.js.map