@atomist/cortex
Version:
Atomist Cortex model TypeScript typings
137 lines (120 loc) • 3.51 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 labelApi from "../Label";
export { Label };
/**
* Type Label
* Generated class exposing Atomist Cortex.
* Fluent builder style class for use in testing and query by example.
*/
class Label implements labelApi.Label {
private _color: string;
private _default: string;
private _id: string;
private _name: string;
private _nodeName = "Label";
private _nodeTags = [ "Label", "-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;
}
/**
* color
*
* @property {string} color
*/
get color(): string {
if (this._color === undefined) {
throw new Error(`Please use the relevant builder method to set property [color] on stub ` +
`[Label] before accessing it. It's probably called [withColor]`);
}
return this._color;
}
/**
* Fluent builder method to set the color property
*/
public withColor(color_: string) {
this._color = color_;
return this;
}
/**
* default
*
* @property {string} default
*/
get default(): string {
if (this._default === undefined) {
throw new Error(`Please use the relevant builder method to set property [default] on stub ` +
`[Label] before accessing it. It's probably called [withDefault]`);
}
return this._default;
}
/**
* Fluent builder method to set the default property
*/
public withDefault(default_: string) {
this._default = default_;
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 ` +
`[Label] 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;
}
/**
* 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 ` +
`[Label] 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;
}
}