// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "executionflowQuery.proto" (package "api", syntax proto3)
// tslint:disable
import { CountLinesResult } from "./shared";
import { CountLinesQuery } from "./shared";
import { GetKPIDataResult } from "./clickhouse";
import { GetKPIDataQuery } from "./clickhouse";
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { BlockFilter } from "./shared";
import { Executionflow } from "./executionflow";
import { ResultHeader } from "./shared";
import { EntityID } from "./shared";
import { QueryProjectHeader } from "./shared";
// 
// Query-server services

/**
 * @generated from protobuf message api.ExecutionflowByIdQuery
 */
export interface ExecutionflowByIdQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * @generated from protobuf field: repeated api.EntityID IDs = 2 [json_name = "IDs"];
     */
    iDs: EntityID[];
}
/**
 * @generated from protobuf message api.ExecutionflowByIdResult
 */
export interface ExecutionflowByIdResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * @generated from protobuf field: repeated api.Executionflow Objects = 2 [json_name = "Objects"];
     */
    objects: Executionflow[];
}
/**
 * @generated from protobuf message api.ExecutionflowByFilterQuery
 */
export interface ExecutionflowByFilterQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * Number of maximum result
     *
     * @generated from protobuf field: string limitFilter = 4;
     */
    limitFilter: string;
    /**
     * @generated from protobuf field: string queryContext = 5;
     */
    queryContext: string;
    /**
     * list of blockFilters structure for Find query, each element (BlockFilter) in the list is an "OR" part of the query, if not empty, simpleFilters (deprecated) & rangeFilters (deprecated) will be ignored
     *
     * @generated from protobuf field: repeated api.BlockFilter BlockFilters = 6 [json_name = "BlockFilters"];
     */
    blockFilters: BlockFilter[];
}
/**
 * @generated from protobuf message api.ExecutionflowByFilterResult
 */
