/**
 * Copyright (c) 2020-present, Goldman Sachs
 *
 * 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 { AbstractServerClient, type PlainObject, type ServerClientConfig, type TraceData } from '@finos/legend-shared';
import type { V1_PureModelContextData } from '../model/context/V1_PureModelContextData.js';
import type { V1_LambdaReturnTypeInput, V1_LambdaReturnTypeResult } from './compilation/V1_LambdaReturnType.js';
import type { V1_ServiceRegistrationResult } from './service/V1_ServiceRegistrationResult.js';
import type { V1_ServiceConfigurationInfo } from './service/V1_ServiceConfiguration.js';
import type { V1_CompileResult } from './compilation/V1_CompileResult.js';
import type { V1_RawLambda } from '../model/rawValueSpecification/V1_RawLambda.js';
import type { V1_GenerateFileInput } from './generation/V1_FileGenerationInput.js';
import type { V1_ExecutionResult } from './execution/V1_ExecutionResult.js';
import type { V1_ImportConfigurationDescription } from './import/V1_ImportConfigurationDescription.js';
import type { V1_GenerationConfigurationDescription } from './generation/V1_GenerationConfigurationDescription.js';
import type { V1_GenerationOutput } from './generation/V1_GenerationOutput.js';
import type { V1_ExecuteInput } from './execution/V1_ExecuteInput.js';
import type { V1_PureModelContext } from '../model/context/V1_PureModelContext.js';
import type { V1_ExecutionPlan } from '../model/executionPlan/V1_ExecutionPlan.js';
import type { V1_LightQuery, V1_Query } from './query/V1_Query.js';
import type { V1_ServiceStorage } from './service/V1_ServiceStorage.js';
import type { GenerationMode } from '../../../../../graph-manager/action/generation/GenerationConfigurationDescription.js';
import type { V1_QuerySearchSpecification } from './query/V1_QuerySearchSpecification.js';
import { type TDSExecutionResult, EXECUTION_SERIALIZATION_FORMAT } from '../../../../../graph-manager/action/execution/ExecutionResult.js';
import type { V1_ExternalFormatDescription } from './externalFormat/V1_ExternalFormatDescription.js';
import type { V1_ExternalFormatModelGenerationInput } from './externalFormat/V1_ExternalFormatModelGeneration.js';
import type { V1_GenerateSchemaInput } from './externalFormat/V1_GenerateSchemaInput.js';
import type { V1_RunTestsInput } from './test/V1_RunTestsInput.js';
import type { V1_RawRelationalOperationElement } from '../model/packageableElements/store/relational/model/V1_RawRelationalOperationElement.js';
import type { V1_RenderStyle } from './grammar/V1_RenderStyle.js';
import type { V1_ParserError } from './grammar/V1_ParserError.js';
import type { V1_MappingModelCoverageAnalysisInput, V1_MappingModelCoverageAnalysisResult } from './analytics/V1_MappingModelCoverageAnalysis.js';
import { ServiceExecutionMode } from '../../../../action/service/ServiceExecutionMode.js';
import type { V1_CheckEntitlementsResult, V1_EntitlementReportAnalyticsInput, V1_StoreEntitlementAnalysisInput, V1_SurveyDatasetsResult } from './analytics/V1_StoreEntitlementAnalysis.js';
import type { V1_RunTestsResult } from './test/V1_RunTestsResult.js';
import type { ClassifierPathMapping, SubtypeInfo } from '../../../../action/protocol/ProtocolInfo.js';
import type { V1_FunctionActivatorInfo } from './functionActivator/V1_FunctionActivatorInfo.js';
import type { V1_FunctionActivatorError } from './functionActivator/V1_FunctionActivatorError.js';
import type { V1_FunctionActivatorInput } from './functionActivator/V1_FunctionActivatorInput.js';
import type { V1_DatabaseBuilderInput } from './generation/V1_DatabaseBuilderInput.js';
import type { V1_RawSQLExecuteInput } from './execution/V1_RawSQLExecuteInput.js';
import type { V1_ValueSpecification } from '../model/valueSpecification/V1_ValueSpecification.js';
import type { V1_ArtifactGenerationExtensionInput, V1_ArtifactGenerationExtensionOutput } from './generation/V1_ArtifactGenerationExtensionApi.js';
import type { V1_DatabaseToModelGenerationInput } from './relational/V1_DatabaseToModelGenerationInput.js';
import type { V1_TestDataGenerationInput } from './service/V1_TestDataGenerationInput.js';
import type { V1_TestDataGenerationResult } from './service/V1_TestDataGenerationResult.js';
import type { V1_RelationalConnectionBuilder } from './relational/V1_RelationalConnectionBuilder.js';
import type { V1_LambdaPrefix } from './lambda/V1_LambdaPrefix.js';
import type { V1_DebugTestsResult } from './test/V1_DebugTestsResult.js';
import type { V1_RelationType } from '../model/packageableElements/type/V1_RelationType.js';
import type { CodeCompletionResult } from '../../../../action/compilation/Completion.js';
import type { V1_CompleteCodeInput } from './compilation/V1_CompleteCodeInput.js';
import type { DeploymentResult } from '../../../../action/DeploymentResult.js';
import type { PersistentDataCube } from '../../../../action/query/PersistentDataCube.js';
import { type V1_LambdaTdsToRelationInput } from './pureProtocol/V1_LambdaTdsToRelationInput.js';
import type { V1_RawLineageModel } from '../model/lineage/V1_Lineage.js';
import type { V1_DevMetadataPushRequest } from './dev-metadata/V1_DevMetadataPushRequest.js';
export type V1_GrammarParserBatchInputEntry = {
    value: string;
    returnSourceInformation?: boolean | undefined;
    sourceInformationOffset?: {
        sourceId?: string | undefined;
        lineOffset?: number | undefined;
        columnOffset?: number | undefined;
    } | undefined;
};
declare enum ENGINE_EXECUTION_SERIALIZATION_FORMAT {
    CSV_TRANSFORMED = "csv_transformed"
}
export declare const V1_getEngineSerializationFormat: (val: EXECUTION_SERIALIZATION_FORMAT) => ENGINE_EXECUTION_SERIALIZATION_FORMAT | string;
export declare function getCurrentUserIDFromEngineServer(engineServerUrl: string): Promise<string>;
export declare class V1_EngineServerClient extends AbstractServerClient {
    currentUserId?: string | undefined;
    private env?;
    private queryBaseUrl?;
    private baseUrlForServiceRegistration?;
    constructor(config: ServerClientConfig);
    setBaseUrlForServiceRegistration(val: string | undefined): void;
    setEnv: (value: string | undefined) => void;
    setCurrentUserId: (value: string | undefined) => void;
    getTraceData: (name: string, tracingTags?: PlainObject) => TraceData;
    _pure: () => string;
    _sdlc: () => string;
    _server: () => string;
    getCurrentUserId: () => Promise<string>;
    _marketplace: () => string;
    getTerminals: () => Promise<TDSExecutionResult>;
    getTerminalById: (id: string) => Promise<TDSExecutionResult>;
    _lambda: () => string;
    getLambdaPrefixes: () => Promise<PlainObject<V1_LambdaPrefix>[]>;
    getClassifierPathMap: () => Promise<ClassifierPathMapping[]>;
    getSubtypeInfo: () => Promise<SubtypeInfo>;
    transformTdsToRelation_lambda: (input: PlainObject<V1_LambdaTdsToRelationInput>) => Promise<PlainObject<V1_RawLambda>>;
    createPrototypeProject: () => Promise<{
        projectId: string;
        webUrl: string | undefined;
        owner: string;
    }>;
    validUserAccessRole: (userId: string) => Promise<boolean>;
    _grammarToJSON: () => string;
    grammarToJSON_model: (input: string, sourceId?: string | undefined, lineOffset?: number | undefined, returnSourceInformation?: boolean | undefined) => Promise<PlainObject<V1_PureModelContextData>>;
    grammarToJSON_lambda: (input: string, sourceId?: string | undefined, lineOffset?: number | undefined, columnOffset?: number | undefined, returnSourceInformation?: boolean | undefined) => Promise<PlainObject<V1_RawLambda>>;
    grammarToJSON_lambda_batch: (input: Record<string, V1_GrammarParserBatchInputEntry>) => Promise<{
        errors?: Record<string, PlainObject<V1_ParserError>> | undefined;
        result?: Record<string, PlainObject<V1_RawLambda>> | undefined;
    }>;
    grammarToJSON_valueSpecification_batch: (input: Record<string, V1_GrammarParserBatchInputEntry>) => Promise<{
        errors?: Record<string, PlainObject<V1_ParserError>> | undefined;
        result?: Record<string, PlainObject<V1_ValueSpecification>> | undefined;
    }>;
    grammarToJSON_valueSpecification: (input: string, sourceId?: string | undefined, lineOffset?: number | undefined, columnOffset?: number | undefined, returnSourceInformation?: boolean | undefined) => Promise<PlainObject<V1_ValueSpecification>>;
    grammarToJSON_relationalOperationElement: (input: string, sourceId?: string | undefined, lineOffset?: number | undefined, columnOffset?: number | undefined, returnSourceInformation?: boolean | undefined) => Promise<PlainObject<V1_RawRelationalOperationElement>>;
    grammarToJSON_relationalOperationElement_batch: (input: Record<string, V1_GrammarParserBatchInputEntry>) => Promise<{
        errors?: Record<string, PlainObject<V1_ParserError>> | undefined;
        result?: Record<string, PlainObject<V1_RawRelationalOperationElement>> | undefined;
    }>;
    _JSONToGrammar: () => string;
    JSONToGrammar_model: (input: PlainObject<V1_PureModelContextData>, renderStyle?: V1_RenderStyle | undefined) => Promise<string>;
    JSONToGrammar_lambda: (input: PlainObject<V1_RawLambda>, renderStyle?: V1_RenderStyle | undefined) => Promise<string>;
    JSONToGrammar_lambda_batch: (input: Record<string, PlainObject<V1_RawLambda>>, renderStyle?: V1_RenderStyle | undefined) => Promise<Record<string, string>>;
    JSONToGrammar_valueSpecification_batch: (input: Record<string, PlainObject<V1_ValueSpecification>>, renderStyle?: V1_RenderStyle | undefined) => Promise<Record<string, string>>;
    JSONToGrammar_valueSpecification: (input: PlainObject<V1_ValueSpecification>, renderStyle?: V1_RenderStyle | undefined) => Promise<string>;
    JSONToGrammar_relationalOperationElement: (input: PlainObject<V1_RawRelationalOperationElement>, renderStyle?: V1_RenderStyle | undefined) => Promise<string>;
    JSONToGrammar_relationalOperationElement_batch: (input: Record<string, PlainObject<V1_RawRelationalOperationElement>>, renderStyle?: V1_RenderStyle | undefined) => Promise<Record<string, string>>;
    runTests: (input: PlainObject<V1_RunTestsInput>) => Promise<PlainObject<V1_RunTestsResult>>;
    debugTests: (input: PlainObject<V1_RunTestsInput>) => Promise<PlainObject<V1_DebugTestsResult>>;
    _externalFormats: () => string;
    getAvailableExternalFormatsDescriptions: () => Promise<PlainObject<V1_ExternalFormatDescription>[]>;
    generateModel: (input: PlainObject<V1_ExternalFormatModelGenerationInput>) => Promise<PlainObject<V1_PureModelContextData>[]>;
    generateSchema: (input: PlainObject<V1_GenerateSchemaInput>) => Promise<PlainObject<V1_PureModelContextData>[]>;
    getAvailableCodeImportDescriptions: () => Promise<PlainObject<V1_ImportConfigurationDescription>[]>;
    getAvailableSchemaImportDescriptions: () => Promise<PlainObject<V1_ImportConfigurationDescription>[]>;
    getAvailableCodeGenerationDescriptions: () => Promise<PlainObject<V1_GenerationConfigurationDescription>[]>;
    generateFile: (mode: GenerationMode, type: string, input: PlainObject<V1_GenerateFileInput>) => Promise<PlainObject<V1_GenerationOutput>[]>;
    generateAritfacts: (input: PlainObject<V1_ArtifactGenerationExtensionInput>) => Promise<PlainObject<V1_ArtifactGenerationExtensionOutput>>;
    getAvailableSchemaGenerationDescriptions: () => Promise<PlainObject<V1_GenerationConfigurationDescription>[]>;
    _testDataGeneration: () => string;
    generateTestData(input: PlainObject<V1_TestDataGenerationInput>): Promise<PlainObject<V1_TestDataGenerationResult>>;
    compile: (input: PlainObject<V1_PureModelContext>) => Promise<PlainObject<V1_CompileResult>>;
    lambdaReturnType: (input: PlainObject<V1_LambdaReturnTypeInput>) => Promise<PlainObject<V1_LambdaReturnTypeResult>>;
    lambdaRelationType: (input: PlainObject<V1_LambdaReturnTypeInput>, options?: {
        abortController?: AbortController | undefined;
    }) => Promise<PlainObject<V1_RelationType>>;
    completeCode: (input: PlainObject<V1_CompleteCodeInput>) => Promise<PlainObject<CodeCompletionResult>>;
    _execution: () => string;
    _executionManager: () => string;
    runQuery: (input: PlainObject<V1_ExecuteInput>, options?: {
        returnAsResponse?: boolean;
        serializationFormat?: EXECUTION_SERIALIZATION_FORMAT | undefined;
        abortController?: AbortController | undefined;
        tracingTags?: PlainObject | undefined;
    }) => Promise<PlainObject<V1_ExecutionResult> | Response>;
    generateLineage: (input: PlainObject<V1_ExecuteInput>) => Promise<PlainObject<V1_RawLineageModel>>;
    generatePlan: (input: PlainObject<V1_ExecuteInput>) => Promise<PlainObject<V1_ExecutionPlan>>;
    debugPlanGeneration: (input: PlainObject<V1_ExecuteInput>) => Promise<{
        plan: PlainObject<V1_ExecutionPlan>;
        debug: string[];
    }>;
    generateTestDataWithDefaultSeed: (input: PlainObject<V1_ExecuteInput>) => Promise<string>;
    generateTestDataWithSeed: (input: PlainObject<V1_ExecuteInput>) => Promise<string>;
    /**
     * TODO: this is an internal API that should me refactored out using extension mechanism
     */
    INTERNAL__cancelUserExecutions: (userID: string, broadcastToCluster: boolean) => Promise<string>;
    _query: (queryId?: string) => string;
    searchQueries: (searchSpecification: PlainObject<V1_QuerySearchSpecification>) => Promise<PlainObject<V1_LightQuery>[]>;
    getQueries: (queryIds: string[]) => Promise<PlainObject<V1_LightQuery>[]>;
    getQuery: (queryId: string) => Promise<PlainObject<V1_Query>>;
    createQuery: (query: PlainObject<V1_Query>) => Promise<PlainObject<V1_Query>>;
    updateQuery: (queryId: string, query: PlainObject<V1_Query>) => Promise<PlainObject<V1_Query>>;
    patchQuery: (queryId: string, query: PlainObject<Partial<V1_Query>>) => Promise<PlainObject<V1_Query>>;
    deleteQuery: (queryId: string) => Promise<PlainObject<V1_Query>>;
    _dataCube: (id?: string) => string;
    searchDataCubes: (searchSpecification: PlainObject<V1_QuerySearchSpecification>) => Promise<PlainObject<PersistentDataCube>[]>;
    getDataCubes: (ids: string[]) => Promise<PlainObject<PersistentDataCube>[]>;
    getDataCube: (id: string) => Promise<PlainObject<PersistentDataCube>>;
    createDataCube: (dataCube: PlainObject<PersistentDataCube>) => Promise<PlainObject<PersistentDataCube>>;
    updateDataCube: (id: string, dataCube: PlainObject<PersistentDataCube>) => Promise<PlainObject<PersistentDataCube>>;
    deleteDataCube: (id: string) => Promise<PlainObject<PersistentDataCube>>;
    analyzeMappingModelCoverage: (input: PlainObject<V1_MappingModelCoverageAnalysisInput>) => Promise<PlainObject<V1_MappingModelCoverageAnalysisResult>>;
    surveyDatasets: (input: PlainObject<V1_StoreEntitlementAnalysisInput>) => Promise<PlainObject<V1_SurveyDatasetsResult>>;
    checkDatasetEntitlements: (input: PlainObject<V1_EntitlementReportAnalyticsInput>) => Promise<PlainObject<V1_CheckEntitlementsResult>>;
    _databaseUtilities: () => string;
    buildDatabase: (input: PlainObject<V1_DatabaseBuilderInput>) => Promise<PlainObject<V1_PureModelContextData>>;
    executeRawSQL: (input: PlainObject<V1_RawSQLExecuteInput>) => Promise<string>;
    _functionActivator: () => string;
    getAvailableFunctionActivators(): Promise<PlainObject<V1_FunctionActivatorInfo>[]>;
    validateFunctionActivator(input: PlainObject<V1_FunctionActivatorInput>): Promise<PlainObject<V1_FunctionActivatorError>>;
    renderFunctionActivatorArtifact(input: PlainObject<V1_FunctionActivatorInput>): Promise<PlainObject>;
    publishFunctionActivatorToSandbox(input: PlainObject<V1_FunctionActivatorInput>): Promise<PlainObject<DeploymentResult>>;
    _relationalElement: () => string;
    generateModelsFromDatabaseSpecification(input: PlainObject<V1_DatabaseToModelGenerationInput>): Promise<PlainObject<V1_PureModelContextData>>;
    getAvailableRelationalDatabaseTypeConfigurations: () => Promise<PlainObject<V1_RelationalConnectionBuilder>[]>;
    _service: (serviceServerUrl?: string) => string;
    /**
     * TODO: this is an internal API that should me refactored out using extension mechanism
     */
    TEMPORARY__getServerServiceInfo: () => Promise<PlainObject<V1_ServiceConfigurationInfo>>;
    /**
     * TODO: this is an internal API that should me refactored out using extension mechanism
     */
    TEMPORARY__getServiceVersionInfo: (serviceServerUrl: string, serviceId: string) => Promise<PlainObject<V1_ServiceStorage>>;
    /**
     * TODO: this is an internal API that should me refactored out using extension mechanism
     */
    TEMPORARY__activateGenerationId: (serviceServerUrl: string, generationId: string) => Promise<Response>;
    runServicePostVal: (servicePath: string, input: PlainObject, assertionId: string) => Promise<PlainObject>;
    private getRegisterServiceUrlFromExecMode;
    /**
     * TODO: this is an internal API that should me refactored out using extension mechanism
     */
    INTERNAL__registerService: (input: PlainObject<V1_PureModelContext>, serviceServerUrl: string, serviceExecutionMode: ServiceExecutionMode, TEMPORARY__useStoreModel: boolean, TEMPORARY__useGenerateLineage: boolean, TEMPORARY__useGenerateOpenApi: boolean) => Promise<PlainObject<V1_ServiceRegistrationResult>>;
    _devMetadata: () => string;
    pushToDevMetadata: (request: PlainObject<V1_DevMetadataPushRequest>) => Promise<PlainObject>;
}
export {};
//# sourceMappingURL=V1_EngineServerClient.d.ts.map