// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "movementQuery.proto" (package "api", syntax proto3)
// tslint:disable
import { CountLinesResult } from "./shared";
import { CountLinesQuery } from "./shared";
import { ExtractResult } from "./shared";
import { ExtractQuery } from "./shared";
import { GetKPIDataResult } from "./clickhouse";
import { GetKPIDataQuery } from "./clickhouse";
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 { MatchFieldResult } from "./shared";
import { MatchField } from "./shared";
import { BlockFilter } from "./shared";
import { Movement } from "./movement";
import { ResultHeader } from "./shared";
import { EntityID } from "./shared";
import { QueryProjectHeader } from "./shared";
// 
// Query-server services

/**
 * @generated from protobuf message api.MovementByIdQuery
 */
export interface MovementByIdQuery {
    /**
     * @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.MovementByIdResult
 */
export interface MovementByIdResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * @generated from protobuf field: repeated api.Movement Objects = 2 [json_name = "Objects"];
     */
    objects: Movement[];
}
/**
 * @generated from protobuf message api.MovementByFilterQuery
 */
export interface MovementByFilterQuery {
    /**
     * @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 = 7 [json_name = "BlockFilters"];
     */
    blockFilters: BlockFilter[];
}
/**
 * @generated from protobuf message api.MovementByFilterResult
 */
export interface MovementByFilterResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * @generated from protobuf field: repeated api.Movement Objects = 2 [json_name = "Objects"];
     */
    objects: Movement[];
    /**
     * @generated from protobuf field: string queryContext = 3;
     */
    queryContext: string;
}
/**
 * @generated from protobuf message api.MovementByMatchQuery
 */
