UNPKG

@atomist/cortex

Version:

Atomist Cortex model TypeScript typings

289 lines (288 loc) 9.26 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 Review * Generated class exposing Atomist Cortex. * Fluent builder style class for use in testing and query by example. */ var Review = (function () { function Review() { this._nodeName = "Review"; this._nodeTags = ["Review", "-dynamic"]; } /** * Implementation of GraphNode interface method. * For infrastructure, not user use */ Review.prototype.nodeName = function () { return this._nodeName; }; /** * Implementation of GraphNode interface method. * For infrastructure, not user use */ Review.prototype.nodeTags = function () { return this._nodeTags; }; Object.defineProperty(Review.prototype, "body", { /** * body * * @property {string} body */ get: function () { if (this._body === undefined) { throw new Error("Please use the relevant builder method to set property [body] on stub " + "[Review] before accessing it. It's probably called [withBody]"); } return this._body; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the body property */ Review.prototype.withBody = function (body_) { this._body = body_; return this; }; Object.defineProperty(Review.prototype, "by", { /** * by - Review -> GitHubId * * @property {GitHubId[]} by */ get: function () { if (this._by === undefined) { throw new Error("Please use the relevant builder method to set property [by] on stub " + "[Review] before accessing it. It's probably called [withBy]"); } return this._by; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the by array */ Review.prototype.addBy = function () { var by_ = []; for (var _i = 0; _i < arguments.length; _i++) { by_[_i] = arguments[_i]; } if (this._by === undefined) { this._by = []; } this._by = this._by.concat(by_); return this; }; Object.defineProperty(Review.prototype, "comments", { /** * comments - Review -> Comment * * @property {Comment[]} comments */ get: function () { if (this._comments === undefined) { throw new Error("Please use the relevant builder method to set property [comments] on stub " + "[Review] before accessing it. It's probably called [withComments]"); } return this._comments; }, enumerable: true, configurable: true }); /** * Fluent builder method to add an element to the comments array */ Review.prototype.addComments = function () { var comments_ = []; for (var _i = 0; _i < arguments.length; _i++) { comments_[_i] = arguments[_i]; } if (this._comments === undefined) { this._comments = []; } this._comments = this._comments.concat(comments_); return this; }; Object.defineProperty(Review.prototype, "commit", { /** * commit - Review -> 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 " + "[Review] before accessing it. It's probably called [withCommit]"); } return this._commit; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the commit property */ Review.prototype.withCommit = function (commit_) { this._commit = commit_; return this; }; Object.defineProperty(Review.prototype, "gitHubId", { /** * gitHubId * * @property {string} gitHubId */ get: function () { if (this._gitHubId === undefined) { throw new Error("Please use the relevant builder method to set property [gitHubId] on stub " + "[Review] before accessing it. It's probably called [withGitHubId]"); } return this._gitHubId; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the gitHubId property */ Review.prototype.withGitHubId = function (gitHubId_) { this._gitHubId = gitHubId_; return this; }; Object.defineProperty(Review.prototype, "htmlUrl", { /** * htmlUrl * * @property {string} htmlUrl */ get: function () { if (this._htmlUrl === undefined) { throw new Error("Please use the relevant builder method to set property [htmlUrl] on stub " + "[Review] before accessing it. It's probably called [withHtmlUrl]"); } return this._htmlUrl; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the htmlUrl property */ Review.prototype.withHtmlUrl = function (htmlUrl_) { this._htmlUrl = htmlUrl_; return this; }; Object.defineProperty(Review.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 " + "[Review] before accessing it. It's probably called [withId]"); } return this._id; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the id property */ Review.prototype.withId = function (id_) { this._id = id_; return this; }; Object.defineProperty(Review.prototype, "pullRequest", { /** * pullRequest - Review -> 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 " + "[Review] before accessing it. It's probably called [withPullRequest]"); } return this._pullRequest; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the pullRequest property */ Review.prototype.withPullRequest = function (pullRequest_) { this._pullRequest = pullRequest_; return this; }; Object.defineProperty(Review.prototype, "state", { /** * state * * @property {"requested" | "pending" | "approved"} state */ get: function () { if (this._state === undefined) { throw new Error("Please use the relevant builder method to set property [state] on stub " + "[Review] before accessing it. It's probably called [withState]"); } return this._state; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the state property */ Review.prototype.withState = function (state_) { this._state = state_; return this; }; Object.defineProperty(Review.prototype, "submittedAt", { /** * submittedAt * * @property {string} submittedAt */ get: function () { if (this._submittedAt === undefined) { throw new Error("Please use the relevant builder method to set property [submittedAt] on stub " + "[Review] before accessing it. It's probably called [withSubmittedAt]"); } return this._submittedAt; }, enumerable: true, configurable: true }); /** * Fluent builder method to set the submittedAt property */ Review.prototype.withSubmittedAt = function (submittedAt_) { this._submittedAt = submittedAt_; return this; }; return Review; }()); exports.Review = Review;