// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "itemQuery.proto" (package "api", syntax proto3)
// tslint:disable
import { CountLinesResult } from "./shared";
import { CountLinesQuery } from "./shared";
import { ExtractResult } from "./shared";
import { ExtractQuery } from "./shared";
import { ElementByMatchResult } from "./shared";
import { ElementByMatchQuery } from "./shared";
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 { LVDetailedQuantity } from "./repositoryShared";
import { MatchFieldResult } from "./shared";
import { MatchField } from "./shared";
import { BlockFilter } from "./shared";
import { Item } from "./item";
import { ResultHeader } from "./shared";
import { EntityID } from "./shared";
import { QueryProjectHeader } from "./shared";
// 
// Query-server services

/**
 * @generated from protobuf message api.ItemByIdQuery
 */
export interface ItemByIdQuery {
    /**
     * @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.ItemByIdResult
 */
export interface ItemByIdResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * Aggregation object message
     *
     * @generated from protobuf field: repeated api.Item Objects = 2 [json_name = "Objects"];
     */
    objects: Item[];
}
/**
 * @generated from protobuf message api.ItemByFilterQuery
 */
export interface ItemByFilterQuery {
    /**
     * @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.ItemByFilterResult
 */
export interface ItemByFilterResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * @generated from protobuf field: repeated api.Item Objects = 2 [json_name = "Objects"];
     */
    objects: Item[];
    /**
     * @generated from protobuf field: string queryContext = 3;
     */
    queryContext: string;
}
/**
 * @generated from protobuf message api.ItemByMatchQuery
 */
export interface ItemByMatchQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * 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 = 5 [json_name = "BlockFilters"];
     */
    blockFilters: BlockFilter[];
    /**
     * MatchField list structure, for FindMatching query
     *
     * @generated from protobuf field: repeated api.MatchField MatchFields = 6 [json_name = "MatchFields"];
     */
    matchFields: MatchField[];
}
/**
 * @generated from protobuf message api.ItemByMatchResult
 */
export interface ItemByMatchResult {
    /**
     * @generated from protobuf field: repeated api.MatchFieldResult MatchResults = 2 [json_name = "MatchResults"];
     */
    matchResults: MatchFieldResult[];
}
/**
 * @generated from protobuf message api.GetLVDetailedQuantityQuery
 */
export interface GetLVDetailedQuantityQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: string LVBranchID = 3 [json_name = "LVBranchID"];
     */
    lVBranchID: string;
    /**
     * @generated from protobuf field: float quantityInbaseLv = 4;
     */
    quantityInbaseLv: number;
}
/**
 * @generated from protobuf message api.GetLVDetailedQuantityResult
 */
