import { ResStatus, KeyValuePair, GrpcTimeOut, TimeStamp, TimeStampArray, resStatusResponse, collectionNameReq } from './Common';
import { CompactionState, DataType, LoadState, DataTypeMap, ShowCollectionsType, FunctionType } from '../';
export interface CollectionData {
    name: string;
    id: string;
    timestamp: string;
    loadedPercentage: string;
}
export interface ShardReplica {
    leaderID: string;
    leader_addr: string;
    dm_channel_name: string;
    node_ids: string[];
}
export interface ReplicaInfo {
    replicaID: string;
    collectionID: string;
    partition_ids: string[];
    shard_replicas: ShardReplica[];
    node_ids: string[];
    resource_group_name: string;
    num_outbound_node: Record<string, number>;
}
export type TypeParam = string | number | boolean | Record<string, any>;
export type TypeParamKey = 'dim' | 'max_length' | 'max_capacity' | 'analyzer_params' | 'enable_analyzer' | 'enable_match' | 'multi_analyzer_params' | 'mmap.enabled';
export type FieldSchema = {
    type_params: KeyValuePair<TypeParamKey, TypeParam>[];
    index_params: KeyValuePair[];
    fieldID: string | number;
    name: string;
    is_primary_key: boolean;
    description: string;
    data_type: keyof typeof DataType;
    autoID: boolean;
    state: string;
    element_type?: keyof typeof DataType;
    default_value?: number | string | null;
    dataType: DataType;
    is_partition_key?: boolean;
    is_dynamic?: boolean;
    is_clustering_key?: boolean;
    nullable?: boolean;
    is_function_output: boolean;
    external_field?: string;
    fields?: FieldSchema[];
} & Partial<Record<TypeParamKey, TypeParam>>;
export type FieldType = {
    name: string;
    description?: string;
    data_type: DataType | keyof typeof DataTypeMap;
    element_type?: DataType | keyof typeof DataTypeMap;
    is_primary_key?: boolean;
    is_partition_key?: boolean;
    is_function_output?: boolean;
    is_clustering_key?: boolean;
    type_params?: Partial<Record<TypeParamKey, TypeParam>>;
    autoID?: boolean;
    default_value?: number | string;
    nullable?: boolean;
    external_field?: string;
    fields?: FieldType[];
} & Partial<Record<TypeParamKey, TypeParam>>;
export interface ShowCollectionsReq extends GrpcTimeOut {
    type?: ShowCollectionsType;
    collection_names?: string[];
    db_name?: string;
}
export type Properties = Record<string, string | number | boolean>;
export type FunctionTypeName = 'Unknown' | 'BM25' | 'TextEmbedding' | 'Rerank' | 'MinHash' | 'MolFingerprint';
export type FunctionObject = {
    name: string;
    description?: string;
    type: FunctionType | FunctionTypeName;
    input_field_names: string[];
    output_field_names?: string[];
    params: Record<string, any>;
};
export interface BaseCreateCollectionReq extends GrpcTimeOut {
    collection_name: string;
    shards_num?: number;
    description?: string;
    consistency_level?: string;
    num_partitions?: number;
    partition_key_field?: string;
    clustering_key_field?: string;
    enable_dynamic_field?: boolean;
    enableDynamicField?: boolean;
    properties?: Properties;
    db_name?: string;
    functions?: FunctionObject[];
    external_source?: string;
    external_spec?: string;
    file_resource_ids?: Array<number | string>;
}
export interface CreateCollectionWithFieldsReq extends BaseCreateCollectionReq {
    fields: FieldType[];
}
export interface CreateCollectionWithSchemaReq extends BaseCreateCollectionReq {
    schema: FieldType[];
}
export type CreateCollectionReq = CreateCollectionWithFieldsReq | CreateCollectionWithSchemaReq;
export interface AddCollectionFieldReq extends collectionNameReq {
    collection_name: string;
    db_name?: string;
    field: FieldType;
}
export interface AddCollectionFieldsReq extends collectionNameReq {
    collection_name: string;
    db_name?: string;
    fields: FieldType[];
}
export interface HasCollectionReq extends collectionNameReq {
}
export interface DescribeCollectionReq extends collectionNameReq {
    cache?: boolean;
}
export interface BatchDescribeCollectionReq extends GrpcTimeOut {
    collection_names: string[];
    db_name?: string;
    collectionIDs?: number[];
}
export interface GetCollectionStatisticsReq extends collectionNameReq {
}
export interface LoadCollectionReq extends collectionNameReq {
    replica_number?: number;
    resource_groups?: string[];
    refresh?: boolean;
    load_fields?: string[];
    skip_load_dynamic_field?: boolean;
}
export interface RefreshLoadReq extends collectionNameReq {
}
export interface ReleaseLoadCollectionReq extends collectionNameReq {
}
export interface DropCollectionReq extends collectionNameReq {
}
export interface CreateAliasReq extends collectionNameReq {
    alias: string;
}
export interface DescribeAliasReq extends CreateAliasReq {
    alias: string;
}
export interface DropAliasReq extends GrpcTimeOut {
    alias: string;
}
export interface AlterAliasReq extends CreateAliasReq {
}
export interface ListAliasesReq extends collectionNameReq {
}
export interface CompactReq extends collectionNameReq {
    timetravel?: number | string;
    majorCompaction?: boolean;
    partition_id?: number | string;
    channel?: string;
    segment_ids?: number[];
    l0Compaction?: boolean;
    target_size?: number | string;
}
export interface GetCompactionStateReq extends GrpcTimeOut {
    compactionID: number | string;
}
export interface GetCompactionPlansReq extends GrpcTimeOut {
    compactionID: number | string;
}
export interface GetReplicaReq extends GrpcTimeOut {
    collectionID: number | string;
    with_shard_nodes?: boolean;
    collection_name?: string;
    db_name?: string;
}
export interface RenameCollectionReq extends collectionNameReq {
    new_collection_name: string;
    new_db_name?: string;
}
export interface BoolResponse extends resStatusResponse {
    value: Boolean;
}
export interface CompactionResponse extends resStatusResponse {
    compactionID: string;
    compactionPlanCount: number;
}
export interface CollectionSchema {
    name: string;
    description: string;
    enable_dynamic_field: boolean;
    autoID: boolean;
    fields: FieldSchema[];
    functions: FunctionObject[];
    struct_array_fields: FieldSchema[];
    external_source?: string;
    external_spec?: string;
    file_resource_ids?: string[];
}
export interface DescribeCollectionResponse extends TimeStamp {
    status: ResStatus;
    schema: CollectionSchema;
    collectionID: string;
    collection_name: string;
    consistency_level: string;
    aliases: string[];
    virtual_channel_names: string[];
    physical_channel_names: string[];
    start_positions: string[];
    properties: KeyValuePair[];
    created_timestamp: string;
    created_utc_timestamp: string;
    shards_num: number;
    num_partitions?: string;
    db_name: string;
    functions: FunctionObject[];
    update_timestamp_str: string;
    update_timestamp: number;
    anns_fields: Record<string, FieldSchema>;
    scalar_fields: Record<string, FieldSchema>;
    function_fields: Record<string, FieldSchema>;
}
export interface BatchDescribeCollectionResponse extends resStatusResponse {
    responses: DescribeCollectionResponse[];
}
export interface GetCompactionPlansResponse extends resStatusResponse {
    state: CompactionState;
    mergeInfos: {
        sources: string[];
        target: string;
    }[];
}
export interface GetCompactionStateResponse extends resStatusResponse {
    state: CompactionState;
    executingPlanNo: string;
    timeoutPlanNo: string;
    completedPlanNo: string;
    failedPlanNo: string;
}
export interface ShowCollectionsResponse extends TimeStampArray {
    status: ResStatus;
    data: CollectionData[];
}
export interface StatisticsResponse extends resStatusResponse {
    stats: KeyValuePair[];
    data: {
        [x: string]: any;
    };
}
export interface ReplicasResponse extends resStatusResponse {
    replicas: ReplicaInfo[];
}
export interface GetLoadingProgressReq extends collectionNameReq {
    partition_names?: string[];
}
export interface GetLoadingProgressResponse extends resStatusResponse {
    progress: string;
}
export interface GetLoadStateReq extends GetLoadingProgressReq {
}
export interface GetLoadStateResponse extends resStatusResponse {
    state: LoadState;
}
export interface AlterCollectionReq extends collectionNameReq {
    properties: Properties;
    delete_keys?: string[];
}
export interface AlterCollectionFieldPropertiesReq extends collectionNameReq {
    field_name: string;
    properties: Properties;
}
export interface DropCollectionPropertiesReq extends collectionNameReq {
    properties: string[];
}
export interface AddCollectionFunctionReq extends collectionNameReq {
    collection_name: string;
    db_name?: string;
    function: FunctionObject;
}
export interface AlterCollectionFunctionReq extends collectionNameReq {
    collection_name: string;
    db_name?: string;
    function_name: string;
    function: FunctionObject;
}
export interface DropCollectionFunctionReq extends collectionNameReq {
    collection_name: string;
    db_name?: string;
    function_name: string;
}
export interface AlterCollectionSchemaReq extends collectionNameReq {
    collection_name: string;
    db_name?: string;
    field: FieldType;
    function: FunctionObject;
    index_name?: string;
    extra_params?: Record<string, any>;
}
export interface AlterCollectionSchemaResponse {
    alter_status: ResStatus;
    /** @deprecated Removed from the AlterCollectionSchema wire response. */
    index_status?: ResStatus;
}
export type FunctionFieldIndexParams = Record<string, any> & ({
    index_type: string;
} | {
    index_type?: never;
    params: (Record<string, any> & {
        index_type: string;
    }) | string;
});
export interface AddFunctionFieldReq extends AlterCollectionSchemaReq {
    extra_params: FunctionFieldIndexParams;
}
export type DropCollectionFieldReq = collectionNameReq & ({
    field_name: string;
    field_id?: never;
} | {
    field_name?: never;
    field_id: number | string;
});
export interface DropFunctionFieldReq extends collectionNameReq {
    function_name: string;
}
export declare enum RefreshExternalCollectionState {
    RefreshPending = "RefreshPending",
    RefreshInProgress = "RefreshInProgress",
    RefreshCompleted = "RefreshCompleted",
    RefreshFailed = "RefreshFailed"
}
export interface RefreshExternalCollectionReq extends collectionNameReq {
    external_source?: string;
    external_spec?: string;
}
export interface RefreshExternalCollectionResponse extends resStatusResponse {
    job_id: string;
}
export interface GetRefreshExternalCollectionProgressReq extends GrpcTimeOut {
    job_id: number | string;
}
export interface RefreshExternalCollectionJobInfo {
    job_id: string;
    collection_name: string;
    state: RefreshExternalCollectionState | keyof typeof RefreshExternalCollectionState;
    progress: string;
    reason: string;
    external_source: string;
    start_time: string;
    end_time: string;
}
export interface GetRefreshExternalCollectionProgressResponse extends resStatusResponse {
    job_info: RefreshExternalCollectionJobInfo;
}
export interface ListRefreshExternalCollectionJobsReq extends GrpcTimeOut {
    db_name?: string;
    collection_name?: string;
}
export interface ListRefreshExternalCollectionJobsResponse extends resStatusResponse {
    jobs: RefreshExternalCollectionJobInfo[];
}
export declare enum RestoreSnapshotState {
    RestoreSnapshotNone = "RestoreSnapshotNone",
    RestoreSnapshotPending = "RestoreSnapshotPending",
    RestoreSnapshotExecuting = "RestoreSnapshotExecuting",
    RestoreSnapshotCompleted = "RestoreSnapshotCompleted",
    RestoreSnapshotFailed = "RestoreSnapshotFailed"
}
export interface CreateSnapshotReq extends collectionNameReq {
    snapshot_name: string;
    description?: string;
    compaction_protection_seconds?: number | string;
}
export interface DropSnapshotReq extends collectionNameReq {
    snapshot_name: string;
}
export interface ListSnapshotsReq extends collectionNameReq {
}
export interface ListSnapshotsResponse extends resStatusResponse {
    snapshots: string[];
}
export interface DescribeSnapshotReq extends collectionNameReq {
    snapshot_name: string;
}
export interface DescribeSnapshotResponse extends resStatusResponse {
    name: string;
    description: string;
    collection_name: string;
    partition_names: string[];
    create_ts: string;
    s3_location: string;
}
export interface RestoreSnapshotReq extends GrpcTimeOut {
    snapshot_name: string;
    source_collection_name: string;
    target_collection_name: string;
    source_db_name?: string;
    target_db_name?: string;
}
export interface RestoreSnapshotResponse extends resStatusResponse {
    job_id: string;
}
export interface GetRestoreSnapshotStateReq extends GrpcTimeOut {
    job_id: number | string;
}
export interface RestoreSnapshotJobInfo {
    job_id: string;
    snapshot_name: string;
    db_name: string;
    collection_name: string;
    state: RestoreSnapshotState | keyof typeof RestoreSnapshotState;
    progress: number;
    reason: string;
    start_time: string;
    time_cost: string;
}
export interface GetRestoreSnapshotStateResponse extends resStatusResponse {
    info: RestoreSnapshotJobInfo;
}
export interface ListRestoreSnapshotJobsReq extends GrpcTimeOut {
    db_name?: string;
    collection_name?: string;
}
export interface ListRestoreSnapshotJobsResponse extends resStatusResponse {
    jobs: RestoreSnapshotJobInfo[];
}
export interface PinSnapshotDataReq extends collectionNameReq {
    snapshot_name: string;
    ttl_seconds?: number | string;
}
export interface PinSnapshotDataResponse extends resStatusResponse {
    pin_id: string;
}
export interface UnpinSnapshotDataReq extends GrpcTimeOut {
    pin_id: number | string;
}
export interface DescribeAliasResponse extends resStatusResponse {
    db_name: string;
    alias: string;
    collection: string;
}
export interface ListAliasesResponse extends resStatusResponse {
    db_name: string;
    aliases: string[];
    collection_name: string;
}
