// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "trackingAction.proto" (package "api", syntax proto3)
// tslint:disable
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 { ETA } from "./tradeShared";
import { EntityID } from "./shared";
import { CommandHeader } from "./shared";
import { TrackingEvent } from "./transportShared";
import { TradeTier } from "./tradeShared";
import { DateTime } from "./shared";
import { TrackingStatusStruct } from "./transportShared";
// Action Summary
//   - MapSummaryToHU :               Map entity status to Handlingunit entity                   > handlingunit.TrackingUpdated
//   - InitNexTracking :              Initiate next Tracking after a switched  event                 > tracking.Dispatched
//   - MapETAToHU :                   map TrackingETA to Handlingunit entity                 > handlingunit.TrackingETAUpdated
// 

/**
 *
 * MapSummaryToHU : map the tracking Summary to the corresponding HU
 *
 * @generated from protobuf message api.TrackingMapSummaryToHUPayload
 */
export interface TrackingMapSummaryToHUPayload {
    /**
     * @generated from protobuf field: string HandlingunitID = 1 [json_name = "HandlingunitID"];
     */
    handlingunitID: string;
    /**
     * @generated from protobuf field: api.TrackingStatusStruct Status = 2 [json_name = "Status"];
     */
    status?: TrackingStatusStruct;
    /**
     * @generated from protobuf field: string TrackingURL = 3 [json_name = "TrackingURL"];
     */
    trackingURL: string;
    /**
     * @generated from protobuf field: api.DateTime DispatchedDateTime = 4 [json_name = "DispatchedDateTime"];
     */
    dispatchedDateTime?: DateTime; // TODO : will disappear when dispatched is removed ...
    /**
     * @generated from protobuf field: api.TradeTier HUCarrier = 9 [json_name = "HUCarrier"];
     */
    hUCarrier?: TradeTier;
    /**
     * @generated from protobuf field: api.TradeTier HUShipFrom = 10 [json_name = "HUShipFrom"];
     */
    hUShipFrom?: TradeTier;
    /**
     * @generated from protobuf field: api.TradeTier HUShipTo = 11 [json_name = "HUShipTo"];
     */
    hUShipTo?: TradeTier;
    /**
     * @generated from protobuf field: string NextTrackingID = 12 [json_name = "NextTrackingID"];
     */
    nextTrackingID: string;
    /**
     * @generated from protobuf field: repeated api.TrackingEvent Events = 13 [json_name = "Events"];
     */
    events: TrackingEvent[];
}
/**
 * @generated from protobuf message api.TrackingMapStatusToHU
 */
export interface TrackingMapStatusToHU {
    /**
     * @generated from protobuf field: api.CommandHeader Header = 1 [json_name = "Header"];
     */
    header?: CommandHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.TrackingMapSummaryToHUPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: TrackingMapSummaryToHUPayload;
    /**
     * @generated from protobuf field: api.TrackingMapSummaryToHUPayload EventPayload = 4 [json_name = "EventPayload"];
     */
    eventPayload?: TrackingMapSummaryToHUPayload;
    /**
     * @generated from protobuf field: api.TrackingMapSummaryToHUPayload PreviousPayload = 5 [json_name = "PreviousPayload"];
     */
    previousPayload?: TrackingMapSummaryToHUPayload;
}
/**
 *
 * InitNexTracking : initiate the next tracking after a switched
 *
 * @generated from protobuf message api.TrackingInitNextTrackingPayload
 */
export interface TrackingInitNextTrackingPayload {
    /**
     * @generated from protobuf field: string HandlingunitID = 1 [json_name = "HandlingunitID"];
     */
    handlingunitID: string;
    /**
     * @generated from protobuf field: string NextTrackingID = 2 [json_name = "NextTrackingID"];
     */
    nextTrackingID: string;
    /**
     * @generated from protobuf field: string NextTrackingURL = 3 [json_name = "NextTrackingURL"];
     */
    nextTrackingURL: string;
    /**
     * @generated from protobuf field: api.DateTime DispatchedDateTime = 4 [json_name = "DispatchedDateTime"];
     */
    dispatchedDateTime?: DateTime;
    /**
     * @generated from protobuf field: api.TradeTier NextHUCarrier = 5 [json_name = "NextHUCarrier"];
     */
    nextHUCarrier?: TradeTier;
    /**
     * @generated from protobuf field: api.TradeTier NextHUShipFrom = 6 [json_name = "NextHUShipFrom"];
     */
    nextHUShipFrom?: TradeTier;
    /**
     * @generated from protobuf field: api.TradeTier NextHUShipTo = 7 [json_name = "NextHUShipTo"];
     */
    nextHUShipTo?: TradeTier;
}
/**
 * @generated from protobuf message api.TrackingInitNext
 */
