var JenkinsUser = /** @class */ (function () {
    function JenkinsUser() {
        this.property = new Array();
    }
    JenkinsUser.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsUser.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsUser.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        if (data.hasOwnProperty("fullName")) {
            this.fullName = data["fullName"];
        }
        if (data.hasOwnProperty("absoluteUrl")) {
            this.absoluteUrl = data["absoluteUrl"];
        }
        if (data.hasOwnProperty("description")) {
            this.description = data["description"];
        }
        if (data.hasOwnProperty("id")) {
            this.id = data["id"];
        }
        if (data.hasOwnProperty("property")) {
            this.property = data["property"];
        }
    };
    return JenkinsUser;
}());

var JenkinsNode = /** @class */ (function () {
    function JenkinsNode() {
        this.actions = new Array();
        this.executors = new Array();
        this.oneOffExecutors = new Array();
    }
    JenkinsNode.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsNode.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsNode.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("displayName")) {
            this.displayName = data["displayName"];
        }
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        if (data.hasOwnProperty("idle")) {
            this.idle = data["idle"];
        }
        if (data.hasOwnProperty("jnlpAgent")) {
            this.jnlpAgent = data["jnlpAgent"];
        }
        if (data.hasOwnProperty("icon")) {
            this.icon = data["icon"];
        }
        if (data.hasOwnProperty("iconClassName")) {
            this.iconClassName = data["iconClassName"];
        }
        if (data.hasOwnProperty("launchSupported")) {
            this.launchSupported = data["launchSupported"];
        }
        if (data.hasOwnProperty("manualLaunchAllowed")) {
            this.manualLaunchAllowed = data["manualLaunchAllowed"];
        }
        if (data.hasOwnProperty("numExecutors")) {
            this.numExecutors = data["numExecutors"];
        }
        if (data.hasOwnProperty("offline")) {
            this.offline = data["offline"];
        }
        if (data.hasOwnProperty("offlineCauseReason")) {
            this.offlineCauseReason = data["offlineCauseReason"];
        }
        if (data.hasOwnProperty("temporarilyOffline")) {
            this.temporarilyOffline = data["temporarilyOffline"];
        }
        if (data.hasOwnProperty("temporarilyOffline")) {
            this.temporarilyOffline = data["temporarilyOffline"];
        }
        if (data.hasOwnProperty("actions")) {
            this.actions = data["actions"];
        }
        if (data.hasOwnProperty("executors")) {
            this.executors = data["executors"];
        }
        if (data.hasOwnProperty("loadStatistics")) {
            this.loadStatistics = data["loadStatistics"];
        }
        if (data.hasOwnProperty("monitorData")) {
            this.monitorData = data["monitorData"];
        }
        if (data.hasOwnProperty("offlineCause")) {
            this.offlineCause = data["offlineCause"];
        }
        if (data.hasOwnProperty("oneOffExecutors")) {
            this.oneOffExecutors = data["oneOffExecutors"];
        }
    };
    return JenkinsNode;
}());

var JenkinsChangeSet = /** @class */ (function () {
    function JenkinsChangeSet() {
        this.affectedPaths = new Array();
        this.paths = new Array();
    }
    JenkinsChangeSet.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsChangeSet.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsChangeSet.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        if (data.hasOwnProperty("affectedPaths")) {
            var paths = (data["affectedPaths"]);
            for (var _i = 0, paths_1 = paths; _i < paths_1.length; _i++) {
                var affectedPath = paths_1[_i];
                this.affectedPaths.push(affectedPath);
            }
        }
        if (data.hasOwnProperty("commitId")) {
            this.commitId = data["commitId"];
        }
        if (data.hasOwnProperty("timestamp")) {
            this.timestamp = data["timestamp"];
        }
        if (data.hasOwnProperty("authorEmail")) {
            this.authorEmail = data["authorEmail"];
        }
        if (data.hasOwnProperty("comment")) {
            this.comment = data["comment"];
        }
        if (data.hasOwnProperty("date")) {
            this.date = new Date(data["date"]);
        }
        if (data.hasOwnProperty("id")) {
            this.id = data["id"];
        }
        if (data.hasOwnProperty("msg")) {
            this.msg = data["msg"];
        }
        if (data.hasOwnProperty("author")) {
            this.authorData = data["author"];
        }
        if (data.hasOwnProperty("paths")) {
            this.paths = data["paths"];
        }
    };
    return JenkinsChangeSet;
}());

