import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
import type { CallContext, CallOptions } from "nice-grpc-common";
import type { FileDescriptorProto as FileDescriptorProto1 } from "ts-proto-descriptors";
import { Any } from "../../google/protobuf/any";
import { Subject } from "./auth";
import { FilterOp as FilterOp6 } from "./filter";
import { Meta } from "./meta";
import { OperationStatus, Status } from "./status";
export declare const protobufPackage = "io.restorecommerce.resourcebase";
export interface FieldFilter {
    name?: string | undefined;
    include?: boolean | undefined;
}
export interface Sort {
    field?: string | undefined;
    order?: Sort_SortOrder | undefined;
}
export declare enum Sort_SortOrder {
    UNSORTED = "UNSORTED",
    ASCENDING = "ASCENDING",
    DESCENDING = "DESCENDING",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function sort_SortOrderFromJSON(object: any): Sort_SortOrder;
export declare function sort_SortOrderToJSON(object: Sort_SortOrder): string;
export declare function sort_SortOrderToNumber(object: Sort_SortOrder): number;
export interface Filter {
    field?: string | undefined;
    operation?: Filter_Operation | undefined;
    value?: string | undefined;
    type?: Filter_ValueType | undefined;
    /** for nested filtering and to make optional its in separate filter.proto file */
    filters?: FilterOp6[] | undefined;
}
export declare enum Filter_Operation {
    eq = "eq",
    lt = "lt",
    lte = "lte",
    gt = "gt",
    gte = "gte",
    isEmpty = "isEmpty",
    iLike = "iLike",
    in = "in",
    neq = "neq",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function filter_OperationFromJSON(object: any): Filter_Operation;
export declare function filter_OperationToJSON(object: Filter_Operation): string;
export declare function filter_OperationToNumber(object: Filter_Operation): number;
export declare enum Filter_ValueType {
    /** STRING - default value type if not specified */
    STRING = "STRING",
    NUMBER = "NUMBER",
    BOOLEAN = "BOOLEAN",
    DATE = "DATE",
    ARRAY = "ARRAY",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function filter_ValueTypeFromJSON(object: any): Filter_ValueType;
export declare function filter_ValueTypeToJSON(object: Filter_ValueType): string;
export declare function filter_ValueTypeToNumber(object: Filter_ValueType): number;
export interface FilterOp {
    filters?: Filter[] | undefined;
    operator?: FilterOp_Operator | undefined;
}
export declare enum FilterOp_Operator {
    and = "and",
    or = "or",
    UNRECOGNIZED = "UNRECOGNIZED"
}
export declare function filterOp_OperatorFromJSON(object: any): FilterOp_Operator;
export declare function filterOp_OperatorToJSON(object: FilterOp_Operator): string;
export declare function filterOp_OperatorToNumber(object: FilterOp_Operator): number;
export interface Search {
    /** search string */
    search?: string | undefined;
    /** list of fields to be searched on entity (if not specified all indexed fields will be searched) */
    fields?: string[] | undefined;
    /** default search is case insensitive */
    case_sensitive?: boolean | undefined;
}
export interface ReadRequest {
    offset?: number | undefined;
    limit?: number | undefined;
    sorts?: Sort[] | undefined;
    /** Filter based on fieldName|operation, value|list */
    filters?: FilterOp[] | undefined;
    /** Fields selector */
    fields?: FieldFilter[] | undefined;
    /**
     * Check the query parameters of HTTP request.
     * If query parameter `locales` is given,
     * return all corresponding localized values.
     * Otherwise, return always the localized value
     * with highest priority.
     * Can be empty, single locale or multiple locales.
     */
    locales_limiter?: string[] | undefined;
    custom_queries?: string[] | undefined;
    custom_arguments?: Any | undefined;
    subject?: Subject | undefined;
    search?: Search | undefined;
}
export interface DeleteRequest {
    /** Request to purge the whole collection */
    collection?: boolean | undefined;
    /** Delete specified documents */
    ids?: string[] | undefined;
    subject?: Subject | undefined;
    /** list of views to be dropped */
    views?: string[] | undefined;
    /** list of analyzers to be deleted */
    analyzers?: string[] | undefined;
}
export interface DeleteResponse {
    status?: Status[] | undefined;
    operation_status?: OperationStatus | undefined;
}
/** / List of resources */
export interface ResourceList {
    items?: Resource[] | undefined;
    total_count?: number | undefined;
    subject?: Subject | undefined;
}
/** ResourceList response */
export interface ResourceListResponse {
    items?: ResourceResponse[] | undefined;
    total_count?: number | undefined;
    operation_status?: OperationStatus | undefined;
}
/** resource read response */
export interface ResourceResponse {
    payload?: Resource | undefined;
    status?: Status | undefined;
}
/** Example resource */
export interface Resource {
    id?: string | undefined;
    meta?: Meta | undefined;
}
export interface Deleted {
    id?: string | undefined;
    collection?: string | undefined;
}
export declare const FieldFilter: MessageFns<FieldFilter>;
export declare const Sort: MessageFns<Sort>;
export declare const Filter: MessageFns<Filter>;
export declare const FilterOp: MessageFns<FilterOp>;
export declare const Search: MessageFns<Search>;
export declare const ReadRequest: MessageFns<ReadRequest>;
export declare const DeleteRequest: MessageFns<DeleteRequest>;
export declare const DeleteResponse: MessageFns<DeleteResponse>;
export declare const ResourceList: MessageFns<ResourceList>;
export declare const ResourceListResponse: MessageFns<ResourceListResponse>;
export declare const ResourceResponse: MessageFns<ResourceResponse>;
export declare const Resource: MessageFns<Resource>;
export declare const Deleted: MessageFns<Deleted>;
/** Service provides the CRUD operations */
export type ServiceDefinition = typeof ServiceDefinition;
export declare const ServiceDefinition: {
    readonly name: "Service";
    readonly fullName: "io.restorecommerce.resourcebase.Service";
    readonly methods: {
        readonly read: {
            readonly name: "Read";
            readonly requestType: typeof ReadRequest;
            readonly requestStream: false;
            readonly responseType: typeof ResourceListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly create: {
            readonly name: "Create";
            readonly requestType: typeof ResourceList;
            readonly requestStream: false;
            readonly responseType: typeof ResourceListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly delete: {
            readonly name: "Delete";
            readonly requestType: typeof DeleteRequest;
            readonly requestStream: false;
            readonly responseType: typeof DeleteResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly update: {
            readonly name: "Update";
            readonly requestType: typeof ResourceList;
            readonly requestStream: false;
            readonly responseType: typeof ResourceListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
        readonly upsert: {
            readonly name: "Upsert";
            readonly requestType: typeof ResourceList;
            readonly requestStream: false;
            readonly responseType: typeof ResourceListResponse;
            readonly responseStream: false;
            readonly options: {};
        };
    };
};
export interface ServiceImplementation<CallContextExt = {}> {
    read(request: ReadRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ResourceListResponse>>;
    create(request: ResourceList, context: CallContext & CallContextExt): Promise<DeepPartial<ResourceListResponse>>;
    delete(request: DeleteRequest, context: CallContext & CallContextExt): Promise<DeepPartial<DeleteResponse>>;
    update(request: ResourceList, context: CallContext & CallContextExt): Promise<DeepPartial<ResourceListResponse>>;
    upsert(request: ResourceList, context: CallContext & CallContextExt): Promise<DeepPartial<ResourceListResponse>>;
}
export interface ServiceClient<CallOptionsExt = {}> {
    read(request: DeepPartial<ReadRequest>, options?: CallOptions & CallOptionsExt): Promise<ResourceListResponse>;
    create(request: DeepPartial<ResourceList>, options?: CallOptions & CallOptionsExt): Promise<ResourceListResponse>;
    delete(request: DeepPartial<DeleteRequest>, options?: CallOptions & CallOptionsExt): Promise<DeleteResponse>;
    update(request: DeepPartial<ResourceList>, options?: CallOptions & CallOptionsExt): Promise<ResourceListResponse>;
    upsert(request: DeepPartial<ResourceList>, options?: CallOptions & CallOptionsExt): Promise<ResourceListResponse>;
}
type ProtoMetaMessageOptions = {
    options?: {
        [key: string]: any;
    };
    fields?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    oneof?: {
        [key: string]: {
            [key: string]: any;
        };
    };
    nested?: {
        [key: string]: ProtoMetaMessageOptions;
    };
};
export interface ProtoMetadata {
    fileDescriptor: FileDescriptorProto1;
    references: {
        [key: string]: any;
    };
    dependencies?: ProtoMetadata[];
    options?: {
        options?: {
            [key: string]: any;
        };
        services?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                methods?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
        messages?: {
            [key: string]: ProtoMetaMessageOptions;
        };
        enums?: {
            [key: string]: {
                options?: {
                    [key: string]: any;
                };
                values?: {
                    [key: string]: {
                        [key: string]: any;
                    };
                };
            };
        };
    };
}
export declare const protoMetadata: ProtoMetadata;
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
    [K in keyof T]?: DeepPartial<T[K]>;
} : Partial<T>;
export interface MessageFns<T> {
    encode(message: T, writer?: BinaryWriter): BinaryWriter;
    decode(input: BinaryReader | Uint8Array, length?: number): T;
    fromJSON(object: any): T;
    toJSON(message: T): unknown;
    create(base?: DeepPartial<T>): T;
    fromPartial(object: DeepPartial<T>): T;
}
export {};
//# sourceMappingURL=resource_base.d.ts.map