export interface ExecutionflowByFilterResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * @generated from protobuf field: repeated api.Executionflow Objects = 2 [json_name = "Objects"];
     */
    objects: Executionflow[];
    /**
     * @generated from protobuf field: string queryContext = 3;
     */
    queryContext: string;
}
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionflowByIdQuery$Type extends MessageType<ExecutionflowByIdQuery> {
    constructor() {
        super("api.ExecutionflowByIdQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "IDs", kind: "message", jsonName: "IDs", repeat: 1 /*RepeatType.PACKED*/, T: () => EntityID, options: { "validate.rules": { repeated: { minItems: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "IDs"] } }, "api.messageType": "Query" });
    }
    create(value?: PartialMessage<ExecutionflowByIdQuery>): ExecutionflowByIdQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.iDs = [];
        if (value !== undefined)
            reflectionMergePartial<ExecutionflowByIdQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExecutionflowByIdQuery): ExecutionflowByIdQuery {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.QueryProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = QueryProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* repeated api.EntityID IDs = 2 [json_name = "IDs"];*/ 2:
                    message.iDs.push(EntityID.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: ExecutionflowByIdQuery, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.QueryProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            QueryProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.EntityID IDs = 2 [json_name = "IDs"]; */
        for (let i = 0; i < message.iDs.length; i++)
            EntityID.internalBinaryWrite(message.iDs[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ExecutionflowByIdQuery
 */
export const ExecutionflowByIdQuery = new ExecutionflowByIdQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionflowByIdResult$Type extends MessageType<ExecutionflowByIdResult> {
    constructor() {
        super("api.ExecutionflowByIdResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Executionflow }
        ], { "api.messageType": "Result" });
    }
    create(value?: PartialMessage<ExecutionflowByIdResult>): ExecutionflowByIdResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        if (value !== undefined)
            reflectionMergePartial<ExecutionflowByIdResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExecutionflowByIdResult): ExecutionflowByIdResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResultHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResultHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* repeated api.Executionflow Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Executionflow.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: ExecutionflowByIdResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResultHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResultHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.Executionflow Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Executionflow.internalBinaryWrite(message.objects[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ExecutionflowByIdResult
 */
export const ExecutionflowByIdResult = new ExecutionflowByIdResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionflowByFilterQuery$Type extends MessageType<ExecutionflowByFilterQuery> {
    constructor() {
        super("api.ExecutionflowByFilterQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 4, name: "limitFilter", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Number of maximum result", example: "\"500\"" } } },
            { no: 5, name: "queryContext", kind: "scalar", T: 9 /*ScalarType.STRING*/ },
            { no: 6, name: "BlockFilters", kind: "message", jsonName: "BlockFilters", repeat: 1 /*RepeatType.PACKED*/, T: () => BlockFilter }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
    }
    create(value?: PartialMessage<ExecutionflowByFilterQuery>): ExecutionflowByFilterQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.limitFilter = "";
        message.queryContext = "";
        message.blockFilters = [];
        if (value !== undefined)
            reflectionMergePartial<ExecutionflowByFilterQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExecutionflowByFilterQuery): ExecutionflowByFilterQuery {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.QueryProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = QueryProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* string limitFilter */ 4:
                    message.limitFilter = reader.string();
                    break;
                case /* string queryContext */ 5:
                    message.queryContext = reader.string();
                    break;
                case /* repeated api.BlockFilter BlockFilters = 6 [json_name = "BlockFilters"];*/ 6:
                    message.blockFilters.push(BlockFilter.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: ExecutionflowByFilterQuery, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.QueryProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            QueryProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string limitFilter = 4; */
        if (message.limitFilter !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.limitFilter);
        /* string queryContext = 5; */
        if (message.queryContext !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.queryContext);
        /* repeated api.BlockFilter BlockFilters = 6 [json_name = "BlockFilters"]; */
        for (let i = 0; i < message.blockFilters.length; i++)
            BlockFilter.internalBinaryWrite(message.blockFilters[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ExecutionflowByFilterQuery
 */
export const ExecutionflowByFilterQuery = new ExecutionflowByFilterQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionflowByFilterResult$Type extends MessageType<ExecutionflowByFilterResult> {
    constructor() {
        super("api.ExecutionflowByFilterResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Executionflow },
            { no: 3, name: "queryContext", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<ExecutionflowByFilterResult>): ExecutionflowByFilterResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        message.queryContext = "";
        if (value !== undefined)
            reflectionMergePartial<ExecutionflowByFilterResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExecutionflowByFilterResult): ExecutionflowByFilterResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResultHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResultHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* repeated api.Executionflow Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Executionflow.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* string queryContext */ 3:
                    message.queryContext = reader.string();
                    break;
                default:
                    let u = options.readUnknownField;
                    if (u === "throw")
                        throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
                    let d = reader.skip(wireType);
                    if (u !== false)
                        (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
            }
        }
        return message;
    }
    internalBinaryWrite(message: ExecutionflowByFilterResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResultHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResultHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.Executionflow Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Executionflow.internalBinaryWrite(message.objects[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* string queryContext = 3; */
        if (message.queryContext !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.queryContext);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ExecutionflowByFilterResult
 */
export const ExecutionflowByFilterResult = new ExecutionflowByFilterResult$Type();
/**
 * @generated ServiceType for protobuf service api.ExecutionflowQuery
 */
export const ExecutionflowQuery = new ServiceType("api.ExecutionflowQuery", [
    { name: "GetByIds", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["ExecutionFlow Query"], description: "Get Execution Flows from RefIDs" }, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "api.moduleID": "order-tracking", "api.tableName": "executionflowById", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ExecutionflowByIdQuery, O: ExecutionflowByIdResult },
    { name: "GetKPIData", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["ExecutionFlow Query"], description: "Get Execution Flows KPI data" }, "api.rscType": "Project", "api.roles": "", "api.moduleID": "order-tracking", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: GetKPIDataQuery, O: GetKPIDataResult },
    { name: "CountLines", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["ExecutionFlow Query"], description: "Count lines in database for project" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Query", "api.moduleID": "order-tracking", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: CountLinesQuery, O: CountLinesResult },
    { name: "Find", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["ExecutionFlow Query"], description: "Find Execution flows using search criterias" }, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "api.moduleID": "order-tracking", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: ExecutionflowByFilterQuery, O: ExecutionflowByFilterResult }
], { "api.serviceType": "Query", "api.k8sService": "query-server" });