var JenkinsBuild = /** @class */ (function () {
    function JenkinsBuild() {
        this.changeSets = new Array();
        this.actions = new Array();
        this.artifacts = new Array();
        this.executor = new Array();
        this.culprits = new Array();
        this.mavenArtifacts = new Array();
    }
    JenkinsBuild.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsBuild.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsBuild.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("number")) {
            this.number = data["number"];
        }
        if (data.hasOwnProperty("url")) {
            this.url = data["url"];
        }
        if (data.hasOwnProperty("displayName")) {
            this.displayName = data["displayName"];
        }
        if (data.hasOwnProperty("fullDisplayName")) {
            this.fullDisplayName = data["fullDisplayName"];
        }
        if (data.hasOwnProperty("description")) {
            this.description = data["description"];
        }
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        if (data.hasOwnProperty("building")) {
            this.building = data["building"];
        }
        if (data.hasOwnProperty("duration")) {
            this.duration = data["duration"];
        }
        if (data.hasOwnProperty("estimatedDuration")) {
            this.estimatedDuration = data["estimatedDuration"];
        }
        if (data.hasOwnProperty("id")) {
            this.id = data["id"];
        }
        if (data.hasOwnProperty("keepLog")) {
            this.keepLog = data["keepLog"];
        }
        if (data.hasOwnProperty("queueId")) {
            this.queueId = data["queueId"];
        }
        if (data.hasOwnProperty("result")) {
            this.result = data["result"];
        }
        if (data.hasOwnProperty("timestamp")) {
            this.timestamp = data["timestamp"];
            this.date = new Date(data["timestamp"]);
        }
        if (data.hasOwnProperty("builtOn")) {
            this.builtOn = data["builtOn"];
        }
        if (data.hasOwnProperty("artifacts")) {
            this.artifacts = data["artifacts"];
        }
        if (data.hasOwnProperty("executor")) {
            this.executor = data["executor"];
        }
        if (data.hasOwnProperty("culprits")) {
            this.culprits = data["culprits"];
        }
        if (data.hasOwnProperty("mavenVersionUsed")) {
            this.mavenVersionUsed = data["mavenVersionUsed"];
        }
        if (data.hasOwnProperty("mavenArtifacts")) {
            this.mavenArtifacts = data["mavenArtifacts"];
        }
    };
    return JenkinsBuild;
}());

var JenkinsJob = /** @class */ (function () {
    function JenkinsJob() {
        this.builds = new Array();
        this.downstreamProjects = new Array();
        this.upstreamProjects = new Array();
        this.actions = new Array();
        this.healthReport = new Array();
        this.property = new Array();
        this.modules = new Array();
    }
    JenkinsJob.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsJob.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsJob.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("name")) {
            this.name = data["name"];
        }
        if (data.hasOwnProperty("url")) {
            this.url = data["url"];
        }
        if (data.hasOwnProperty("displayName")) {
            this.displayName = data["displayName"];
        }
        if (data.hasOwnProperty("fullDisplayName")) {
            this.fullDisplayName = data["fullDisplayName"];
        }
        if (data.hasOwnProperty("description")) {
            this.description = data["description"];
        }
        if (data.hasOwnProperty("color")) {
            this.color = data["color"];
        }
        if (data.hasOwnProperty("buildable")) {
            this.buildable = data["buildable"];
        }
        if (data.hasOwnProperty("inQueue")) {
            this.inQueue = data["inQueue"];
        }
        if (data.hasOwnProperty("keepDependencies")) {
            this.keepDependencies = data["keepDependencies"];
        }
        if (data.hasOwnProperty("nextBuildNumber")) {
            this.nextBuildNumber = data["nextBuildNumber"];
        }
        if (data.hasOwnProperty("concurrentBuild")) {
            this.concurrentBuild = data["concurrentBuild"];
        }
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        if (data.hasOwnProperty("displayNameOrNull")) {
            this.displayNameOrNull = data["displayNameOrNull"];
        }
        if (data.hasOwnProperty("fullName")) {
            this.fullName = data["fullName"];
        }
        if (data.hasOwnProperty("actions")) {
            this.actions = data["actions"];
        }
        if (data.hasOwnProperty("healthReport")) {
            this.healthReport = data["healthReport"];
        }
        if (data.hasOwnProperty("property")) {
            this.property = data["property"];
        }
        if (data.hasOwnProperty("queueItem")) {
            this.queueItem = data["queueItem"];
        }
        if (data.hasOwnProperty("scm")) {
            this.scm = data["scm"];
        }
        if (data.hasOwnProperty("modules")) {
            this.modules = data["modules"];
        }
    };
    return JenkinsJob;
}());

