"use strict";
/*
 * Copyright © 2020 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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.addValues = exports.addSecrets = exports.addMappedParameters = exports.addParameters = exports.ParametersBuilder = void 0;
/**
 * Fluent builder for command parameters. Similar to inquirer.js API.
 */
class ParametersBuilder {
    constructor() {
        this.parameters = [];
        this.mappedParameters = [];
        this.secrets = [];
        this.values = [];
    }
    /**
     * Declare a new parameter for a command
     * @return {this}
     */
    addParameters(p, ...more) {
        this.parameters.push(p);
        this.parameters = this.parameters.concat(more);
        return this;
    }
    /**
     * Declare a new mapped parameter for a command
     * @return {this}
     */
    addMappedParameters(mp, ...more) {
        this.mappedParameters.push(mp);
        this.mappedParameters = this.mappedParameters.concat(more);
        return this;
    }
    /**
     * Declare a new secret parameter for a command
     * @return {this}
     */
    addSecrets(s, ...more) {
        this.secrets.push(s);
        this.secrets = this.secrets.concat(more);
        return this;
    }
    /**
     * Declare a new configuration value parameter for a command
     * @return {this}
     */
    addValues(s, ...more) {
        this.values.push(s);
        this.values = this.values.concat(more);
        return this;
    }
}
exports.ParametersBuilder = ParametersBuilder;
/**
 * Declare a new parameter for the given command
 * @return {ParametersBuilder}
 */
function addParameters(p, ...more) {
    const pb = new ParametersBuilder();
    pb.addParameters(p, ...more);
    return pb;
}
exports.addParameters = addParameters;
/**
 * Declare a new mapped parameter for the given command
 * @return {ParametersBuilder}
 */
function addMappedParameters(p, ...more) {
    const pb = new ParametersBuilder();
    pb.addMappedParameters(p, ...more);
    return pb;
}
exports.addMappedParameters = addMappedParameters;
/**
 * Declare a new secret parameter for the given command
 * @return {ParametersBuilder}
 */
function addSecrets(s, ...more) {
    const pb = new ParametersBuilder();
    pb.addSecrets(s, ...more);
    return pb;
}
exports.addSecrets = addSecrets;
/**
 * Declare a new configuration value parameter for the given command
 * @return {ParametersBuilder}
 */
function addValues(s, ...more) {
    const pb = new ParametersBuilder();
    pb.addValues(s, ...more);
    return pb;
}
exports.addValues = addValues;
//# sourceMappingURL=ParametersBuilder.js.map