UNPKG

@atomist/cortex

Version:

Atomist Cortex model TypeScript typings

168 lines (150 loc) 4.73 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 orgApi from "../Org"; import { ChatTeam } from "./ChatTeam"; import { GitHubOrgWebhook } from "./GitHubOrgWebhook"; import { GitHubProvider } from "./GitHubProvider"; import { Repo } from "./Repo"; export { Org }; /** * Type Org * Generated class exposing Atomist Cortex. * Fluent builder style class for use in testing and query by example. */ class Org implements orgApi.Org { private _chatTeam: ChatTeam; private _owner: string; private _provider: GitHubProvider; private _repo: Repo[]; private _webhook: GitHubOrgWebhook[]; private _nodeName = "Org"; private _nodeTags = [ "Org", "-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; } /** * chatTeam - Org -> ChatTeam * * @property {ChatTeam} chatTeam */ get chatTeam(): ChatTeam { if (this._chatTeam === undefined) { throw new Error(`Please use the relevant builder method to set property [chatTeam] on stub ` + `[Org] before accessing it. It's probably called [withChatTeam]`); } return this._chatTeam; } /** * Fluent builder method to set the chatTeam property */ public withChatTeam(chatTeam_: ChatTeam) { this._chatTeam = chatTeam_; return this; } /** * owner * * @property {string} owner */ get owner(): string { if (this._owner === undefined) { throw new Error(`Please use the relevant builder method to set property [owner] on stub ` + `[Org] before accessing it. It's probably called [withOwner]`); } return this._owner; } /** * Fluent builder method to set the owner property */ public withOwner(owner_: string) { this._owner = owner_; return this; } /** * provider - Org -> GitHubProvider * * @property {GitHubProvider} provider */ get provider(): GitHubProvider { if (this._provider === undefined) { throw new Error(`Please use the relevant builder method to set property [provider] on stub ` + `[Org] before accessing it. It's probably called [withProvider]`); } return this._provider; } /** * Fluent builder method to set the provider property */ public withProvider(provider_: GitHubProvider) { this._provider = provider_; return this; } /** * repo - Org -> 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 ` + `[Org] before accessing it. It's probably called [withRepo]`); } return this._repo; } /** * Fluent builder method to add an element to the repo array */ public addRepo(...repo_: Repo[]) { if (this._repo === undefined) { this._repo = []; } this._repo = this._repo.concat(repo_); return this; } /** * webhook - Org -> GitHubOrgWebhook * * @property {GitHubOrgWebhook[]} webhook */ get webhook(): GitHubOrgWebhook[] { if (this._webhook === undefined) { throw new Error(`Please use the relevant builder method to set property [webhook] on stub ` + `[Org] before accessing it. It's probably called [withWebhook]`); } return this._webhook; } /** * Fluent builder method to add an element to the webhook array */ public addWebhook(...webhook_: GitHubOrgWebhook[]) { if (this._webhook === undefined) { this._webhook = []; } this._webhook = this._webhook.concat(webhook_); return this; } }