UNPKG

@atomist/cortex

Version:

Atomist Cortex model TypeScript typings

116 lines (102 loc) 3.15 kB
/* * 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. */ import * as channelLinkApi from "../ChannelLink"; import { ChatChannel } from "./ChatChannel"; import { Repo } from "./Repo"; export { ChannelLink }; /** * Type ChannelLink * Generated class exposing Atomist Cortex. * Fluent builder style class for use in testing and query by example. */ class ChannelLink implements channelLinkApi.ChannelLink { private _channel: ChatChannel; private _id: string; private _repo: Repo; private _nodeName = "ChannelLink"; private _nodeTags = [ "ChannelLink", "-dynamic" ]; /** * Implementation of GraphNode interface method. * For infrastructure, not user use */ public nodeName(): string { return this._nodeName; } /** * Implementation of GraphNode interface method. * For infrastructure, not user use */ public nodeTags(): string[] { return this._nodeTags; } /** * channel - ChannelLink -> ChatChannel * * @property {ChatChannel} channel */ get channel(): ChatChannel { if (this._channel === undefined) { throw new Error(`Please use the relevant builder method to set property [channel] on stub ` + `[ChannelLink] before accessing it. It's probably called [withChannel]`); } return this._channel; } /** * Fluent builder method to set the channel property */ public withChannel(channel_: ChatChannel) { this._channel = channel_; return this; } /** * id * * @property {string} id */ get id(): string { if (this._id === undefined) { throw new Error(`Please use the relevant builder method to set property [id] on stub ` + `[ChannelLink] before accessing it. It's probably called [withId]`); } return this._id; } /** * Fluent builder method to set the id property */ public withId(id_: string) { this._id = id_; return this; } /** * repo - ChannelLink -> Repo * * @property {Repo} repo */ get repo(): Repo { if (this._repo === undefined) { throw new Error(`Please use the relevant builder method to set property [repo] on stub ` + `[ChannelLink] before accessing it. It's probably called [withRepo]`); } return this._repo; } /** * Fluent builder method to set the repo property */ public withRepo(repo_: Repo) { this._repo = repo_; return this; } }