export interface TrackingInitNext {
    /**
     * @generated from protobuf field: api.CommandHeader Header = 1 [json_name = "Header"];
     */
    header?: CommandHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.TrackingInitNextTrackingPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: TrackingInitNextTrackingPayload;
    /**
     * @generated from protobuf field: api.TrackingInitNextTrackingPayload EventPayload = 4 [json_name = "EventPayload"];
     */
    eventPayload?: TrackingInitNextTrackingPayload;
    /**
     * @generated from protobuf field: api.TrackingInitNextTrackingPayload PreviousPayload = 5 [json_name = "PreviousPayload"];
     */
    previousPayload?: TrackingInitNextTrackingPayload;
}
/**
 *
 * MapETAToHU : map the tracking ETA to the corresponding HU
 *
 * @generated from protobuf message api.TrackingMapETAToHUPayload
 */
export interface TrackingMapETAToHUPayload {
    /**
     * @generated from protobuf field: string HandlingunitID = 1 [json_name = "HandlingunitID"];
     */
    handlingunitID: string;
    /**
     * @generated from protobuf field: api.ETA TrackingETA = 2 [json_name = "TrackingETA"];
     */
    trackingETA?: ETA;
}
/**
 * @generated from protobuf message api.TrackingMapETAToHU
 */
