@atomist/cortex
Version:
Atomist Cortex model TypeScript typings
206 lines (184 loc) • 5.53 kB
text/typescript
/*
* 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 applicationApi from "../Application";
import { Commit } from "./Commit";
export { Application };
/**
* Type Application
* Generated class exposing Atomist Cortex.
* Fluent builder style class for use in testing and query by example.
*/
class Application implements applicationApi.Application {
private _commits: Commit[];
private _data: string;
private _domain: string;
private _host: string;
private _id: string;
private _state: string;
private _timestamp: string;
private _nodeName = "Application";
private _nodeTags = [ "Application", "-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;
}
/**
* commits - Application -> Commit
*
* @property {Commit[]} commits
*/
get commits(): Commit[] {
if (this._commits === undefined) {
throw new Error(`Please use the relevant builder method to set property [commits] on stub ` +
`[Application] before accessing it. It's probably called [withCommits]`);
}
return this._commits;
}
/**
* Fluent builder method to add an element to the commits array
*/
public addCommits(...commits_: Commit[]) {
if (this._commits === undefined) {
this._commits = [];
}
this._commits = this._commits.concat(commits_);
return this;
}
/**
* data
*
* @property {string} data
*/
get data(): string {
if (this._data === undefined) {
throw new Error(`Please use the relevant builder method to set property [data] on stub ` +
`[Application] before accessing it. It's probably called [withData]`);
}
return this._data;
}
/**
* Fluent builder method to set the data property
*/
public withData(data_: string) {
this._data = data_;
return this;
}
/**
* domain
*
* @property {string} domain
*/
get domain(): string {
if (this._domain === undefined) {
throw new Error(`Please use the relevant builder method to set property [domain] on stub ` +
`[Application] before accessing it. It's probably called [withDomain]`);
}
return this._domain;
}
/**
* Fluent builder method to set the domain property
*/
public withDomain(domain_: string) {
this._domain = domain_;
return this;
}
/**
* host
*
* @property {string} host
*/
get host(): string {
if (this._host === undefined) {
throw new Error(`Please use the relevant builder method to set property [host] on stub ` +
`[Application] before accessing it. It's probably called [withHost]`);
}
return this._host;
}
/**
* Fluent builder method to set the host property
*/
public withHost(host_: string) {
this._host = host_;
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 ` +
`[Application] 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;
}
/**
* state
*
* @property {string} state
*/
get state(): string {
if (this._state === undefined) {
throw new Error(`Please use the relevant builder method to set property [state] on stub ` +
`[Application] before accessing it. It's probably called [withState]`);
}
return this._state;
}
/**
* Fluent builder method to set the state property
*/
public withState(state_: string) {
this._state = state_;
return this;
}
/**
* timestamp
*
* @property {string} timestamp
*/
get timestamp(): string {
if (this._timestamp === undefined) {
throw new Error(`Please use the relevant builder method to set property [timestamp] on stub ` +
`[Application] before accessing it. It's probably called [withTimestamp]`);
}
return this._timestamp;
}
/**
* Fluent builder method to set the timestamp property
*/
public withTimestamp(timestamp_: string) {
this._timestamp = timestamp_;
return this;
}
}