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 '../ExtensibleNode';
/**
 * Constructor.
 * @param {string} opType
 * @class
 * @extends ExtensibleNode
 * @author eric.wittmann@gmail.com
 */
var Operation = /** @class */ (function (_super) {
    __extends(Operation, _super);
    function Operation(opType) {
        var _this = _super.call(this) || this;
        if (_this._type === undefined)
            _this._type = null;
        if (_this.operationId === undefined)
            _this.operationId = null;
        if (_this.summary === undefined)
            _this.summary = null;
        if (_this.description === undefined)
            _this.description = null;
        if (_this.externalDocs === undefined)
            _this.externalDocs = null;
        _this._type = opType;
        return _this;
    }
    /**
     * Gets the operation type.
     * @return {string}
     */
    Operation.prototype.getType = function () {
        return this._type;
    };
    /**
     * @see io.apicurio.datamodels.core.models.Node#accept(io.apicurio.datamodels.core.visitors.IVisitor)
     * @param {*} visitor
     */
    Operation.prototype.accept = function (visitor) {
        visitor.visitOperation(this);
    };
    Operation.prototype.setExternalDocumentation$io_apicurio_datamodels_core_models_common_ExternalDocumentation = function (externalDocs) {
        this.externalDocs = externalDocs;
    };
    Operation.prototype.setExternalDocumentation$java_lang_String$java_lang_String = function (description, url) {
        var ed = this.createExternalDocumentation();
        ed.description = description;
        ed.url = url;
        this.externalDocs = ed;
        return ed;
    };
    /**
     * Sets the external documentation information.
     * @param {string} description
     * @param {string} url
     * @return {ExternalDocumentation}
     */
    Operation.prototype.setExternalDocumentation = function (description, url) {
        if (((typeof description === 'string') || description === null) && ((typeof url === 'string') || url === null)) {
            return this.setExternalDocumentation$java_lang_String$java_lang_String(description, url);
        }
        else if (((description != null && description instanceof ExternalDocumentation) || description === null) && url === undefined) {
            return this.setExternalDocumentation$io_apicurio_datamodels_core_models_common_ExternalDocumentation(description);
        }
        else
            throw new Error('invalid overload');
    };
    return Operation;
}(ExtensibleNode));
export { Operation };
Operation["__class"] = "io.apicurio.datamodels.core.models.common.Operation";
Operation["__interfaces"] = ["io.apicurio.datamodels.core.models.IVisitable", "io.apicurio.datamodels.core.models.common.IExternalDocumentationParent"];
import { ExternalDocumentation } from './ExternalDocumentation';
//# sourceMappingURL=Operation.js.map