// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "trackingQuery.proto" (package "api", syntax proto3)
// tslint:disable
import { CountLinesResult } from "./shared";
import { CountLinesQuery } 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 { Tracking } from "./tracking";
import { ResultHeader } from "./shared";
import { EntityID } from "./shared";
import { QueryProjectHeader } from "./shared";
// 
// Query-server services

/**
 * @generated from protobuf message api.TrackingByIdQuery
 */
export interface TrackingByIdQuery {
    /**
     * @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.TrackingByIdResult
 */
export interface TrackingByIdResult {
    /**
     * @generated from protobuf field: api.ResultHeader Header = 1 [json_name = "Header"];
     */
    header?: ResultHeader;
    /**
     * @generated from protobuf field: repeated api.Tracking Objects = 2 [json_name = "Objects"];
     */
    objects: Tracking[];
}
// @generated message type with reflection information, may provide speed optimized methods
class TrackingByIdQuery$Type extends MessageType<TrackingByIdQuery> {
    constructor() {
        super("api.TrackingByIdQuery", [
            { 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<TrackingByIdQuery>): TrackingByIdQuery {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.iDs = [];
        if (value !== undefined)
            reflectionMergePartial<TrackingByIdQuery>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingByIdQuery): TrackingByIdQuery {
        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: TrackingByIdQuery, 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.TrackingByIdQuery
 */
export const TrackingByIdQuery = new TrackingByIdQuery$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingByIdResult$Type extends MessageType<TrackingByIdResult> {
    constructor() {
        super("api.TrackingByIdResult", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResultHeader },
            { no: 2, name: "Objects", kind: "message", jsonName: "Objects", repeat: 1 /*RepeatType.PACKED*/, T: () => Tracking }
        ], { "api.messageType": "Result" });
    }
    create(value?: PartialMessage<TrackingByIdResult>): TrackingByIdResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.objects = [];
        if (value !== undefined)
            reflectionMergePartial<TrackingByIdResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingByIdResult): TrackingByIdResult {
        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.Tracking Objects = 2 [json_name = "Objects"];*/ 2:
                    message.objects.push(Tracking.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: TrackingByIdResult, 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.Tracking Objects = 2 [json_name = "Objects"]; */
        for (let i = 0; i < message.objects.length; i++)
            Tracking.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.TrackingByIdResult
 */
export const TrackingByIdResult = new TrackingByIdResult$Type();
/**
 * @generated ServiceType for protobuf service api.TrackingQuery
 */
export const TrackingQuery = new ServiceType("api.TrackingQuery", [
    { name: "GetByIds", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Tracking Query"], description: "Get Trackings from Ids" }, "api.rscType": "Project", "api.roles": "Platform.Project-Query", "api.tableName": "trackingById", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: TrackingByIdQuery, O: TrackingByIdResult },
    { name: "CountLines", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Tracking 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 }
], { "api.serviceType": "Query", "api.k8sService": "query-server" });
