@atomist/cortex
Version:
Atomist Cortex model TypeScript typings
220 lines (219 loc) • 6.97 kB
JavaScript
"use strict";
/*
* Copyright 2015-2017 Atomist Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Type Push
* Generated class exposing Atomist Cortex.
* Fluent builder style class for use in testing and query by example.
*/
var Push = (function () {
function Push() {
this._nodeName = "Push";
this._nodeTags = ["Push", "-dynamic"];
}
/**
* Implementation of GraphNode interface method.
* For infrastructure, not user use
*/
Push.prototype.nodeName = function () {
return this._nodeName;
};
/**
* Implementation of GraphNode interface method.
* For infrastructure, not user use
*/
Push.prototype.nodeTags = function () {
return this._nodeTags;
};
Object.defineProperty(Push.prototype, "after", {
/**
* after - Push -> Commit
*
* @property {Commit} after
*/
get: function () {
if (this._after === undefined) {
throw new Error("Please use the relevant builder method to set property [after] on stub " +
"[Push] before accessing it. It's probably called [withAfter]");
}
return this._after;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the after property
*/
Push.prototype.withAfter = function (after_) {
this._after = after_;
return this;
};
Object.defineProperty(Push.prototype, "before", {
/**
* before - Push -> Commit
*
* @property {Commit} before
*/
get: function () {
if (this._before === undefined) {
throw new Error("Please use the relevant builder method to set property [before] on stub " +
"[Push] before accessing it. It's probably called [withBefore]");
}
return this._before;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the before property
*/
Push.prototype.withBefore = function (before_) {
this._before = before_;
return this;
};
Object.defineProperty(Push.prototype, "branch", {
/**
* branch
*
* @property {string} branch
*/
get: function () {
if (this._branch === undefined) {
throw new Error("Please use the relevant builder method to set property [branch] on stub " +
"[Push] before accessing it. It's probably called [withBranch]");
}
return this._branch;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the branch property
*/
Push.prototype.withBranch = function (branch_) {
this._branch = branch_;
return this;
};
Object.defineProperty(Push.prototype, "builds", {
/**
* builds - Push -> Build
*
* @property {Build[]} builds
*/
get: function () {
if (this._builds === undefined) {
throw new Error("Please use the relevant builder method to set property [builds] on stub " +
"[Push] before accessing it. It's probably called [withBuilds]");
}
return this._builds;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to add an element to the builds array
*/
Push.prototype.addBuilds = function () {
var builds_ = [];
for (var _i = 0; _i < arguments.length; _i++) {
builds_[_i] = arguments[_i];
}
if (this._builds === undefined) {
this._builds = [];
}
this._builds = this._builds.concat(builds_);
return this;
};
Object.defineProperty(Push.prototype, "commits", {
/**
* commits - Push -> Commit
*
* @property {Commit[]} commits
*/
get: function () {
if (this._commits === undefined) {
throw new Error("Please use the relevant builder method to set property [commits] on stub " +
"[Push] before accessing it. It's probably called [withCommits]");
}
return this._commits;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to add an element to the commits array
*/
Push.prototype.addCommits = function () {
var commits_ = [];
for (var _i = 0; _i < arguments.length; _i++) {
commits_[_i] = arguments[_i];
}
if (this._commits === undefined) {
this._commits = [];
}
this._commits = this._commits.concat(commits_);
return this;
};
Object.defineProperty(Push.prototype, "repo", {
/**
* repo - Push -> Repo
*
* @property {Repo} repo
*/
get: function () {
if (this._repo === undefined) {
throw new Error("Please use the relevant builder method to set property [repo] on stub " +
"[Push] before accessing it. It's probably called [withRepo]");
}
return this._repo;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the repo property
*/
Push.prototype.withRepo = function (repo_) {
this._repo = repo_;
return this;
};
Object.defineProperty(Push.prototype, "timestamp", {
/**
* timestamp
*
* @property {string} timestamp
*/
get: function () {
if (this._timestamp === undefined) {
throw new Error("Please use the relevant builder method to set property [timestamp] on stub " +
"[Push] before accessing it. It's probably called [withTimestamp]");
}
return this._timestamp;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the timestamp property
*/
Push.prototype.withTimestamp = function (timestamp_) {
this._timestamp = timestamp_;
return this;
};
return Push;
}());
exports.Push = Push;