import { interfaces } from "inversify";
import { IBetterLogger } from "@codiac.io/codiac-common";
import { AtLeast } from "@codiac.io/codiac-common/contracts";
import { LoginConfiguratorFactory } from "./cloud-resource-configurator-factory";
import { RelayClient } from "../apis/codiac-relay";
import { CloudProviderEnum, CspPrimaryCredsMeta, LogintoCloudProviderRequest } from "../apis/codiac-relay/contracts";
import { ICspAccountFilter } from "../sdk";
import { IOutputStyler, IUserInputProvider } from "../ops";
import { ICodiacClient } from "../apis/codiac-api/i-client";
import { CspTenantProfile } from "../apis/codiac-api-nats";
/** Prompts the user for a cloud resource provider,
 *  their credentials there, attempts a login,
 *  and then persists the credentials into the keyring under that tenant and provider.
 *
 * In subsequent sessions, this logic will allows the user to confirm/change accounts
 * for the given provider if they are already authenticated.
 */
export declare class CloudProviderContextualizer {
    private relayClient;
    private loginUiFactory;
    private _ui;
    private _styler;
    private logger;
    constructor(relayClient: RelayClient, loginUiFactory: LoginConfiguratorFactory, _ui: IUserInputProvider, _styler: IOutputStyler, logger: IBetterLogger);
    takeDefaults: boolean;
    private static isBootstrapped;
    static bootstrap(ioc: interfaces.Container): void;
    promptForCloudProvider(allPvds: CloudProviderEnum[], defaultValue: CloudProviderEnum | undefined): Promise<CloudProviderEnum>;
    /** Suffixes the username with its applicable csp subscriptionId
     *
     * as:
     * ```
     * "<username> (<subscriptionId>)"
     * ```
     * @param defaultSubxId Renders when user.subscriptionId is undefined.
     * */
    private userAndSubx;
    /** Simple filter based on existence of filter values.  This method is just for reability. */
    private isCspAccountMatch;
    /** Acquires the relevant cspTenantProfile (if Cloud Provider supports it),
     *  forcing the user to select one if the user's organization in Codiac (aka: Codiac tenant) has more than one declared.
     */
    ensureCspTenant(providerCode: CloudProviderEnum, codiacApi: ICodiacClient, currentTenantId?: string | ICspAccountFilter, throwNotFound?: boolean): Promise<CspTenantProfile | undefined>;
    ensureCspTenantContext(codiacApi: ICodiacClient, provider: CloudProviderEnum, argsSubxId?: string, argsTenantId?: string, argsSilent?: boolean): Promise<AtLeast<ICspAccountFilter, "tenantId">>;
    /** Enables the user to enter, use existing, or change the credentials for the given cloud service provider.
     *
     * Throws on authentication failure of cached creds,
     * or loops a login prompt otherwise.
     *
     * TODO: Return an authenticated user object.
     * @returns username
     *
     * @param suppressConfirmations TODO: Remove this argument and apply the non-tty ui provider for silent mode.
     * @param providerUserName TODO: Remove this argument and rely on relay state (via separate login step).
     * @param providerSecret TODO: Remove this argument and rely on relay state (via separate login step).
     * @param proprietaryInput Input specific to the selected cloud provider. (eg: Aws session token).
     */
    promptForCloudProviderCreds(ioc: interfaces.Container, providerCode: CloudProviderEnum, suppressConfirmations?: boolean, providerUserName?: string, providerSecret?: string, reqSubscriptionId?: string | ICspAccountFilter, proprietaryInput?: {
        [property: string]: any;
    } | undefined): Promise<CspPrimaryCredsMeta>;
    /** Used when cloud service provider has special proprietary input
     * required for csp login that breaks the standard patterns.
     * This method allows that provider a chance to build the login request however they see fit. */
    assembleLoginRequest(ioc: interfaces.Container, providerCode: CloudProviderEnum, user: string | undefined, secret: string | undefined, subscriptionId: string | undefined, proprietaryInput: {
        [key: string]: any;
    }): LogintoCloudProviderRequest;
    private toCspAccountFilter;
    private toAccountDesc;
    private toCspUserDesc;
    private toIndex;
    /** Signs the user out from the given cloud service provider.
     *
     * @returns username
     *
     * @param suppressConfirmations TODO: Remove this argument and apply the non-tty ui provider for silent mode.
     * @param providedUserName TODO: Remove this argument and rely on relay state (via separate login step).
     */
    promptToLogout(ioc: interfaces.Container, providerCode: CloudProviderEnum, accountFilter?: ICspAccountFilter, suppressConfirmations?: boolean, providedUserName?: string): Promise<string>;
}