export interface TrackingMapETAToHU {
    /**
     * @generated from protobuf field: api.CommandHeader Header = 1 [json_name = "Header"];
     */
    header?: CommandHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.TrackingMapETAToHUPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: TrackingMapETAToHUPayload;
    /**
     * @generated from protobuf field: api.TrackingMapETAToHUPayload EventPayload = 4 [json_name = "EventPayload"];
     */
    eventPayload?: TrackingMapETAToHUPayload;
    /**
     * @generated from protobuf field: api.TrackingMapETAToHUPayload PreviousPayload = 5 [json_name = "PreviousPayload"];
     */
    previousPayload?: TrackingMapETAToHUPayload;
}
// @generated message type with reflection information, may provide speed optimized methods
class TrackingMapSummaryToHUPayload$Type extends MessageType<TrackingMapSummaryToHUPayload> {
    constructor() {
        super("api.TrackingMapSummaryToHUPayload", [
            { no: 1, name: "HandlingunitID", kind: "scalar", jsonName: "HandlingunitID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "Status", kind: "message", jsonName: "Status", T: () => TrackingStatusStruct },
            { no: 3, name: "TrackingURL", kind: "scalar", jsonName: "TrackingURL", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "DispatchedDateTime", kind: "message", jsonName: "DispatchedDateTime", T: () => DateTime },
            { no: 9, name: "HUCarrier", kind: "message", jsonName: "HUCarrier", T: () => TradeTier },
            { no: 10, name: "HUShipFrom", kind: "message", jsonName: "HUShipFrom", T: () => TradeTier },
            { no: 11, name: "HUShipTo", kind: "message", jsonName: "HUShipTo", T: () => TradeTier },
            { no: 12, name: "NextTrackingID", kind: "scalar", jsonName: "NextTrackingID", T: 9 /*ScalarType.STRING*/ },
            { no: 13, name: "Events", kind: "message", jsonName: "Events", repeat: 1 /*RepeatType.PACKED*/, T: () => TrackingEvent }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Map the tracking Summary to the corresponding HU" } }, "api.messageType": "Command", "api.payload": true, "api.action": "MapSummaryToHU" });
    }
    create(value?: PartialMessage<TrackingMapSummaryToHUPayload>): TrackingMapSummaryToHUPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.handlingunitID = "";
        message.trackingURL = "";
        message.nextTrackingID = "";
        message.events = [];
        if (value !== undefined)
            reflectionMergePartial<TrackingMapSummaryToHUPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingMapSummaryToHUPayload): TrackingMapSummaryToHUPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string HandlingunitID = 1 [json_name = "HandlingunitID"];*/ 1:
                    message.handlingunitID = reader.string();
                    break;
                case /* api.TrackingStatusStruct Status = 2 [json_name = "Status"];*/ 2:
                    message.status = TrackingStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.status);
                    break;
                case /* string TrackingURL = 3 [json_name = "TrackingURL"];*/ 3:
                    message.trackingURL = reader.string();
                    break;
                case /* api.DateTime DispatchedDateTime = 4 [json_name = "DispatchedDateTime"];*/ 4:
                    message.dispatchedDateTime = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.dispatchedDateTime);
                    break;
                case /* api.TradeTier HUCarrier = 9 [json_name = "HUCarrier"];*/ 9:
                    message.hUCarrier = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.hUCarrier);
                    break;
                case /* api.TradeTier HUShipFrom = 10 [json_name = "HUShipFrom"];*/ 10:
                    message.hUShipFrom = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.hUShipFrom);
                    break;
                case /* api.TradeTier HUShipTo = 11 [json_name = "HUShipTo"];*/ 11:
                    message.hUShipTo = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.hUShipTo);
                    break;
                case /* string NextTrackingID = 12 [json_name = "NextTrackingID"];*/ 12:
                    message.nextTrackingID = reader.string();
                    break;
                case /* repeated api.TrackingEvent Events = 13 [json_name = "Events"];*/ 13:
                    message.events.push(TrackingEvent.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: TrackingMapSummaryToHUPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string HandlingunitID = 1 [json_name = "HandlingunitID"]; */
        if (message.handlingunitID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.handlingunitID);
        /* api.TrackingStatusStruct Status = 2 [json_name = "Status"]; */
        if (message.status)
            TrackingStatusStruct.internalBinaryWrite(message.status, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* string TrackingURL = 3 [json_name = "TrackingURL"]; */
        if (message.trackingURL !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.trackingURL);
        /* api.DateTime DispatchedDateTime = 4 [json_name = "DispatchedDateTime"]; */
        if (message.dispatchedDateTime)
            DateTime.internalBinaryWrite(message.dispatchedDateTime, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier HUCarrier = 9 [json_name = "HUCarrier"]; */
        if (message.hUCarrier)
            TradeTier.internalBinaryWrite(message.hUCarrier, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier HUShipFrom = 10 [json_name = "HUShipFrom"]; */
        if (message.hUShipFrom)
            TradeTier.internalBinaryWrite(message.hUShipFrom, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier HUShipTo = 11 [json_name = "HUShipTo"]; */
        if (message.hUShipTo)
            TradeTier.internalBinaryWrite(message.hUShipTo, writer.tag(11, WireType.LengthDelimited).fork(), options).join();
        /* string NextTrackingID = 12 [json_name = "NextTrackingID"]; */
        if (message.nextTrackingID !== "")
            writer.tag(12, WireType.LengthDelimited).string(message.nextTrackingID);
        /* repeated api.TrackingEvent Events = 13 [json_name = "Events"]; */
        for (let i = 0; i < message.events.length; i++)
            TrackingEvent.internalBinaryWrite(message.events[i], writer.tag(13, 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.TrackingMapSummaryToHUPayload
 */
export const TrackingMapSummaryToHUPayload = new TrackingMapSummaryToHUPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingMapStatusToHU$Type extends MessageType<TrackingMapStatusToHU> {
    constructor() {
        super("api.TrackingMapStatusToHU", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => CommandHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => TrackingMapSummaryToHUPayload },
            { no: 4, name: "EventPayload", kind: "message", jsonName: "EventPayload", T: () => TrackingMapSummaryToHUPayload },
            { no: 5, name: "PreviousPayload", kind: "message", jsonName: "PreviousPayload", T: () => TrackingMapSummaryToHUPayload }
        ], { "api.messageType": "Command", "api.action": "MapSummaryToHU", "api.resultingEvent": "handlingunit.TrackingUpdated", "api.triggerNotEventFilters": "ETAUpdated" });
    }
    create(value?: PartialMessage<TrackingMapStatusToHU>): TrackingMapStatusToHU {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<TrackingMapStatusToHU>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingMapStatusToHU): TrackingMapStatusToHU {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.CommandHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = CommandHeader.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 /* api.TrackingMapSummaryToHUPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = TrackingMapSummaryToHUPayload.internalBinaryRead(reader, reader.uint32(), options, message.payload);
                    break;
                case /* api.TrackingMapSummaryToHUPayload EventPayload = 4 [json_name = "EventPayload"];*/ 4:
                    message.eventPayload = TrackingMapSummaryToHUPayload.internalBinaryRead(reader, reader.uint32(), options, message.eventPayload);
                    break;
                case /* api.TrackingMapSummaryToHUPayload PreviousPayload = 5 [json_name = "PreviousPayload"];*/ 5:
                    message.previousPayload = TrackingMapSummaryToHUPayload.internalBinaryRead(reader, reader.uint32(), options, message.previousPayload);
                    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: TrackingMapStatusToHU, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.CommandHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            CommandHeader.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();
        /* api.TrackingMapSummaryToHUPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            TrackingMapSummaryToHUPayload.internalBinaryWrite(message.payload, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* api.TrackingMapSummaryToHUPayload EventPayload = 4 [json_name = "EventPayload"]; */
        if (message.eventPayload)
            TrackingMapSummaryToHUPayload.internalBinaryWrite(message.eventPayload, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.TrackingMapSummaryToHUPayload PreviousPayload = 5 [json_name = "PreviousPayload"]; */
        if (message.previousPayload)
            TrackingMapSummaryToHUPayload.internalBinaryWrite(message.previousPayload, writer.tag(5, 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.TrackingMapStatusToHU
 */
export const TrackingMapStatusToHU = new TrackingMapStatusToHU$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingInitNextTrackingPayload$Type extends MessageType<TrackingInitNextTrackingPayload> {
    constructor() {
        super("api.TrackingInitNextTrackingPayload", [
            { no: 1, name: "HandlingunitID", kind: "scalar", jsonName: "HandlingunitID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "NextTrackingID", kind: "scalar", jsonName: "NextTrackingID", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "NextTrackingURL", kind: "scalar", jsonName: "NextTrackingURL", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "DispatchedDateTime", kind: "message", jsonName: "DispatchedDateTime", T: () => DateTime },
            { no: 5, name: "NextHUCarrier", kind: "message", jsonName: "NextHUCarrier", T: () => TradeTier },
            { no: 6, name: "NextHUShipFrom", kind: "message", jsonName: "NextHUShipFrom", T: () => TradeTier },
            { no: 7, name: "NextHUShipTo", kind: "message", jsonName: "NextHUShipTo", T: () => TradeTier }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Initiate the next tracking after a switched event" } }, "api.messageType": "Command", "api.payload": true, "api.action": "InitNextTracking" });
    }
    create(value?: PartialMessage<TrackingInitNextTrackingPayload>): TrackingInitNextTrackingPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.handlingunitID = "";
        message.nextTrackingID = "";
        message.nextTrackingURL = "";
        if (value !== undefined)
            reflectionMergePartial<TrackingInitNextTrackingPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingInitNextTrackingPayload): TrackingInitNextTrackingPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string HandlingunitID = 1 [json_name = "HandlingunitID"];*/ 1:
                    message.handlingunitID = reader.string();
                    break;
                case /* string NextTrackingID = 2 [json_name = "NextTrackingID"];*/ 2:
                    message.nextTrackingID = reader.string();
                    break;
                case /* string NextTrackingURL = 3 [json_name = "NextTrackingURL"];*/ 3:
                    message.nextTrackingURL = reader.string();
                    break;
                case /* api.DateTime DispatchedDateTime = 4 [json_name = "DispatchedDateTime"];*/ 4:
                    message.dispatchedDateTime = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.dispatchedDateTime);
                    break;
                case /* api.TradeTier NextHUCarrier = 5 [json_name = "NextHUCarrier"];*/ 5:
                    message.nextHUCarrier = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.nextHUCarrier);
                    break;
                case /* api.TradeTier NextHUShipFrom = 6 [json_name = "NextHUShipFrom"];*/ 6:
                    message.nextHUShipFrom = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.nextHUShipFrom);
                    break;
                case /* api.TradeTier NextHUShipTo = 7 [json_name = "NextHUShipTo"];*/ 7:
                    message.nextHUShipTo = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.nextHUShipTo);
                    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: TrackingInitNextTrackingPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string HandlingunitID = 1 [json_name = "HandlingunitID"]; */
        if (message.handlingunitID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.handlingunitID);
        /* string NextTrackingID = 2 [json_name = "NextTrackingID"]; */
        if (message.nextTrackingID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.nextTrackingID);
        /* string NextTrackingURL = 3 [json_name = "NextTrackingURL"]; */
        if (message.nextTrackingURL !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.nextTrackingURL);
        /* api.DateTime DispatchedDateTime = 4 [json_name = "DispatchedDateTime"]; */
        if (message.dispatchedDateTime)
            DateTime.internalBinaryWrite(message.dispatchedDateTime, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier NextHUCarrier = 5 [json_name = "NextHUCarrier"]; */
        if (message.nextHUCarrier)
            TradeTier.internalBinaryWrite(message.nextHUCarrier, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier NextHUShipFrom = 6 [json_name = "NextHUShipFrom"]; */
        if (message.nextHUShipFrom)
            TradeTier.internalBinaryWrite(message.nextHUShipFrom, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier NextHUShipTo = 7 [json_name = "NextHUShipTo"]; */
        if (message.nextHUShipTo)
            TradeTier.internalBinaryWrite(message.nextHUShipTo, 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.TrackingInitNextTrackingPayload
 */
export const TrackingInitNextTrackingPayload = new TrackingInitNextTrackingPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingInitNext$Type extends MessageType<TrackingInitNext> {
    constructor() {
        super("api.TrackingInitNext", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => CommandHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => TrackingInitNextTrackingPayload },
            { no: 4, name: "EventPayload", kind: "message", jsonName: "EventPayload", T: () => TrackingInitNextTrackingPayload },
            { no: 5, name: "PreviousPayload", kind: "message", jsonName: "PreviousPayload", T: () => TrackingInitNextTrackingPayload }
        ], { "api.messageType": "Command", "api.action": "InitNextTracking", "api.resultingEvent": "tracking.HULabeled", "api.triggerEventFilters": "Switched" });
    }
    create(value?: PartialMessage<TrackingInitNext>): TrackingInitNext {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<TrackingInitNext>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingInitNext): TrackingInitNext {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.CommandHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = CommandHeader.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 /* api.TrackingInitNextTrackingPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = TrackingInitNextTrackingPayload.internalBinaryRead(reader, reader.uint32(), options, message.payload);
                    break;
                case /* api.TrackingInitNextTrackingPayload EventPayload = 4 [json_name = "EventPayload"];*/ 4:
                    message.eventPayload = TrackingInitNextTrackingPayload.internalBinaryRead(reader, reader.uint32(), options, message.eventPayload);
                    break;
                case /* api.TrackingInitNextTrackingPayload PreviousPayload = 5 [json_name = "PreviousPayload"];*/ 5:
                    message.previousPayload = TrackingInitNextTrackingPayload.internalBinaryRead(reader, reader.uint32(), options, message.previousPayload);
                    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: TrackingInitNext, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.CommandHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            CommandHeader.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();
        /* api.TrackingInitNextTrackingPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            TrackingInitNextTrackingPayload.internalBinaryWrite(message.payload, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* api.TrackingInitNextTrackingPayload EventPayload = 4 [json_name = "EventPayload"]; */
        if (message.eventPayload)
            TrackingInitNextTrackingPayload.internalBinaryWrite(message.eventPayload, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.TrackingInitNextTrackingPayload PreviousPayload = 5 [json_name = "PreviousPayload"]; */
        if (message.previousPayload)
            TrackingInitNextTrackingPayload.internalBinaryWrite(message.previousPayload, writer.tag(5, 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.TrackingInitNext
 */
export const TrackingInitNext = new TrackingInitNext$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingMapETAToHUPayload$Type extends MessageType<TrackingMapETAToHUPayload> {
    constructor() {
        super("api.TrackingMapETAToHUPayload", [
            { no: 1, name: "HandlingunitID", kind: "scalar", jsonName: "HandlingunitID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "TrackingETA", kind: "message", jsonName: "TrackingETA", T: () => ETA }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Map the TrackingETA to the corresponding HU" } }, "api.messageType": "Command", "api.payload": true, "api.action": "MapETAToHU" });
    }
    create(value?: PartialMessage<TrackingMapETAToHUPayload>): TrackingMapETAToHUPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.handlingunitID = "";
        if (value !== undefined)
            reflectionMergePartial<TrackingMapETAToHUPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingMapETAToHUPayload): TrackingMapETAToHUPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string HandlingunitID = 1 [json_name = "HandlingunitID"];*/ 1:
                    message.handlingunitID = reader.string();
                    break;
                case /* api.ETA TrackingETA = 2 [json_name = "TrackingETA"];*/ 2:
                    message.trackingETA = ETA.internalBinaryRead(reader, reader.uint32(), options, message.trackingETA);
                    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: TrackingMapETAToHUPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string HandlingunitID = 1 [json_name = "HandlingunitID"]; */
        if (message.handlingunitID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.handlingunitID);
        /* api.ETA TrackingETA = 2 [json_name = "TrackingETA"]; */
        if (message.trackingETA)
            ETA.internalBinaryWrite(message.trackingETA, 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.TrackingMapETAToHUPayload
 */
export const TrackingMapETAToHUPayload = new TrackingMapETAToHUPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingMapETAToHU$Type extends MessageType<TrackingMapETAToHU> {
    constructor() {
        super("api.TrackingMapETAToHU", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => CommandHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => TrackingMapETAToHUPayload },
            { no: 4, name: "EventPayload", kind: "message", jsonName: "EventPayload", T: () => TrackingMapETAToHUPayload },
            { no: 5, name: "PreviousPayload", kind: "message", jsonName: "PreviousPayload", T: () => TrackingMapETAToHUPayload }
        ], { "api.messageType": "Command", "api.action": "MapETAToHU", "api.resultingEvent": "handlingunit.TrackingETAUpdated", "api.triggerEventFilters": "ETAUpdated,HULabeled" });
    }
    create(value?: PartialMessage<TrackingMapETAToHU>): TrackingMapETAToHU {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<TrackingMapETAToHU>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingMapETAToHU): TrackingMapETAToHU {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.CommandHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = CommandHeader.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 /* api.TrackingMapETAToHUPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = TrackingMapETAToHUPayload.internalBinaryRead(reader, reader.uint32(), options, message.payload);
                    break;
                case /* api.TrackingMapETAToHUPayload EventPayload = 4 [json_name = "EventPayload"];*/ 4:
                    message.eventPayload = TrackingMapETAToHUPayload.internalBinaryRead(reader, reader.uint32(), options, message.eventPayload);
                    break;
                case /* api.TrackingMapETAToHUPayload PreviousPayload = 5 [json_name = "PreviousPayload"];*/ 5:
                    message.previousPayload = TrackingMapETAToHUPayload.internalBinaryRead(reader, reader.uint32(), options, message.previousPayload);
                    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: TrackingMapETAToHU, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.CommandHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            CommandHeader.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();
        /* api.TrackingMapETAToHUPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            TrackingMapETAToHUPayload.internalBinaryWrite(message.payload, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* api.TrackingMapETAToHUPayload EventPayload = 4 [json_name = "EventPayload"]; */
        if (message.eventPayload)
            TrackingMapETAToHUPayload.internalBinaryWrite(message.eventPayload, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.TrackingMapETAToHUPayload PreviousPayload = 5 [json_name = "PreviousPayload"]; */
        if (message.previousPayload)
            TrackingMapETAToHUPayload.internalBinaryWrite(message.previousPayload, writer.tag(5, 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.TrackingMapETAToHU
 */
export const TrackingMapETAToHU = new TrackingMapETAToHU$Type();
