UNPKG

@atomist/cortex

Version:

Atomist Cortex model TypeScript typings

233 lines (209 loc) 6.38 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 k8SpecApi from "../K8Spec"; import { DockerImage } from "./DockerImage"; import { Environment } from "./Environment"; import { K8Pod } from "./K8Pod"; export { K8Spec }; /** * Type K8Spec * Generated class exposing Atomist Cortex. * Fluent builder style class for use in testing and query by example. */ class K8Spec implements k8SpecApi.K8Spec { private _curHash: string; private _environment: Environment; private _fsha: string; private _images: DockerImage[]; private _kind: string; private _name: string; private _pods: K8Pod[]; private _timestamp: string; private _nodeName = "K8Spec"; private _nodeTags = [ "K8Spec", "-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; } /** * curHash * * @property {string} curHash */ get curHash(): string { if (this._curHash === undefined) { throw new Error(`Please use the relevant builder method to set property [curHash] on stub ` + `[K8Spec] before accessing it. It's probably called [withCurHash]`); } return this._curHash; } /** * Fluent builder method to set the curHash property */ public withCurHash(curHash_: string) { this._curHash = curHash_; return this; } /** * environment - K8Spec -> Environment * * @property {Environment} environment */ get environment(): Environment { if (this._environment === undefined) { throw new Error(`Please use the relevant builder method to set property [environment] on stub ` + `[K8Spec] before accessing it. It's probably called [withEnvironment]`); } return this._environment; } /** * Fluent builder method to set the environment property */ public withEnvironment(environment_: Environment) { this._environment = environment_; return this; } /** * fsha * * @property {string} fsha */ get fsha(): string { if (this._fsha === undefined) { throw new Error(`Please use the relevant builder method to set property [fsha] on stub ` + `[K8Spec] before accessing it. It's probably called [withFsha]`); } return this._fsha; } /** * Fluent builder method to set the fsha property */ public withFsha(fsha_: string) { this._fsha = fsha_; return this; } /** * images - K8Spec -> DockerImage * * @property {DockerImage[]} images */ get images(): DockerImage[] { if (this._images === undefined) { throw new Error(`Please use the relevant builder method to set property [images] on stub ` + `[K8Spec] before accessing it. It's probably called [withImages]`); } return this._images; } /** * Fluent builder method to add an element to the images array */ public addImages(...images_: DockerImage[]) { if (this._images === undefined) { this._images = []; } this._images = this._images.concat(images_); return this; } /** * kind * * @property {string} kind */ get kind(): string { if (this._kind === undefined) { throw new Error(`Please use the relevant builder method to set property [kind] on stub ` + `[K8Spec] before accessing it. It's probably called [withKind]`); } return this._kind; } /** * Fluent builder method to set the kind property */ public withKind(kind_: string) { this._kind = kind_; 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 ` + `[K8Spec] 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; } /** * pods - K8Spec -> K8Pod * * @property {K8Pod[]} pods */ get pods(): K8Pod[] { if (this._pods === undefined) { throw new Error(`Please use the relevant builder method to set property [pods] on stub ` + `[K8Spec] before accessing it. It's probably called [withPods]`); } return this._pods; } /** * Fluent builder method to add an element to the pods array */ public addPods(...pods_: K8Pod[]) { if (this._pods === undefined) { this._pods = []; } this._pods = this._pods.concat(pods_); 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 ` + `[K8Spec] 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; } }