// SPDX-License-Identifier: Apache-2.0
import { KubeAuthentication } from '../request/authentication/kube-authentication.js';
import { DefaultHelmClient } from './default-helm-client.js';
/**
 * The default implementation of the HelmClientBuilder interface.
 */
export class DefaultHelmClientBuilder {
    /**
     * The default namespace to be set by the HelmClient. Defaults to a null value which indicates that
     * the Helm -n <namespace> argument should not be specified.
     */
    _defaultNamespace;
    /**
     * The working directory to be used by the HelmClient.
     */
    _workingDirectory;
    /**
     * The kubernetes API server address and port number to which the client should connect. Defaults to a null
     * value which indicates that the Helm --kube-apiserver <address_and_port> argument should not be specified.
     */
    _kubeApiServer;
    /**
     * The kubernetes CA certificate file. Defaults to a null value which indicates that the Helm
     * --kube-ca-file <ca_file> argument should not be specified.
     */
    _kubeCAFile;
    /**
     * The kubernetes context from the kube config file to be used. Defaults to a null value which indicates
     * that the Helm --kube-context <context> argument should not be specified.
     */
    _kubeContext;
    /**
     * Specifies whether the Helm client should skip TLS certificate verification. Defaults to a null value
     * which indicates that the Helm --kube-insecure-skip-tls-verify <bool> argument should not be specified.
     */
    _kubeSkipTlsVerification;
    /**
     * The kubernetes server name to use for TLS server certificate validation. Defaults to a null value
     * which indicates that the Helm --kube-tls-server-name <name> argument should not be specified.
     */
    _kubeTlsServerName;
    /**
     * The kubernetes bearer token to be used for authentication. Defaults to a null values which indicates that
     * the Helm --kube-token <token> argument should not be specified.
     */
    _kubeToken;
    /**
     * The path to the kube config file. Defaults to a null value which indicates that the Helm
     * --kubeconfig <context> argument should not be specified.
     */
    _kubeConfig;
    /**
     * Constructs a new builder instance and initializes it with the default configuration.
     */
    constructor() { }
    defaultNamespace(namespace) {
        this._defaultNamespace = namespace;
        return this;
    }
    workingDirectory(workingDirectory) {
        this._workingDirectory = workingDirectory;
        return this;
    }
    kubeApiServer(kubeApiServer) {
        this._kubeApiServer = kubeApiServer;
        return this;
    }
    kubeCAFile(kubeCAFile) {
        this._kubeCAFile = kubeCAFile;
        return this;
    }
    kubeContext(kubeContext) {
        this._kubeContext = kubeContext;
        return this;
    }
    kubeSkipTlsVerification(kubeSkipTlsVerification) {
        this._kubeSkipTlsVerification = kubeSkipTlsVerification;
        return this;
    }
    kubeTlsServerName(kubeTlsServerName) {
        this._kubeTlsServerName = kubeTlsServerName;
        return this;
    }
    kubeToken(kubeToken) {
        this._kubeToken = kubeToken;
        return this;
    }
    kubeConfig(kubeConfig) {
        this._kubeConfig = kubeConfig;
        return this;
    }
    async build() {
        const authentication = new KubeAuthentication(this._kubeApiServer, this._kubeCAFile, this._kubeContext, this._kubeSkipTlsVerification, this._kubeTlsServerName, this._kubeToken, this._kubeConfig);
        const client = new DefaultHelmClient();
        await client.version();
        return client;
    }
}
//# sourceMappingURL=default-helm-client-builder.js.map