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.
 * @class
 * @extends ExtensibleNode
 * @author eric.wittmann@gmail.com
 */
var Oas30RequestBody = /** @class */ (function (_super) {
    __extends(Oas30RequestBody, _super);
    function Oas30RequestBody() {
        var _this = _super.call(this) || this;
        if (_this.$ref === undefined)
            _this.$ref = null;
        if (_this.description === undefined)
            _this.description = null;
        _this.content = ({});
        if (_this.required === undefined)
            _this.required = null;
        return _this;
    }
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Oas30RequestBody.prototype.accept = function (visitor) {
        var viz = visitor;
        viz.visitRequestBody(this);
    };
    /**
     *
     * @return {string}
     */
    Oas30RequestBody.prototype.getReference = function () {
        return this.$ref;
    };
    /**
     *
     * @param {string} reference
     */
    Oas30RequestBody.prototype.setReference = function (reference) {
        this.$ref = reference;
    };
    /**
     * @see io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent#createMediaType(java.lang.String)
     * @param {string} name
     * @return {Oas30MediaType}
     */
    Oas30RequestBody.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
     */
    Oas30RequestBody.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}
     */
    Oas30RequestBody.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}
     */
    Oas30RequestBody.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[]}
     */
    Oas30RequestBody.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;
    };
    return Oas30RequestBody;
}(ExtensibleNode));
export { Oas30RequestBody };
Oas30RequestBody["__class"] = "io.apicurio.datamodels.openapi.v3.models.Oas30RequestBody";
Oas30RequestBody["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.IReferenceNode", "io.apicurio.datamodels.openapi.v3.models.IOas30MediaTypeParent"];
import { Oas30MediaType } from './Oas30MediaType';
//# sourceMappingURL=Oas30RequestBody.js.map