@atomist/cortex
Version:
Atomist Cortex model TypeScript typings
167 lines (166 loc) • 5.37 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 Person
* Generated class exposing Atomist Cortex.
* Fluent builder style class for use in testing and query by example.
*/
var Person = (function () {
function Person() {
this._nodeName = "Person";
this._nodeTags = ["Person", "-dynamic"];
}
/**
* Implementation of GraphNode interface method.
* For infrastructure, not user use
*/
Person.prototype.nodeName = function () {
return this._nodeName;
};
/**
* Implementation of GraphNode interface method.
* For infrastructure, not user use
*/
Person.prototype.nodeTags = function () {
return this._nodeTags;
};
Object.defineProperty(Person.prototype, "chatId", {
/**
* chatId - Person -> ChatId
*
* @property {ChatId} chatId
*/
get: function () {
if (this._chatId === undefined) {
throw new Error("Please use the relevant builder method to set property [chatId] on stub " +
"[Person] before accessing it. It's probably called [withChatId]");
}
return this._chatId;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the chatId property
*/
Person.prototype.withChatId = function (chatId_) {
this._chatId = chatId_;
return this;
};
Object.defineProperty(Person.prototype, "emails", {
/**
* emails - Person -> Email
*
* @property {Email[]} emails
*/
get: function () {
if (this._emails === undefined) {
throw new Error("Please use the relevant builder method to set property [emails] on stub " +
"[Person] before accessing it. It's probably called [withEmails]");
}
return this._emails;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to add an element to the emails array
*/
Person.prototype.addEmails = function () {
var emails_ = [];
for (var _i = 0; _i < arguments.length; _i++) {
emails_[_i] = arguments[_i];
}
if (this._emails === undefined) {
this._emails = [];
}
this._emails = this._emails.concat(emails_);
return this;
};
Object.defineProperty(Person.prototype, "forename", {
/**
* forename
*
* @property {string} forename
*/
get: function () {
if (this._forename === undefined) {
throw new Error("Please use the relevant builder method to set property [forename] on stub " +
"[Person] before accessing it. It's probably called [withForename]");
}
return this._forename;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the forename property
*/
Person.prototype.withForename = function (forename_) {
this._forename = forename_;
return this;
};
Object.defineProperty(Person.prototype, "gitHubId", {
/**
* gitHubId - Person -> GitHubId
*
* @property {GitHubId} gitHubId
*/
get: function () {
if (this._gitHubId === undefined) {
throw new Error("Please use the relevant builder method to set property [gitHubId] on stub " +
"[Person] before accessing it. It's probably called [withGitHubId]");
}
return this._gitHubId;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the gitHubId property
*/
Person.prototype.withGitHubId = function (gitHubId_) {
this._gitHubId = gitHubId_;
return this;
};
Object.defineProperty(Person.prototype, "surname", {
/**
* surname
*
* @property {string} surname
*/
get: function () {
if (this._surname === undefined) {
throw new Error("Please use the relevant builder method to set property [surname] on stub " +
"[Person] before accessing it. It's probably called [withSurname]");
}
return this._surname;
},
enumerable: true,
configurable: true
});
/**
* Fluent builder method to set the surname property
*/
Person.prototype.withSurname = function (surname_) {
this._surname = surname_;
return this;
};
return Person;
}());
exports.Person = Person;