export interface MovementByMatchQuery {
    /**
     * @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.MovementByMatchResult
 */
export interface MovementByMatchResult {
    /**
     * @generated from protobuf field: repeated api.MatchFieldResult MatchResults = 2 [json_name = "MatchResults"];
     */
    matchResults: MatchFieldResult[];
}
/**
 * @generated from protobuf message api.MovementByOperationReferenceQuery
 */
export interface MovementByOperationReferenceQuery {
    /**
     * @generated from protobuf field: api.QueryProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: QueryProjectHeader;
    /**
     * @generated from protobuf field: repeated string OperationReferences = 2 [json_name = "OperationReferences"];
     */
    operationReferences: string[];
}
/**
 * @generated from protobuf message api.MovementByOperationReferenceResult
 */
export interface MovementByOperationReferenceResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * @generated from protobuf field: repeated api.Movement Objects = 2 [json_name = "Objects"];
     */
    objects: Movement[];
}
// @generated message type with reflection information, may provide speed optimized methods
class MovementByIdQuery$Type extends MessageType<MovementByIdQuery> {
    constructor() {
        super("api.MovementByIdQuery", [
            { 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<MovementByIdQuery>): MovementByIdQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.iDs = [];
        if (value !== undefined)
            reflectionMergePartial<MovementByIdQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByIdQuery): MovementByIdQuery {
        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: MovementByIdQuery, 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.MovementByIdQuery
 */
export const MovementByIdQuery = new MovementByIdQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementByIdResult$Type extends MessageType<MovementByIdResult> {
    constructor() {
        super("api.MovementByIdResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Movement }
        ], { "api.messageType": "Result" });
    }
    create(value?: PartialMessage<MovementByIdResult>): MovementByIdResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        if (value !== undefined)
            reflectionMergePartial<MovementByIdResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByIdResult): MovementByIdResult {
        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.Movement Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Movement.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: MovementByIdResult, 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.Movement Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Movement.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.MovementByIdResult
 */
export const MovementByIdResult = new MovementByIdResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementByFilterQuery$Type extends MessageType<MovementByFilterQuery> {
    constructor() {
        super("api.MovementByFilterQuery", [
            { 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: 7, 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<MovementByFilterQuery>): MovementByFilterQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.limitFilter = "";
        message.queryContext = "";
        message.blockFilters = [];
        if (value !== undefined)
            reflectionMergePartial<MovementByFilterQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByFilterQuery): MovementByFilterQuery {
        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 = 7 [json_name = "BlockFilters"];*/ 7:
                    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: MovementByFilterQuery, 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 = 7 [json_name = "BlockFilters"]; */
        for (let i = 0; i < message.blockFilters.length; i++)
            BlockFilter.internalBinaryWrite(message.blockFilters[i], writer.tag(7, 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.MovementByFilterQuery
 */
export const MovementByFilterQuery = new MovementByFilterQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementByFilterResult$Type extends MessageType<MovementByFilterResult> {
    constructor() {
        super("api.MovementByFilterResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Movement },
            { no: 3, name: "queryContext", kind: "scalar", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<MovementByFilterResult>): MovementByFilterResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        message.queryContext = "";
        if (value !== undefined)
            reflectionMergePartial<MovementByFilterResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByFilterResult): MovementByFilterResult {
        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.Movement Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Movement.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: MovementByFilterResult, 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.Movement Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Movement.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.MovementByFilterResult
 */
export const MovementByFilterResult = new MovementByFilterResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementByMatchQuery$Type extends MessageType<MovementByMatchQuery> {
    constructor() {
        super("api.MovementByMatchQuery", [
            { 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<MovementByMatchQuery>): MovementByMatchQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.blockFilters = [];
        message.matchFields = [];
        if (value !== undefined)
            reflectionMergePartial<MovementByMatchQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByMatchQuery): MovementByMatchQuery {
        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: MovementByMatchQuery, 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.MovementByMatchQuery
 */
export const MovementByMatchQuery = new MovementByMatchQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementByMatchResult$Type extends MessageType<MovementByMatchResult> {
    constructor() {
        super("api.MovementByMatchResult", [
            { no: 2, name: "MatchResults", kind: "message", jsonName: "MatchResults", repeat: 1 /*RepeatType.PACKED*/, T: () => MatchFieldResult }
        ]);
    }
    create(value?: PartialMessage<MovementByMatchResult>): MovementByMatchResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.matchResults = [];
        if (value !== undefined)
            reflectionMergePartial<MovementByMatchResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByMatchResult): MovementByMatchResult {
        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: MovementByMatchResult, 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.MovementByMatchResult
 */
export const MovementByMatchResult = new MovementByMatchResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementByOperationReferenceQuery$Type extends MessageType<MovementByOperationReferenceQuery> {
    constructor() {
        super("api.MovementByOperationReferenceQuery", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => QueryProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "OperationReferences", kind: "scalar", jsonName: "OperationReferences", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } }, "api.messageType": "Query" });
    }
    create(value?: PartialMessage<MovementByOperationReferenceQuery>): MovementByOperationReferenceQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.operationReferences = [];
        if (value !== undefined)
            reflectionMergePartial<MovementByOperationReferenceQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByOperationReferenceQuery): MovementByOperationReferenceQuery {
        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 string OperationReferences = 2 [json_name = "OperationReferences"];*/ 2:
                    message.operationReferences.push(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: MovementByOperationReferenceQuery, 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 string OperationReferences = 2 [json_name = "OperationReferences"]; */
        for (let i = 0; i < message.operationReferences.length; i++)
            writer.tag(2, WireType.LengthDelimited).string(message.operationReferences[i]);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.MovementByOperationReferenceQuery
 */
export const MovementByOperationReferenceQuery = new MovementByOperationReferenceQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementByOperationReferenceResult$Type extends MessageType<MovementByOperationReferenceResult> {
    constructor() {
        super("api.MovementByOperationReferenceResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Movement }
        ], { "api.messageType": "Result" });
    }
    create(value?: PartialMessage<MovementByOperationReferenceResult>): MovementByOperationReferenceResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        if (value !== undefined)
            reflectionMergePartial<MovementByOperationReferenceResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementByOperationReferenceResult): MovementByOperationReferenceResult {
        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.Movement Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Movement.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: MovementByOperationReferenceResult, 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.Movement Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Movement.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.MovementByOperationReferenceResult
 */
export const MovementByOperationReferenceResult = new MovementByOperationReferenceResult$Type();
/**
 * @generated ServiceType for protobuf service api.MovementQuery
 */
export const MovementQuery = new ServiceType("api.MovementQuery", [
    { name: "GetByIds", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement Query"], description: "Get Stock from Ids" }, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "api.moduleID": "stock-inventory", "api.tableName": "movementByIdv2", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: MovementByIdQuery, O: MovementByIdResult },
    { name: "Find", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement Query"], description: "Find a movement from its properties." }, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "api.moduleID": "stock-inventory", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: MovementByFilterQuery, O: MovementByFilterResult },
    { name: "FindMatchingFieldValues", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement 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": "", "api.moduleID": "stock-inventory", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: MovementByMatchQuery, O: MovementByMatchResult },
    { name: "FindMatchingFieldElements", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement 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": "", "api.moduleID": "stock-inventory", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ElementByMatchQuery, O: ElementByMatchResult },
    { name: "GetByOperationReference", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement Query"], description: "Get movement by operation Reference" }, "api.rscType": "Project", "api.roles": "", "api.moduleID": "stock-inventory", "api.tableName": "movementByOperationReferencev2", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: MovementByOperationReferenceQuery, O: MovementByOperationReferenceResult },
    { name: "GetKPIData", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement Query"], description: "Get movement KPI data" }, "api.rscType": "Project", "api.roles": "", "api.moduleID": "stock-inventory", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: GetKPIDataQuery, O: GetKPIDataResult },
    { name: "Extract", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement Query"], description: "Schedule a data extraction" }, "api.rscType": "Project", "api.roles": "", "api.moduleID": "stock-inventory", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: ExtractQuery, O: ExtractResult },
    { name: "CountLines", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Movement Query"], description: "Count lines in database for project" }, "api.rscType": "Platform", "api.roles": "Platform.Project-Query", "api.moduleID": "stock-inventory", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: CountLinesQuery, O: CountLinesResult }
], { "api.serviceType": "Query", "api.k8sService": "query-server" });
