UNPKG

@atomist/cortex

Version:

Atomist Cortex model TypeScript typings

303 lines (273 loc) 8.6 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 chatChannelApi from "../ChatChannel"; import { ChannelLink } from "./ChannelLink"; import { ChatId } from "./ChatId"; import { ChatTeam } from "./ChatTeam"; import { Repo } from "./Repo"; export { ChatChannel }; /** * Type ChatChannel * Generated class exposing Atomist Cortex. * Fluent builder style class for use in testing and query by example. */ class ChatChannel implements chatChannelApi.ChatChannel { private _botInvitedSelf: boolean; private _createdBy: ChatId; private _id: string; private _isDefault: boolean; private _links: ChannelLink[]; private _members: ChatId[]; private _name: string; private _normalizedName: string; private _provider: string; private _repos: Repo[]; private _team: ChatTeam; private _nodeName = "ChatChannel"; private _nodeTags = [ "ChatChannel", "-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; } /** * botInvitedSelf * * @property {boolean} botInvitedSelf */ get botInvitedSelf(): boolean { if (this._botInvitedSelf === undefined) { throw new Error(`Please use the relevant builder method to set property [botInvitedSelf] on stub ` + `[ChatChannel] before accessing it. It's probably called [withBotInvitedSelf]`); } return this._botInvitedSelf; } /** * Fluent builder method to set the botInvitedSelf property */ public withBotInvitedSelf(botInvitedSelf_: boolean) { this._botInvitedSelf = botInvitedSelf_; return this; } /** * createdBy - ChatChannel -> ChatId * * @property {ChatId} createdBy */ get createdBy(): ChatId { if (this._createdBy === undefined) { throw new Error(`Please use the relevant builder method to set property [createdBy] on stub ` + `[ChatChannel] before accessing it. It's probably called [withCreatedBy]`); } return this._createdBy; } /** * Fluent builder method to set the createdBy property */ public withCreatedBy(createdBy_: ChatId) { this._createdBy = createdBy_; 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 ` + `[ChatChannel] 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; } /** * isDefault * * @property {boolean} isDefault */ get isDefault(): boolean { if (this._isDefault === undefined) { throw new Error(`Please use the relevant builder method to set property [isDefault] on stub ` + `[ChatChannel] before accessing it. It's probably called [withIsDefault]`); } return this._isDefault; } /** * Fluent builder method to set the isDefault property */ public withIsDefault(isDefault_: boolean) { this._isDefault = isDefault_; return this; } /** * links - ChatChannel -> ChannelLink * * @property {ChannelLink[]} links */ get links(): ChannelLink[] { if (this._links === undefined) { throw new Error(`Please use the relevant builder method to set property [links] on stub ` + `[ChatChannel] before accessing it. It's probably called [withLinks]`); } return this._links; } /** * Fluent builder method to add an element to the links array */ public addLinks(...links_: ChannelLink[]) { if (this._links === undefined) { this._links = []; } this._links = this._links.concat(links_); return this; } /** * members - ChatChannel -> ChatId * * @property {ChatId[]} members */ get members(): ChatId[] { if (this._members === undefined) { throw new Error(`Please use the relevant builder method to set property [members] on stub ` + `[ChatChannel] before accessing it. It's probably called [withMembers]`); } return this._members; } /** * Fluent builder method to add an element to the members array */ public addMembers(...members_: ChatId[]) { if (this._members === undefined) { this._members = []; } this._members = this._members.concat(members_); return this; } /** * name * * @property {string} name */ get name(): string { if (this._name === undefined) { throw new Error(`Please use the relevant builder method to set property [name] on stub ` + `[ChatChannel] before accessing it. It's probably called [withName]`); } return this._name; } /** * Fluent builder method to set the name property */ public withName(name_: string) { this._name = name_; return this; } /** * normalizedName * * @property {string} normalizedName */ get normalizedName(): string { if (this._normalizedName === undefined) { throw new Error(`Please use the relevant builder method to set property [normalizedName] on stub ` + `[ChatChannel] before accessing it. It's probably called [withNormalizedName]`); } return this._normalizedName; } /** * Fluent builder method to set the normalizedName property */ public withNormalizedName(normalizedName_: string) { this._normalizedName = normalizedName_; return this; } /** * provider * * @property {string} provider */ get provider(): string { if (this._provider === undefined) { throw new Error(`Please use the relevant builder method to set property [provider] on stub ` + `[ChatChannel] before accessing it. It's probably called [withProvider]`); } return this._provider; } /** * Fluent builder method to set the provider property */ public withProvider(provider_: string) { this._provider = provider_; return this; } /** * repos - ChatChannel -> Repo * * @property {Repo[]} repos */ get repos(): Repo[] { if (this._repos === undefined) { throw new Error(`Please use the relevant builder method to set property [repos] on stub ` + `[ChatChannel] before accessing it. It's probably called [withRepos]`); } return this._repos; } /** * Fluent builder method to add an element to the repos array */ public addRepos(...repos_: Repo[]) { if (this._repos === undefined) { this._repos = []; } this._repos = this._repos.concat(repos_); return this; } /** * team - ChatChannel -> ChatTeam * * @property {ChatTeam} team */ get team(): ChatTeam { if (this._team === undefined) { throw new Error(`Please use the relevant builder method to set property [team] on stub ` + `[ChatChannel] before accessing it. It's probably called [withTeam]`); } return this._team; } /** * Fluent builder method to set the team property */ public withTeam(team_: ChatTeam) { this._team = team_; return this; } }