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 { Constants } from '../../../../Constants';
import { DocumentType } from '../../../../models/DocumentType';
import { OasInvalidPropertyValueRule } from './OasInvalidPropertyValueRule';
/**
 * Constructor.
 * @param {ValidationRuleMetaData} ruleInfo
 * @class
 * @extends OasInvalidPropertyValueRule
 * @author eric.wittmann@gmail.com
 */
var OasUnknownApiKeyLocationRule = /** @class */ (function (_super) {
    __extends(OasUnknownApiKeyLocationRule, _super);
    function OasUnknownApiKeyLocationRule(ruleInfo) {
        return _super.call(this, ruleInfo) || this;
    }
    /**
     * @see io.apicurio.datamodels.combined.visitors.CombinedAllNodeVisitor#visitSecurityScheme(io.apicurio.datamodels.core.models.common.SecurityScheme)
     * @param {SecurityScheme} node
     */
    OasUnknownApiKeyLocationRule.prototype.visitSecurityScheme = function (node) {
        if (this.hasValue(node.in)) {
            if (node.ownerDocument().getDocumentType() === DocumentType.openapi2) {
                this.reportIfInvalid(this.isValidEnumItem(node.in, this.array("query", "header")), node, Constants.PROP_IN, this.map("options", "query, header"));
            }
            else {
                this.reportIfInvalid(this.isValidEnumItem(node.in, this.array("query", "header", "cookie")), node, Constants.PROP_IN, this.map("options", "query, header, cookie"));
            }
        }
    };
    return OasUnknownApiKeyLocationRule;
}(OasInvalidPropertyValueRule));
export { OasUnknownApiKeyLocationRule };
OasUnknownApiKeyLocationRule["__class"] = "io.apicurio.datamodels.core.validation.rules.invalid.value.OasUnknownApiKeyLocationRule";
OasUnknownApiKeyLocationRule["__interfaces"] = ["io.apicurio.datamodels.core.visitors.IVisitor", "io.apicurio.datamodels.asyncapi.v2.visitors.IAai20Visitor", "io.apicurio.datamodels.openapi.v3.visitors.IOas30Visitor", "io.apicurio.datamodels.asyncapi.visitors.IAaiVisitor", "io.apicurio.datamodels.openapi.v2.visitors.IOas20Visitor", "io.apicurio.datamodels.openapi.visitors.IOasVisitor"];
//# sourceMappingURL=OasUnknownApiKeyLocationRule.js.map