@atomist/cortex
Version:
Atomist Cortex model TypeScript typings
213 lines (212 loc) • 6.8 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 Branch
* Generated class exposing Atomist Cortex.
* Fluent builder style class for use in testing and query by example.
*/
var Branch = (function () {
function Branch() {
this._nodeName = "Branch";
this._nodeTags = ["Branch", "-dynamic"];
}
/**
* Implementation of GraphNode interface method.
* For infrastructure, not user use
*/
Branch.prototype.nodeName = function () {
return this._nodeName;
};
/**
* Implementation of GraphNode interface method.
* For infrastructure, not user use
*/
Branch.prototype.nodeTags = function () {
return this._nodeTags;
};
Object.defineProperty(Branch.prototype, "commit", {
/**
* commit - Branch -> Commit
*
* @property {Commit} commit
*/
get: function () {
if (this._commit === undefined) {
throw new Error("Please use the relevant builder method to set property [commit] on stub " +
"[Branch] before accessing it. It's probably called [withCommit]");
}
return this._commit;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the commit property
*/
Branch.prototype.withCommit = function (commit_) {
this._commit = commit_;
return this;
};
Object.defineProperty(Branch.prototype, "deleted", {
/**
* deleted
*
* @property {boolean} deleted
*/
get: function () {
if (this._deleted === undefined) {
throw new Error("Please use the relevant builder method to set property [deleted] on stub " +
"[Branch] before accessing it. It's probably called [withDeleted]");
}
return this._deleted;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the deleted property
*/
Branch.prototype.withDeleted = function (deleted_) {
this._deleted = deleted_;
return this;
};
Object.defineProperty(Branch.prototype, "id", {
/**
* id
*
* @property {string} id
*/
get: function () {
if (this._id === undefined) {
throw new Error("Please use the relevant builder method to set property [id] on stub " +
"[Branch] before accessing it. It's probably called [withId]");
}
return this._id;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the id property
*/
Branch.prototype.withId = function (id_) {
this._id = id_;
return this;
};
Object.defineProperty(Branch.prototype, "name", {
/**
* name
*
* @property {string} name
*/
get: function () {
if (this._name === undefined) {
throw new Error("Please use the relevant builder method to set property [name] on stub " +
"[Branch] before accessing it. It's probably called [withName]");
}
return this._name;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the name property
*/
Branch.prototype.withName = function (name_) {
this._name = name_;
return this;
};
Object.defineProperty(Branch.prototype, "pullRequests", {
/**
* pullRequests - Branch -> PullRequest
*
* @property {PullRequest[]} pullRequests
*/
get: function () {
if (this._pullRequests === undefined) {
throw new Error("Please use the relevant builder method to set property [pullRequests] on stub " +
"[Branch] before accessing it. It's probably called [withPullRequests]");
}
return this._pullRequests;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to add an element to the pullRequests array
*/
Branch.prototype.addPullRequests = function () {
var pullRequests_ = [];
for (var _i = 0; _i < arguments.length; _i++) {
pullRequests_[_i] = arguments[_i];
}
if (this._pullRequests === undefined) {
this._pullRequests = [];
}
this._pullRequests = this._pullRequests.concat(pullRequests_);
return this;
};
Object.defineProperty(Branch.prototype, "repo", {
/**
* repo - Branch -> 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 " +
"[Branch] before accessing it. It's probably called [withRepo]");
}
return this._repo;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the repo property
*/
Branch.prototype.withRepo = function (repo_) {
this._repo = repo_;
return this;
};
Object.defineProperty(Branch.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 " +
"[Branch] before accessing it. It's probably called [withTimestamp]");
}
return this._timestamp;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the timestamp property
*/
Branch.prototype.withTimestamp = function (timestamp_) {
this._timestamp = timestamp_;
return this;
};
return Branch;
}());
exports.Branch = Branch;