UNPKG

@atomist/cortex

Version:

Atomist Cortex model TypeScript typings

185 lines (165 loc) 4.95 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 k8PodApi from "../K8Pod"; import { DockerImage } from "./DockerImage"; import { K8Spec } from "./K8Spec"; export { K8Pod }; /** * Type K8Pod * Generated class exposing Atomist Cortex. * Fluent builder style class for use in testing and query by example. */ class K8Pod implements k8PodApi.K8Pod { private _host: string; private _images: DockerImage[]; private _name: string; private _spec: K8Spec; private _state: string; private _timestamp: string; private _nodeName = "K8Pod"; private _nodeTags = [ "K8Pod", "-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; } /** * 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 ` + `[K8Pod] 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; } /** * images - K8Pod -> 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 ` + `[K8Pod] 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; } /** * 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 ` + `[K8Pod] 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; } /** * spec - K8Pod -> K8Spec * * @property {K8Spec} spec */ get spec(): K8Spec { if (this._spec === undefined) { throw new Error(`Please use the relevant builder method to set property [spec] on stub ` + `[K8Pod] before accessing it. It's probably called [withSpec]`); } return this._spec; } /** * Fluent builder method to set the spec property */ public withSpec(spec_: K8Spec) { this._spec = spec_; 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 ` + `[K8Pod] 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 ` + `[K8Pod] 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; } }