export interface GetLVDetailedQuantityResult {
    /**
     * @generated from protobuf field: repeated api.LVDetailedQuantity LVDetailedQuantity = 1 [json_name = "LVDetailedQuantity"];
     */
    lVDetailedQuantity: LVDetailedQuantity[];
}
// @generated message type with reflection information, may provide speed optimized methods
class ItemByIdQuery$Type extends MessageType<ItemByIdQuery> {
    constructor() {
        super("api.ItemByIdQuery", [
            { 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<ItemByIdQuery>): ItemByIdQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.iDs = [];
        if (value !== undefined)
            reflectionMergePartial<ItemByIdQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ItemByIdQuery): ItemByIdQuery {
        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: ItemByIdQuery, 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.ItemByIdQuery
 */
export const ItemByIdQuery = new ItemByIdQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ItemByIdResult$Type extends MessageType<ItemByIdResult> {
    constructor() {
        super("api.ItemByIdResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Item, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Aggregation object message" } } }
        ], { "api.messageType": "Result" });
    }
    create(value?: PartialMessage<ItemByIdResult>): ItemByIdResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        if (value !== undefined)
            reflectionMergePartial<ItemByIdResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ItemByIdResult): ItemByIdResult {
        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.Item Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Item.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: ItemByIdResult, 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.Item Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Item.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.ItemByIdResult
 */
export const ItemByIdResult = new ItemByIdResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ItemByFilterQuery$Type extends MessageType<ItemByFilterQuery> {
    constructor() {
        super("api.ItemByFilterQuery", [
            { 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<ItemByFilterQuery>): ItemByFilterQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.limitFilter = "";
        message.queryContext = "";
        message.blockFilters = [];
        if (value !== undefined)
            reflectionMergePartial<ItemByFilterQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ItemByFilterQuery): ItemByFilterQuery {
        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: ItemByFilterQuery, 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.ItemByFilterQuery
 */
export const ItemByFilterQuery = new ItemByFilterQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ItemByFilterResult$Type extends MessageType<ItemByFilterResult> {
    constructor() {
        super("api.ItemByFilterResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Item },
            { no: 3, name: "queryContext", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<ItemByFilterResult>): ItemByFilterResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        message.queryContext = "";
        if (value !== undefined)
            reflectionMergePartial<ItemByFilterResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ItemByFilterResult): ItemByFilterResult {
        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.Item Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Item.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: ItemByFilterResult, 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.Item Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Item.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.ItemByFilterResult
 */
export const ItemByFilterResult = new ItemByFilterResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ItemByMatchQuery$Type extends MessageType<ItemByMatchQuery> {
    constructor() {
        super("api.ItemByMatchQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 5, name: "BlockFilters", kind: "message", jsonName: "BlockFilters", repeat: 1 /*RepeatType.PACKED*/, T: () => BlockFilter },
            { no: 6, name: "MatchFields", kind: "message", jsonName: "MatchFields", repeat: 1 /*RepeatType.PACKED*/, T: () => MatchField, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "MatchField list structure, for FindMatching query" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
    }
    create(value?: PartialMessage<ItemByMatchQuery>): ItemByMatchQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.blockFilters = [];
        message.matchFields = [];
        if (value !== undefined)
            reflectionMergePartial<ItemByMatchQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ItemByMatchQuery): ItemByMatchQuery {
        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.BlockFilter BlockFilters = 5 [json_name = "BlockFilters"];*/ 5:
                    message.blockFilters.push(BlockFilter.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated api.MatchField MatchFields = 6 [json_name = "MatchFields"];*/ 6:
                    message.matchFields.push(MatchField.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: ItemByMatchQuery, 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.BlockFilter BlockFilters = 5 [json_name = "BlockFilters"]; */
        for (let i = 0; i < message.blockFilters.length; i++)
            BlockFilter.internalBinaryWrite(message.blockFilters[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.MatchField MatchFields = 6 [json_name = "MatchFields"]; */
        for (let i = 0; i < message.matchFields.length; i++)
            MatchField.internalBinaryWrite(message.matchFields[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.ItemByMatchQuery
 */
export const ItemByMatchQuery = new ItemByMatchQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ItemByMatchResult$Type extends MessageType<ItemByMatchResult> {
    constructor() {
        super("api.ItemByMatchResult", [
            { no: 2, name: "MatchResults", kind: "message", jsonName: "MatchResults", repeat: 1 /*RepeatType.PACKED*/, T: () => MatchFieldResult }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: {} } });
    }
    create(value?: PartialMessage<ItemByMatchResult>): ItemByMatchResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.matchResults = [];
        if (value !== undefined)
            reflectionMergePartial<ItemByMatchResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ItemByMatchResult): ItemByMatchResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.MatchFieldResult MatchResults = 2 [json_name = "MatchResults"];*/ 2:
                    message.matchResults.push(MatchFieldResult.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: ItemByMatchResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.MatchFieldResult MatchResults = 2 [json_name = "MatchResults"]; */
        for (let i = 0; i < message.matchResults.length; i++)
            MatchFieldResult.internalBinaryWrite(message.matchResults[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.ItemByMatchResult
 */
export const ItemByMatchResult = new ItemByMatchResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetLVDetailedQuantityQuery$Type extends MessageType<GetLVDetailedQuantityQuery> {
    constructor() {
        super("api.GetLVDetailedQuantityQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "LVBranchID", kind: "scalar", jsonName: "LVBranchID", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "quantityInbaseLv", kind: "scalar", T: 2 /*ScalarType.FLOAT*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Quantity in base LV to detail" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header, ID"] } } });
    }
    create(value?: PartialMessage<GetLVDetailedQuantityQuery>): GetLVDetailedQuantityQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.lVBranchID = "";
        message.quantityInbaseLv = 0;
        if (value !== undefined)
            reflectionMergePartial<GetLVDetailedQuantityQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetLVDetailedQuantityQuery): GetLVDetailedQuantityQuery {
        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 /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* string LVBranchID = 3 [json_name = "LVBranchID"];*/ 3:
                    message.lVBranchID = reader.string();
                    break;
                case /* float quantityInbaseLv */ 4:
                    message.quantityInbaseLv = reader.float();
                    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: GetLVDetailedQuantityQuery, 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();
        /* api.EntityID ID = 2 [json_name = "ID"]; */
        if (message.iD)
            EntityID.internalBinaryWrite(message.iD, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* string LVBranchID = 3 [json_name = "LVBranchID"]; */
        if (message.lVBranchID !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.lVBranchID);
        /* float quantityInbaseLv = 4; */
        if (message.quantityInbaseLv !== 0)
            writer.tag(4, WireType.Bit32).float(message.quantityInbaseLv);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetLVDetailedQuantityQuery
 */
export const GetLVDetailedQuantityQuery = new GetLVDetailedQuantityQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetLVDetailedQuantityResult$Type extends MessageType<GetLVDetailedQuantityResult> {
    constructor() {
        super("api.GetLVDetailedQuantityResult", [
            { no: 1, name: "LVDetailedQuantity", kind: "message", jsonName: "LVDetailedQuantity", repeat: 1 /*RepeatType.PACKED*/, T: () => LVDetailedQuantity }
        ]);
    }
    create(value?: PartialMessage<GetLVDetailedQuantityResult>): GetLVDetailedQuantityResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.lVDetailedQuantity = [];
        if (value !== undefined)
            reflectionMergePartial<GetLVDetailedQuantityResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetLVDetailedQuantityResult): GetLVDetailedQuantityResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.LVDetailedQuantity LVDetailedQuantity = 1 [json_name = "LVDetailedQuantity"];*/ 1:
                    message.lVDetailedQuantity.push(LVDetailedQuantity.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: GetLVDetailedQuantityResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.LVDetailedQuantity LVDetailedQuantity = 1 [json_name = "LVDetailedQuantity"]; */
        for (let i = 0; i < message.lVDetailedQuantity.length; i++)
            LVDetailedQuantity.internalBinaryWrite(message.lVDetailedQuantity[i], writer.tag(1, 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.GetLVDetailedQuantityResult
 */
export const GetLVDetailedQuantityResult = new GetLVDetailedQuantityResult$Type();
/**
 * @generated ServiceType for protobuf service api.ItemQuery
 */
export const ItemQuery = new ServiceType("api.ItemQuery", [
    { name: "GetByIds", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Item Query"], description: "Get Items from Ids" }, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "api.tableName": "itemById", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ItemByIdQuery, O: ItemByIdResult },
    { name: "Find", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Item Query"], description: "Find Items using search criterias" }, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ItemByFilterQuery, O: ItemByFilterResult },
    { name: "FindMatchingFieldValues", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Item Query"], description: "using search criteria & a main field word, find the list of fields containing the searched word (used for auto completion purposes ...) " }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ItemByMatchQuery, O: ItemByMatchResult },
    { name: "FindMatchingFieldElements", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Item Query"], description: "using search criteria & a main field word, find the list of field elements containing the searched word (used for auto completion purposes ...) " }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ElementByMatchQuery, O: ElementByMatchResult },
    { name: "Extract", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Item Query"], description: "Schedule a data extraction" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ExtractQuery, O: ExtractResult },
    { name: "CountLines", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Item Query"], description: "Count lines in database for project" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Query", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: CountLinesQuery, O: CountLinesResult },
    { name: "GetLVDetailedQuantity", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Item Query"], description: "Get quantity by Item LVs" }, "api.customQuery": true, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: GetLVDetailedQuantityQuery, O: GetLVDetailedQuantityResult }
], { "api.serviceType": "Query", "api.k8sService": "query-server" });