var JenkinsView = /** @class */ (function () {
    function JenkinsView() {
        this.jobs = new Array();
        this.property = new Array();
    }
    JenkinsView.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsView.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsView.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("name")) {
            this.name = data["name"];
        }
        if (data.hasOwnProperty("url")) {
            this.url = data["url"];
        }
        if (data.hasOwnProperty("description")) {
            this.description = data["description"];
        }
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        if (data.hasOwnProperty("property")) {
            this.property = data["property"];
        }
    };
    return JenkinsView;
}());

var JenkinsHealthReport = /** @class */ (function () {
    function JenkinsHealthReport() {
    }
    JenkinsHealthReport.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsHealthReport.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsHealthReport.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        if (data.hasOwnProperty("description")) {
            this.description = data["description"];
        }
        if (data.hasOwnProperty("iconClassName")) {
            this.iconClassName = data["iconClassName"];
        }
        if (data.hasOwnProperty("iconUrl")) {
            this.iconUrl = data["iconUrl"];
        }
        if (data.hasOwnProperty("score")) {
            this.score = data["score"];
        }
    };
    return JenkinsHealthReport;
}());

var JenkinsAction = /** @class */ (function () {
    function JenkinsAction() {
        this.timeInQueueClassName = "jenkins.metrics.impl.TimeInQueueAction";
        this.data = new Map();
    }
    JenkinsAction.prototype.getJsonData = function () {
        return JSON.stringify(this.jsonData);
    };
    JenkinsAction.prototype.isClass = function (className) {
        if (!this._class) {
            return false;
        }
        if (!className) {
            return false;
        }
        return this._class.toLowerCase().trim() === className.toLowerCase().trim();
    };
    JenkinsAction.prototype.isTimeInQueueActionClass = function () {
        return this.isClass(this.timeInQueueClassName);
    };
    JenkinsAction.prototype.has = function (keyName) {
        if (!keyName) {
            return false;
        }
        return this.data.has(keyName);
    };
    JenkinsAction.prototype.get = function (keyName) {
        if (!keyName) {
            return undefined;
        }
        return this.data.get(keyName);
    };
    JenkinsAction.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsAction.prototype.fromJson = function (data) {
        this.jsonData = data;
        if (data.hasOwnProperty("_class")) {
            this._class = data["_class"];
        }
        var objectData = new Map();
        Object.keys(data).filter(function (key) { return key !== "_class"; }).forEach(function (key) {
            objectData.set(key, data[key]);
        });
        this.data = objectData;
    };
    return JenkinsAction;
}());

var __extends = (undefined && undefined.__extends) || (function () {
    var 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 function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var JenkinsTimeInQueueAction = /** @class */ (function (_super) {
    __extends(JenkinsTimeInQueueAction, _super);
    function JenkinsTimeInQueueAction() {
        var _this = _super.call(this) || this;
        _this.queuingDurationMillis = 0;
        _this.totalDurationMillis = 0;
        return _this;
    }
    JenkinsTimeInQueueAction.prototype.isTimeInQueueActionClass = function () {
        return true;
    };
    JenkinsTimeInQueueAction.prototype.getQueuingDurationMillis = function () {
        return this.queuingDurationMillis;
    };
    JenkinsTimeInQueueAction.prototype.getTotalDurationMillis = function () {
        return this.totalDurationMillis;
    };
    JenkinsTimeInQueueAction.prototype.fromJsonString = function (json) {
        var data = JSON.parse(json);
        this.jsonData = data;
        this.fromJson(data);
    };
    JenkinsTimeInQueueAction.prototype.fromJson = function (data) {
        _super.prototype.fromJson.call(this, data);
        if (data.hasOwnProperty("queuingDurationMillis")) {
            this.queuingDurationMillis = (data["queuingDurationMillis"]);
        }
        if (data.hasOwnProperty("totalDurationMillis")) {
            this.totalDurationMillis = (data["totalDurationMillis"]);
        }
    };
    return JenkinsTimeInQueueAction;
}(JenkinsAction));

var JenkinsBuildStatus = {
    Aborted: 'ABORTED',
    Failure: 'FAILURE',
    Unstable: 'UNSTABLE',
    Success: 'SUCCESS',
};

export { JenkinsUser, JenkinsNode, JenkinsChangeSet, JenkinsBuild, JenkinsJob, JenkinsView, JenkinsHealthReport, JenkinsAction, JenkinsTimeInQueueAction, JenkinsBuildStatus };
//# sourceMappingURL=jenkins-api-ts-typings.es5.js.map
