UNPKG

@atomist/cortex

Version:

Atomist Cortex model TypeScript typings

317 lines (316 loc) 10.3 kB
"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 Repo * Generated class exposing Atomist Cortex. * Fluent builder style class for use in testing and query by example. */ var Repo = (function () { function Repo() { this._nodeName = "Repo"; this._nodeTags = ["Repo", "-dynamic"]; } /** * Implementation of GraphNode interface method. * For infrastructure, not user use */ Repo.prototype.nodeName = function () { return this._nodeName; }; /** * Implementation of GraphNode interface method. * For infrastructure, not user use */ Repo.prototype.nodeTags = function () { return this._nodeTags; }; Object.defineProperty(Repo.prototype, "branches", { /** * branches - Repo -> Branch * * @property {Branch[]} branches */ get: function () { if (this._branches === undefined) { throw new Error("Please use the relevant builder method to set property [branches] on stub " + "[Repo] before accessing it. It's probably called [withBranches]"); } return this._branches; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the branches array */ Repo.prototype.addBranches = function () { var branches_ = []; for (var _i = 0; _i < arguments.length; _i++) { branches_[_i] = arguments[_i]; } if (this._branches === undefined) { this._branches = []; } this._branches = this._branches.concat(branches_); return this; }; Object.defineProperty(Repo.prototype, "channels", { /** * channels - Repo -> ChatChannel * * @property {ChatChannel[]} channels */ get: function () { if (this._channels === undefined) { throw new Error("Please use the relevant builder method to set property [channels] on stub " + "[Repo] before accessing it. It's probably called [withChannels]"); } return this._channels; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the channels array */ Repo.prototype.addChannels = function () { var channels_ = []; for (var _i = 0; _i < arguments.length; _i++) { channels_[_i] = arguments[_i]; } if (this._channels === undefined) { this._channels = []; } this._channels = this._channels.concat(channels_); return this; }; Object.defineProperty(Repo.prototype, "defaultBranch", { /** * defaultBranch * * @property {string} defaultBranch */ get: function () { if (this._defaultBranch === undefined) { throw new Error("Please use the relevant builder method to set property [defaultBranch] on stub " + "[Repo] before accessing it. It's probably called [withDefaultBranch]"); } return this._defaultBranch; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the defaultBranch property */ Repo.prototype.withDefaultBranch = function (defaultBranch_) { this._defaultBranch = defaultBranch_; return this; }; Object.defineProperty(Repo.prototype, "issue", { /** * issue - Repo -> Issue * * @property {Issue[]} issue */ get: function () { if (this._issue === undefined) { throw new Error("Please use the relevant builder method to set property [issue] on stub " + "[Repo] before accessing it. It's probably called [withIssue]"); } return this._issue; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the issue array */ Repo.prototype.addIssue = function () { var issue_ = []; for (var _i = 0; _i < arguments.length; _i++) { issue_[_i] = arguments[_i]; } if (this._issue === undefined) { this._issue = []; } this._issue = this._issue.concat(issue_); return this; }; Object.defineProperty(Repo.prototype, "labels", { /** * labels - Repo -> Label * * @property {Label[]} labels */ get: function () { if (this._labels === undefined) { throw new Error("Please use the relevant builder method to set property [labels] on stub " + "[Repo] before accessing it. It's probably called [withLabels]"); } return this._labels; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the labels array */ Repo.prototype.addLabels = function () { var labels_ = []; for (var _i = 0; _i < arguments.length; _i++) { labels_[_i] = arguments[_i]; } if (this._labels === undefined) { this._labels = []; } this._labels = this._labels.concat(labels_); return this; }; Object.defineProperty(Repo.prototype, "links", { /** * links - Repo -> ChannelLink * * @property {ChannelLink[]} links */ get: function () { if (this._links === undefined) { throw new Error("Please use the relevant builder method to set property [links] on stub " + "[Repo] before accessing it. It's probably called [withLinks]"); } return this._links; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the links array */ Repo.prototype.addLinks = function () { var links_ = []; for (var _i = 0; _i < arguments.length; _i++) { links_[_i] = arguments[_i]; } if (this._links === undefined) { this._links = []; } this._links = this._links.concat(links_); return this; }; Object.defineProperty(Repo.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 " + "[Repo] before accessing it. It's probably called [withName]"); } return this._name; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the name property */ Repo.prototype.withName = function (name_) { this._name = name_; return this; }; Object.defineProperty(Repo.prototype, "org", { /** * org - Repo -> Org * * @property {Org} org */ get: function () { if (this._org === undefined) { throw new Error("Please use the relevant builder method to set property [org] on stub " + "[Repo] before accessing it. It's probably called [withOrg]"); } return this._org; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the org property */ Repo.prototype.withOrg = function (org_) { this._org = org_; return this; }; Object.defineProperty(Repo.prototype, "owner", { /** * owner * * @property {string} owner */ get: function () { if (this._owner === undefined) { throw new Error("Please use the relevant builder method to set property [owner] on stub " + "[Repo] before accessing it. It's probably called [withOwner]"); } return this._owner; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the owner property */ Repo.prototype.withOwner = function (owner_) { this._owner = owner_; return this; }; Object.defineProperty(Repo.prototype, "pullRequest", { /** * pullRequest - Repo -> PullRequest * * @property {PullRequest[]} pullRequest */ get: function () { if (this._pullRequest === undefined) { throw new Error("Please use the relevant builder method to set property [pullRequest] on stub " + "[Repo] before accessing it. It's probably called [withPullRequest]"); } return this._pullRequest; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the pullRequest array */ Repo.prototype.addPullRequest = function () { var pullRequest_ = []; for (var _i = 0; _i < arguments.length; _i++) { pullRequest_[_i] = arguments[_i]; } if (this._pullRequest === undefined) { this._pullRequest = []; } this._pullRequest = this._pullRequest.concat(pullRequest_); return this; }; return Repo; }()); exports.Repo = Repo;