import { IAuditable, IBetterLogger } from "@codiac.io/codiac-common";
import { AtLeast } from "@codiac.io/codiac-common/contracts";
import { ClusterDef, ImageRegistry, IngressDef, RootMap } from "../../apis/codiac-api/contracts";
import * as api from "../../apis/codiac-api/contracts";
import { RelayClient as GenRelayClient } from "../../apis/codiac-relay";
import { CspPrimaryCredsMeta } from "../../apis/codiac-relay/contracts";
import { AzureKeyVaultDef } from "../../relay/contracts";
import { UserNameTenantCode } from "@codiac.io/codiac-ops-common";
import { SecurityAccount } from "@codiac.io/codiac-domain/security-account";
import { SecurityAccountTypeEnum } from "@codiac.io/codiac-domain/security-account-type-enum";
import * as sdk from "../../sdk";
import { IEntryValidator, IOutputStyler, IUserInputProvider, ValidationResult } from "../../ops";
import { ClusterCaptureDef } from "../../codiac-entities/cluster-capture-def";
import { AzureFileStoreDef } from "./entities/azure-filestore-def";
export type ClusterIdentityDef = {
    instance: SecurityAccount;
    spec: {
        type: SecurityAccountTypeEnum;
        name: string;
    };
};
/** Parameters by which to validate a string with a regular expression. */
export declare class RegExValidator implements IEntryValidator<string> {
    rx: RegExp;
    whyInvalid?: string | undefined;
    allowUndefined: boolean;
    constructor(rx: RegExp, whyInvalid?: string | undefined, allowUndefined?: boolean);
    isValid(candidate: string | undefined): ValidationResult;
    static readonly COMMON_REGEXES: {
        /** From regexr.com...
         *
         * Will find valid ip-addresses between 0.0.0.0 and 255.255.255.255.All numbers must be in range 0-255.
         *
         * Improved with non-capturing groups. So the capturing groups existing will only be the 4 different numbers of the ip-address.
         *
         * by Artheus
         */
        IPAddress: RegExp;
    };
}
/** Walks the user through the selection of an existing
 * or the declaration of a new image registry.
 */
export declare class AzureResourceConfigurator implements sdk.IFileStoreConfigurator, sdk.ISecretStoreConfigurator, sdk.IRegistryConfigurator, sdk.IClusterConfigurator {
    private genRelayClient;
    private codiacUser;
    private _ui;
    private _styler;
    private logger;
    constructor(genRelayClient: GenRelayClient, codiacUser: UserNameTenantCode, _ui: IUserInputProvider, _styler: IOutputStyler, logger: IBetterLogger);
    private cliExec;
    readonly cloudProvider: "azure";
    /** Currently supporting only a single reg type per cloud provider. */
    private regType;
    /** Validates the given name for use as the name of an entity in Azure.
     *
     * 1-50
     * alphanumerics and hyphens,
     * starting with a letter and ending with an alphanumeric.
     *
     * @see https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules
     */
    private azServiceNameValidator;
    /** Validates the given name for use as the name of an entity in Azure.
     *
     *  1-90
     *  Underscores, hyphens, periods, and letters or digits as defined by the Char.IsLetterOrDigit function.
     *
     *  Valid characters are members of the following categories in UnicodeCategory:
     *  UppercaseLetter,
     *  LowercaseLetter,
     *  TitlecaseLetter,
     *  ModifierLetter,
     *  OtherLetter,
     *  DecimalDigitNumber.
     *
     *  Can't end with period.
     *
     * NOTE: the azure portal says Parentheses `()` are also valid characters in a resource group name.
     *
     * @see https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftresources
     */
    private azRgNameValidator;
    /** Validates the given name for use as the name of a userAssignedIdentity in Azure.
     *
     * 3-128 Alphanumerics, hyphens, and underscores,
     * starting with a letter or number.
     *
     * @see https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftmanagedidentity
     */
    private azIdentityNameValidator;
    promptToLogin(providerSubscriptionId?: string, suppressConfirmations?: boolean, providedUserName?: string, providedSecret?: string): Promise<[boolean, string]>;
    /** Suffixes the username with its applicable csp subscriptionId
     *
     * as:
     * ```
     * "<username> (<subscriptionId>)"
     * ``` */
    private userAndSubx;
    private selectCachedUser;
    captureImageRegistry(): Promise<ImageRegistry>;
    private promptForSubscriptionId;
    defineCluster(initial: Partial<ClusterDef>, defaults?: Partial<ClusterDef>, cspTenantId?: string): Promise<{
        spec: ClusterDef;
        defaults: Partial<ClusterDef>;
    }>;
    promptForNodeGroup(cluster: AtLeast<ClusterDef, "name" | "providerSubscription" | "locationName">, nodeGroupSpec: Partial<Pick<ClusterDef, "nodeSpec" | "nodesMin" | "nodesMax" | "startingNodeCount">>, nodePoolName: string, defaultMaxNodes?: number): Promise<api.NodePoolDef>;
    promptForIngressSpec(current?: Partial<IngressDef>): Promise<IngressDef | undefined>;
    defineClusterCaptureParams(initial: Partial<ClusterDef>, rootMap: RootMap, defaults?: Partial<ClusterDef>, cspTenantId?: string, cspUser?: CspPrimaryCredsMeta): Promise<{
        spec: ClusterCaptureDef;
        defaults: Partial<ClusterDef>;
    }>;
    /** Throws on exceptions or none found. */
    private promptForExistingCluster;
    private promptForClusterIdentity;
    private promptForVnetSubnet;
    private buildSubnetResourceId;
    private getVnets;
    private promptForResourceGroup;
    private getResourceGroups;
    /** Asks the user whether to keep the default version, and if not presents a select list. */
    private promptForLocation;
    /** Queries data centers under the current user's subscription.
     *
     * @see:  https://docs.microsoft.com/en-us/rest/api/resources/subscriptions/listlocations
     * DEVNOTE:  This uses the subx set in the current user state (az account show), so is it possible that this is NOT the subscription chosen a few steps earlier? */
    private getAvailableLocations;
    /** Asks the user whether to keep the default version, and if not presents a select list. */
    private promptForK8sVersion;
    private promptForNodeSpec;
    private getAvailableNodeSizes;
    captureSecretStore(/* storeProv: ISecretStoreProvisioner, */ defaults?: Partial<AzureKeyVaultDef>): Promise<AzureKeyVaultDef>;
    protected createAuditable(): IAuditable;
    captureFileStore(providerSubscriptionId: string, partial: Partial<AzureFileStoreDef>, allowUserInteraction: boolean): Promise<AzureFileStoreDef | undefined>;
    captureFileStore_NonTTY(providerSubscriptionId: string, partial: Partial<AzureFileStoreDef>): Promise<AzureFileStoreDef | undefined>;
    /** Throws any encounted exceptions.
     *
     * We have to parse the resourceGroup out of the id bc M$ doesnt return it anywhere else.
     * Yeah, dont you just love those guys :|
     */
    private extractResourceGroup;
    /** Facory method for building a FileStoreDef from a fileshare */
    private buildFileStoreDef;
}
