@atomist/cortex
Version:
Atomist Cortex model TypeScript typings
230 lines (206 loc) • 6.23 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 tagApi from "../Tag";
import { Commit } from "./Commit";
import { DockerImage } from "./DockerImage";
import { Release } from "./Release";
export { Tag };
/**
* Type Tag
* Generated class exposing Atomist Cortex.
* Fluent builder style class for use in testing and query by example.
*/
class Tag implements tagApi.Tag {
private _commit: Commit;
private _containers: DockerImage[];
private _description: string;
private _id: string;
private _name: string;
private _ref: string;
private _release: Release;
private _timestamp: string;
private _nodeName = "Tag";
private _nodeTags = [ "Tag", "-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;
}
/**
* commit - Tag -> Commit
*
* @property {Commit} commit
*/
get commit(): Commit {
if (this._commit === undefined) {
throw new Error(`Please use the relevant builder method to set property [commit] on stub ` +
`[Tag] before accessing it. It's probably called [withCommit]`);
}
return this._commit;
}
/**
* Fluent builder method to set the commit property
*/
public withCommit(commit_: Commit) {
this._commit = commit_;
return this;
}
/**
* containers - Tag -> DockerImage
*
* @property {DockerImage[]} containers
*/
get containers(): DockerImage[] {
if (this._containers === undefined) {
throw new Error(`Please use the relevant builder method to set property [containers] on stub ` +
`[Tag] before accessing it. It's probably called [withContainers]`);
}
return this._containers;
}
/**
* Fluent builder method to add an element to the containers array
*/
public addContainers(...containers_: DockerImage[]) {
if (this._containers === undefined) {
this._containers = [];
}
this._containers = this._containers.concat(containers_);
return this;
}
/**
* description
*
* @property {string} description
*/
get description(): string {
if (this._description === undefined) {
throw new Error(`Please use the relevant builder method to set property [description] on stub ` +
`[Tag] before accessing it. It's probably called [withDescription]`);
}
return this._description;
}
/**
* Fluent builder method to set the description property
*/
public withDescription(description_: string) {
this._description = description_;
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 ` +
`[Tag] 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 ` +
`[Tag] 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;
}
/**
* ref
*
* @property {string} ref
*/
get ref(): string {
if (this._ref === undefined) {
throw new Error(`Please use the relevant builder method to set property [ref] on stub ` +
`[Tag] before accessing it. It's probably called [withRef]`);
}
return this._ref;
}
/**
* Fluent builder method to set the ref property
*/
public withRef(ref_: string) {
this._ref = ref_;
return this;
}
/**
* release - Tag -> Release
*
* @property {Release} release
*/
get release(): Release {
if (this._release === undefined) {
throw new Error(`Please use the relevant builder method to set property [release] on stub ` +
`[Tag] before accessing it. It's probably called [withRelease]`);
}
return this._release;
}
/**
* Fluent builder method to set the release property
*/
public withRelease(release_: Release) {
this._release = release_;
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 ` +
`[Tag] 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;
}
}