// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "executionflow.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 { PartnerPayload } from "./partner";
import { ActorPayload } from "./actor";
import { ItemPayload } from "./item";
import { EntityID } from "./shared";
import { EventHeader } from "./shared";
import { ETA } from "./tradeShared";
import { ETAbyHU } from "./tradeShared";
import { ClaimSummary } from "./shared";
import { AttachmentSummary } from "./shared";
import { ExecutionflowStatusStruct } from "./tradeShared";
import { HandlingunitSummary } from "./warehousingShared";
import { ExeFlowLine } from "./tradeShared";
import { OrderRequestedMilestones } from "./tradeShared";
import { TradeTier } from "./tradeShared";
import { MetadataElement } from "./shared";
import { DateTime } from "./shared";
// 
// This entity describes a simple logistical flow, an order for the 3 stages :
// - prepare goods in one warehouse,
// - move them to another place,
// - receive goods.
// 
// It represents the logistical order or a subcommand of trade order. It is structured with lines.
// 
// The lines are an extract from those of the trade order lines :same IDs, same requested Goods, but quantities may differ
// 
// A executionFlow is usually created by a message from the OMS. It collects information from the following entities :
// - HandlingUnit : the status of the HU.
// 
// The executionflow Metadata are the same as the trade order Metadata.
// 
// The Goods may come enriched (i.e. with item details) from the OMS (Created event within th ExeFlowLine structure)
// The Goods do no come enriched from handlingunit entity (within HandlingunitSummary structure) but the structure may be enriched later.
// 
// Comments updated 2021/02/17

/**
 * @generated from protobuf message api.ExecutionflowPayload
 */
export interface ExecutionflowPayload {
    /**
     * @generated from protobuf field: api.DateTime CreationDateTime = 1 [json_name = "CreationDateTime"];
     */
    creationDateTime?: DateTime;
    /**
     * @generated from protobuf field: string OrderID = 2 [json_name = "OrderID"];
     */
    orderID: string;
    /**
     * Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)
     *
     * @generated from protobuf field: repeated api.MetadataElement MetaData = 3 [json_name = "MetaData"];
     */
    metaData: MetadataElement[];
    /**
     * Where to ship the order from
     *
     * @generated from protobuf field: api.TradeTier ShipFrom = 4 [json_name = "ShipFrom"];
     */
    shipFrom?: TradeTier;
    /**
     * Where to ship the order to
     *
     * @generated from protobuf field: api.TradeTier ShipTo = 5 [json_name = "ShipTo"];
     */
    shipTo?: TradeTier;
    /**
     * Definition of the order carrier
     *
     * @generated from protobuf field: api.TradeTier Carrier = 6 [json_name = "Carrier"];
     */
    carrier?: TradeTier;
    /**
     * Type of carrier service
     *
     * @generated from protobuf field: string CarrierService = 7 [json_name = "CarrierService"];
     */
    carrierService: string;
    /**
     * @generated from protobuf field: api.OrderRequestedMilestones RequestedMilestones = 8 [json_name = "RequestedMilestones"];
     */
    requestedMilestones?: OrderRequestedMilestones;
    /**
     * @generated from protobuf field: repeated api.ExeFlowLine Lines = 9 [json_name = "Lines"];
     */
    lines: ExeFlowLine[];
    // 
    // Handlingunit executions.
    // The goods content of the HU is coming from handlingunit entity.

    /**
     * @generated from protobuf field: repeated api.HandlingunitSummary Handlingunits = 11 [json_name = "Handlingunits"];
     */
    handlingunits: HandlingunitSummary[];
    /**
     * @generated from protobuf field: api.ExecutionflowStatusStruct Status = 13 [json_name = "Status"];
     */
    status?: ExecutionflowStatusStruct; // Status field is not accessible from APIs
    /**
     * @generated from protobuf field: bool ShipFromAcked = 14 [json_name = "ShipFromAcked"];
     */
    shipFromAcked: boolean;
    /**
     * @generated from protobuf field: bool ShipToAcked = 15 [json_name = "ShipToAcked"];
     */
    shipToAcked: boolean;
    /**
     * @generated from protobuf field: repeated api.AttachmentSummary Attachments = 16 [json_name = "Attachments"];
     */
    attachments: AttachmentSummary[];
    /**
     * @generated from protobuf field: int32 AttachmentNumber = 17 [json_name = "AttachmentNumber"];
     */
    attachmentNumber: number;
    /**
     * @generated from protobuf field: repeated api.ClaimSummary Claims = 18 [json_name = "Claims"];
     */
    claims: ClaimSummary[];
    /**
     * @generated from protobuf field: int32 ClaimNumber = 19 [json_name = "ClaimNumber"];
     */
    claimNumber: number;
    /**
     * @generated from protobuf field: repeated api.ETAbyHU HandlingunitETAs = 20 [json_name = "HandlingunitETAs"];
     */
    handlingunitETAs: ETAbyHU[]; // //Estimated Time of Arrival for the HandlingUnit(s) created for theis executionflow
    /**
     * @generated from protobuf field: api.ETA ExecutionflowETA = 21 [json_name = "ExecutionflowETA"];
     */
    executionflowETA?: ETA; // Estimated Time of Arrival for the Executionflow, computed with other ETAs received directly or from HUs
    /**
     * @generated from protobuf field: api.ETA ExecutionflowETAComputed = 22 [json_name = "ExecutionflowETAComputed"];
     */
    executionflowETAComputed?: ETA;
}
// Executionflow entity

/**
 * @generated from protobuf message api.Executionflow
 */
export interface Executionflow {
    /**
     * @generated from protobuf field: api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"];
     */
    lastEventHeader?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.ExecutionflowPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: ExecutionflowPayload;
}
// Executionflow Enrichment

/**
 * @generated from protobuf message api.ExecutionflowEnrichment
 */
export interface ExecutionflowEnrichment {
    /**
     * @generated from protobuf field: string ParentEventID = 1 [json_name = "ParentEventID"];
     */
    parentEventID: string;
    /**
     * @generated from protobuf field: string EntityName = 2 [json_name = "EntityName"];
     */
    entityName: string;
    /**
     * @generated from protobuf field: string EntityRefID = 3 [json_name = "EntityRefID"];
     */
    entityRefID: string;
    /**
     * @generated from protobuf field: string RefFilter = 4 [json_name = "RefFilter"];
     */
    refFilter: string;
    /**
     * @generated from protobuf field: string MergePath = 5 [json_name = "MergePath"];
     */
    mergePath: string;
    /**
     * @generated from protobuf oneof: Content
     */
    content: {
        oneofKind: "item";
        /**
         * @generated from protobuf field: api.ItemPayload Item = 10 [json_name = "Item"];
         */
        item: ItemPayload;
    } | {
        oneofKind: "actor";
        /**
         * @generated from protobuf field: api.ActorPayload Actor = 11 [json_name = "Actor"];
         */
        actor: ActorPayload;
    } | {
        oneofKind: "partner";
        /**
         * @generated from protobuf field: api.PartnerPayload Partner = 12 [json_name = "Partner"];
         */
        partner: PartnerPayload;
    } | {
        oneofKind: undefined;
    };
    /**
     * @generated from protobuf field: string Project = 6 [json_name = "Project"];
     */
    project: string;
    /**
     * @generated from protobuf field: string ParentEntityName = 7 [json_name = "ParentEntityName"];
     */
    parentEntityName: string;
    /**
     * @generated from protobuf field: string ParentEntityID = 8 [json_name = "ParentEntityID"];
     */
    parentEntityID: string;
}
/**
 * @generated from protobuf message api.ExecutionflowTriplet
 */
export interface ExecutionflowTriplet {
    /**
     * @generated from protobuf field: api.Executionflow Current = 1 [json_name = "Current"];
     */
    current?: Executionflow;
    /**
     * @generated from protobuf field: api.Executionflow Previous = 2 [json_name = "Previous"];
     */
    previous?: Executionflow;
    /**
     * @generated from protobuf field: api.Executionflow LastEvent = 3 [json_name = "LastEvent"];
     */
    lastEvent?: Executionflow;
}
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionflowPayload$Type extends MessageType<ExecutionflowPayload> {
    constructor() {
        super("api.ExecutionflowPayload", [
            { no: 1, name: "CreationDateTime", kind: "message", jsonName: "CreationDateTime", T: () => DateTime },
            { no: 2, name: "OrderID", kind: "scalar", jsonName: "OrderID", T: 9 /*ScalarType.STRING*/, options: { "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.kpiItems": { Items: [{ Context: "Executionflow", Group: "executionflow", Queryable: true }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
            { no: 3, name: "MetaData", kind: "message", jsonName: "MetaData", repeat: 1 /*RepeatType.PACKED*/, T: () => MetadataElement, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)" }, "api.metadata": true, "api.aggKey": "Key", "api.transientRef": "Order,Payload.MetaData,hard", "api.parentEntity": "Order", "api.aggAppend": "MetaDataUpdated" } },
            { no: 4, name: "ShipFrom", kind: "message", jsonName: "ShipFrom", T: () => TradeTier, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Where to ship the order from" } } },
            { no: 5, name: "ShipTo", kind: "message", jsonName: "ShipTo", T: () => TradeTier, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Where to ship the order to" } } },
            { no: 6, name: "Carrier", kind: "message", jsonName: "Carrier", T: () => TradeTier, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Definition of the order carrier" } } },
            { no: 7, name: "CarrierService", kind: "scalar", jsonName: "CarrierService", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Type of carrier service" }, "api.dataRestrictionKey": "Executionflow", "api.kpiItems": { Items: [{ Context: "Executionflow", Group: "executionflow", Queryable: true }] } } },
            { no: 8, name: "RequestedMilestones", kind: "message", jsonName: "RequestedMilestones", T: () => OrderRequestedMilestones },
            { no: 9, name: "Lines", kind: "message", jsonName: "Lines", repeat: 1 /*RepeatType.PACKED*/, T: () => ExeFlowLine, options: { "api.aggKey": "LineID" } },
            { no: 11, name: "Handlingunits", kind: "message", jsonName: "Handlingunits", repeat: 1 /*RepeatType.PACKED*/, T: () => HandlingunitSummary, options: { "api.aggKey": "HandlingunitID", "api.aggAppend": "HUContentUpdated,HUTrackingUpdated" } },
            { no: 13, name: "Status", kind: "message", jsonName: "Status", T: () => ExecutionflowStatusStruct, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
            { no: 14, name: "ShipFromAcked", kind: "scalar", jsonName: "ShipFromAcked", T: 8 /*ScalarType.BOOL*/ },
            { no: 15, name: "ShipToAcked", kind: "scalar", jsonName: "ShipToAcked", T: 8 /*ScalarType.BOOL*/ },
            { no: 16, name: "Attachments", kind: "message", jsonName: "Attachments", repeat: 1 /*RepeatType.PACKED*/, T: () => AttachmentSummary, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Number of attachments per type" }, "api.aggSkip": "AttachmentAdded,AttachmentRemoved" } },
            { no: 17, name: "AttachmentNumber", kind: "scalar", jsonName: "AttachmentNumber", T: 5 /*ScalarType.INT32*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Total number of attachments" } } },
            { no: 18, name: "Claims", kind: "message", jsonName: "Claims", repeat: 1 /*RepeatType.PACKED*/, T: () => ClaimSummary, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Number of claims per type" }, "api.aggKey": "ClaimTypeID", "api.aggSkip": "ClaimAdded" } },
            { no: 19, name: "ClaimNumber", kind: "scalar", jsonName: "ClaimNumber", T: 5 /*ScalarType.INT32*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Total number of claims" } } },
            { no: 20, name: "HandlingunitETAs", kind: "message", jsonName: "HandlingunitETAs", repeat: 1 /*RepeatType.PACKED*/, T: () => ETAbyHU, options: { "api.aggKey": "HandlingunitID", "api.aggSkip": "HUETAUpdated", "api.kpiExclude": { Items: [{ Context: "Executionflow", Group: "executionflow" }] } } },
            { no: 21, name: "ExecutionflowETA", kind: "message", jsonName: "ExecutionflowETA", T: () => ETA, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Estimated Time of Arrival received directly for the Executionflow" }, "api.aggSkip": "ETAUpdated", "api.kpiExclude": { Items: [{ Context: "Executionflow", Group: "executionflow" }] } } },
            { no: 22, name: "ExecutionflowETAComputed", kind: "message", jsonName: "ExecutionflowETAComputed", T: () => ETA, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } }
        ]);
    }
    create(value?: PartialMessage<ExecutionflowPayload>): ExecutionflowPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.orderID = "";
        message.metaData = [];
        message.carrierService = "";
        message.lines = [];
        message.handlingunits = [];
        message.shipFromAcked = false;
        message.shipToAcked = false;
        message.attachments = [];
        message.attachmentNumber = 0;
        message.claims = [];
        message.claimNumber = 0;
        message.handlingunitETAs = [];
        if (value !== undefined)
            reflectionMergePartial<ExecutionflowPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExecutionflowPayload): ExecutionflowPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.DateTime CreationDateTime = 1 [json_name = "CreationDateTime"];*/ 1:
                    message.creationDateTime = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.creationDateTime);
                    break;
                case /* string OrderID = 2 [json_name = "OrderID"];*/ 2:
                    message.orderID = reader.string();
                    break;
                case /* repeated api.MetadataElement MetaData = 3 [json_name = "MetaData"];*/ 3:
                    message.metaData.push(MetadataElement.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* api.TradeTier ShipFrom = 4 [json_name = "ShipFrom"];*/ 4:
                    message.shipFrom = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.shipFrom);
                    break;
                case /* api.TradeTier ShipTo = 5 [json_name = "ShipTo"];*/ 5:
                    message.shipTo = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.shipTo);
                    break;
                case /* api.TradeTier Carrier = 6 [json_name = "Carrier"];*/ 6:
                    message.carrier = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.carrier);
                    break;
                case /* string CarrierService = 7 [json_name = "CarrierService"];*/ 7:
                    message.carrierService = reader.string();
                    break;
                case /* api.OrderRequestedMilestones RequestedMilestones = 8 [json_name = "RequestedMilestones"];*/ 8:
                    message.requestedMilestones = OrderRequestedMilestones.internalBinaryRead(reader, reader.uint32(), options, message.requestedMilestones);
                    break;
                case /* repeated api.ExeFlowLine Lines = 9 [json_name = "Lines"];*/ 9:
                    message.lines.push(ExeFlowLine.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* repeated api.HandlingunitSummary Handlingunits = 11 [json_name = "Handlingunits"];*/ 11:
                    message.handlingunits.push(HandlingunitSummary.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* api.ExecutionflowStatusStruct Status = 13 [json_name = "Status"];*/ 13:
                    message.status = ExecutionflowStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.status);
                    break;
                case /* bool ShipFromAcked = 14 [json_name = "ShipFromAcked"];*/ 14:
                    message.shipFromAcked = reader.bool();
                    break;
                case /* bool ShipToAcked = 15 [json_name = "ShipToAcked"];*/ 15:
                    message.shipToAcked = reader.bool();
                    break;
                case /* repeated api.AttachmentSummary Attachments = 16 [json_name = "Attachments"];*/ 16:
                    message.attachments.push(AttachmentSummary.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* int32 AttachmentNumber = 17 [json_name = "AttachmentNumber"];*/ 17:
                    message.attachmentNumber = reader.int32();
                    break;
                case /* repeated api.ClaimSummary Claims = 18 [json_name = "Claims"];*/ 18:
                    message.claims.push(ClaimSummary.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* int32 ClaimNumber = 19 [json_name = "ClaimNumber"];*/ 19:
                    message.claimNumber = reader.int32();
                    break;
                case /* repeated api.ETAbyHU HandlingunitETAs = 20 [json_name = "HandlingunitETAs"];*/ 20:
                    message.handlingunitETAs.push(ETAbyHU.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* api.ETA ExecutionflowETA = 21 [json_name = "ExecutionflowETA"];*/ 21:
                    message.executionflowETA = ETA.internalBinaryRead(reader, reader.uint32(), options, message.executionflowETA);
                    break;
                case /* api.ETA ExecutionflowETAComputed = 22 [json_name = "ExecutionflowETAComputed"];*/ 22:
                    message.executionflowETAComputed = ETA.internalBinaryRead(reader, reader.uint32(), options, message.executionflowETAComputed);
                    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: ExecutionflowPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.DateTime CreationDateTime = 1 [json_name = "CreationDateTime"]; */
        if (message.creationDateTime)
            DateTime.internalBinaryWrite(message.creationDateTime, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string OrderID = 2 [json_name = "OrderID"]; */
        if (message.orderID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.orderID);
        /* repeated api.MetadataElement MetaData = 3 [json_name = "MetaData"]; */
        for (let i = 0; i < message.metaData.length; i++)
            MetadataElement.internalBinaryWrite(message.metaData[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier ShipFrom = 4 [json_name = "ShipFrom"]; */
        if (message.shipFrom)
            TradeTier.internalBinaryWrite(message.shipFrom, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier ShipTo = 5 [json_name = "ShipTo"]; */
        if (message.shipTo)
            TradeTier.internalBinaryWrite(message.shipTo, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* api.TradeTier Carrier = 6 [json_name = "Carrier"]; */
        if (message.carrier)
            TradeTier.internalBinaryWrite(message.carrier, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
        /* string CarrierService = 7 [json_name = "CarrierService"]; */
        if (message.carrierService !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.carrierService);
        /* api.OrderRequestedMilestones RequestedMilestones = 8 [json_name = "RequestedMilestones"]; */
        if (message.requestedMilestones)
            OrderRequestedMilestones.internalBinaryWrite(message.requestedMilestones, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.ExeFlowLine Lines = 9 [json_name = "Lines"]; */
        for (let i = 0; i < message.lines.length; i++)
            ExeFlowLine.internalBinaryWrite(message.lines[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.HandlingunitSummary Handlingunits = 11 [json_name = "Handlingunits"]; */
        for (let i = 0; i < message.handlingunits.length; i++)
            HandlingunitSummary.internalBinaryWrite(message.handlingunits[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join();
        /* api.ExecutionflowStatusStruct Status = 13 [json_name = "Status"]; */
        if (message.status)
            ExecutionflowStatusStruct.internalBinaryWrite(message.status, writer.tag(13, WireType.LengthDelimited).fork(), options).join();
        /* bool ShipFromAcked = 14 [json_name = "ShipFromAcked"]; */
        if (message.shipFromAcked !== false)
            writer.tag(14, WireType.Varint).bool(message.shipFromAcked);
        /* bool ShipToAcked = 15 [json_name = "ShipToAcked"]; */
        if (message.shipToAcked !== false)
            writer.tag(15, WireType.Varint).bool(message.shipToAcked);
        /* repeated api.AttachmentSummary Attachments = 16 [json_name = "Attachments"]; */
        for (let i = 0; i < message.attachments.length; i++)
            AttachmentSummary.internalBinaryWrite(message.attachments[i], writer.tag(16, WireType.LengthDelimited).fork(), options).join();
        /* int32 AttachmentNumber = 17 [json_name = "AttachmentNumber"]; */
        if (message.attachmentNumber !== 0)
            writer.tag(17, WireType.Varint).int32(message.attachmentNumber);
        /* repeated api.ClaimSummary Claims = 18 [json_name = "Claims"]; */
        for (let i = 0; i < message.claims.length; i++)
            ClaimSummary.internalBinaryWrite(message.claims[i], writer.tag(18, WireType.LengthDelimited).fork(), options).join();
        /* int32 ClaimNumber = 19 [json_name = "ClaimNumber"]; */
        if (message.claimNumber !== 0)
            writer.tag(19, WireType.Varint).int32(message.claimNumber);
        /* repeated api.ETAbyHU HandlingunitETAs = 20 [json_name = "HandlingunitETAs"]; */
        for (let i = 0; i < message.handlingunitETAs.length; i++)
            ETAbyHU.internalBinaryWrite(message.handlingunitETAs[i], writer.tag(20, WireType.LengthDelimited).fork(), options).join();
        /* api.ETA ExecutionflowETA = 21 [json_name = "ExecutionflowETA"]; */
        if (message.executionflowETA)
            ETA.internalBinaryWrite(message.executionflowETA, writer.tag(21, WireType.LengthDelimited).fork(), options).join();
        /* api.ETA ExecutionflowETAComputed = 22 [json_name = "ExecutionflowETAComputed"]; */
        if (message.executionflowETAComputed)
            ETA.internalBinaryWrite(message.executionflowETAComputed, writer.tag(22, 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.ExecutionflowPayload
 */
export const ExecutionflowPayload = new ExecutionflowPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Executionflow$Type extends MessageType<Executionflow> {
    constructor() {
        super("api.Executionflow", [
            { no: 1, name: "LastEventHeader", kind: "message", jsonName: "LastEventHeader", T: () => EventHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => ExecutionflowPayload }
        ]);
    }
    create(value?: PartialMessage<Executionflow>): Executionflow {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<Executionflow>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Executionflow): Executionflow {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"];*/ 1:
                    message.lastEventHeader = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.lastEventHeader);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.ExecutionflowPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = ExecutionflowPayload.internalBinaryRead(reader, reader.uint32(), options, message.payload);
                    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: Executionflow, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"]; */
        if (message.lastEventHeader)
            EventHeader.internalBinaryWrite(message.lastEventHeader, 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.ExecutionflowPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            ExecutionflowPayload.internalBinaryWrite(message.payload, writer.tag(3, 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.Executionflow
 */
export const Executionflow = new Executionflow$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionflowEnrichment$Type extends MessageType<ExecutionflowEnrichment> {
    constructor() {
        super("api.ExecutionflowEnrichment", [
            { no: 1, name: "ParentEventID", kind: "scalar", jsonName: "ParentEventID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "EntityName", kind: "scalar", jsonName: "EntityName", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "EntityRefID", kind: "scalar", jsonName: "EntityRefID", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "RefFilter", kind: "scalar", jsonName: "RefFilter", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "MergePath", kind: "scalar", jsonName: "MergePath", T: 9 /*ScalarType.STRING*/ },
            { no: 10, name: "Item", kind: "message", jsonName: "Item", oneof: "content", T: () => ItemPayload },
            { no: 11, name: "Actor", kind: "message", jsonName: "Actor", oneof: "content", T: () => ActorPayload },
            { no: 12, name: "Partner", kind: "message", jsonName: "Partner", oneof: "content", T: () => PartnerPayload },
            { no: 6, name: "Project", kind: "scalar", jsonName: "Project", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "ParentEntityName", kind: "scalar", jsonName: "ParentEntityName", T: 9 /*ScalarType.STRING*/ },
            { no: 8, name: "ParentEntityID", kind: "scalar", jsonName: "ParentEntityID", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<ExecutionflowEnrichment>): ExecutionflowEnrichment {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.parentEventID = "";
        message.entityName = "";
        message.entityRefID = "";
        message.refFilter = "";
        message.mergePath = "";
        message.content = { oneofKind: undefined };
        message.project = "";
        message.parentEntityName = "";
        message.parentEntityID = "";
        if (value !== undefined)
            reflectionMergePartial<ExecutionflowEnrichment>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExecutionflowEnrichment): ExecutionflowEnrichment {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string ParentEventID = 1 [json_name = "ParentEventID"];*/ 1:
                    message.parentEventID = reader.string();
                    break;
                case /* string EntityName = 2 [json_name = "EntityName"];*/ 2:
                    message.entityName = reader.string();
                    break;
                case /* string EntityRefID = 3 [json_name = "EntityRefID"];*/ 3:
                    message.entityRefID = reader.string();
                    break;
                case /* string RefFilter = 4 [json_name = "RefFilter"];*/ 4:
                    message.refFilter = reader.string();
                    break;
                case /* string MergePath = 5 [json_name = "MergePath"];*/ 5:
                    message.mergePath = reader.string();
                    break;
                case /* api.ItemPayload Item = 10 [json_name = "Item"];*/ 10:
                    message.content = {
                        oneofKind: "item",
                        item: ItemPayload.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).item)
                    };
                    break;
                case /* api.ActorPayload Actor = 11 [json_name = "Actor"];*/ 11:
                    message.content = {
                        oneofKind: "actor",
                        actor: ActorPayload.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).actor)
                    };
                    break;
                case /* api.PartnerPayload Partner = 12 [json_name = "Partner"];*/ 12:
                    message.content = {
                        oneofKind: "partner",
                        partner: PartnerPayload.internalBinaryRead(reader, reader.uint32(), options, (message.content as any).partner)
                    };
                    break;
                case /* string Project = 6 [json_name = "Project"];*/ 6:
                    message.project = reader.string();
                    break;
                case /* string ParentEntityName = 7 [json_name = "ParentEntityName"];*/ 7:
                    message.parentEntityName = reader.string();
                    break;
                case /* string ParentEntityID = 8 [json_name = "ParentEntityID"];*/ 8:
                    message.parentEntityID = 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: ExecutionflowEnrichment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string ParentEventID = 1 [json_name = "ParentEventID"]; */
        if (message.parentEventID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.parentEventID);
        /* string EntityName = 2 [json_name = "EntityName"]; */
        if (message.entityName !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.entityName);
        /* string EntityRefID = 3 [json_name = "EntityRefID"]; */
        if (message.entityRefID !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.entityRefID);
        /* string RefFilter = 4 [json_name = "RefFilter"]; */
        if (message.refFilter !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.refFilter);
        /* string MergePath = 5 [json_name = "MergePath"]; */
        if (message.mergePath !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.mergePath);
        /* api.ItemPayload Item = 10 [json_name = "Item"]; */
        if (message.content.oneofKind === "item")
            ItemPayload.internalBinaryWrite(message.content.item, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
        /* api.ActorPayload Actor = 11 [json_name = "Actor"]; */
        if (message.content.oneofKind === "actor")
            ActorPayload.internalBinaryWrite(message.content.actor, writer.tag(11, WireType.LengthDelimited).fork(), options).join();
        /* api.PartnerPayload Partner = 12 [json_name = "Partner"]; */
        if (message.content.oneofKind === "partner")
            PartnerPayload.internalBinaryWrite(message.content.partner, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
        /* string Project = 6 [json_name = "Project"]; */
        if (message.project !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.project);
        /* string ParentEntityName = 7 [json_name = "ParentEntityName"]; */
        if (message.parentEntityName !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.parentEntityName);
        /* string ParentEntityID = 8 [json_name = "ParentEntityID"]; */
        if (message.parentEntityID !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.parentEntityID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ExecutionflowEnrichment
 */
export const ExecutionflowEnrichment = new ExecutionflowEnrichment$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ExecutionflowTriplet$Type extends MessageType<ExecutionflowTriplet> {
    constructor() {
        super("api.ExecutionflowTriplet", [
            { no: 1, name: "Current", kind: "message", jsonName: "Current", T: () => Executionflow },
            { no: 2, name: "Previous", kind: "message", jsonName: "Previous", T: () => Executionflow },
            { no: 3, name: "LastEvent", kind: "message", jsonName: "LastEvent", T: () => Executionflow }
        ]);
    }
    create(value?: PartialMessage<ExecutionflowTriplet>): ExecutionflowTriplet {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<ExecutionflowTriplet>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExecutionflowTriplet): ExecutionflowTriplet {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Executionflow Current = 1 [json_name = "Current"];*/ 1:
                    message.current = Executionflow.internalBinaryRead(reader, reader.uint32(), options, message.current);
                    break;
                case /* api.Executionflow Previous = 2 [json_name = "Previous"];*/ 2:
                    message.previous = Executionflow.internalBinaryRead(reader, reader.uint32(), options, message.previous);
                    break;
                case /* api.Executionflow LastEvent = 3 [json_name = "LastEvent"];*/ 3:
                    message.lastEvent = Executionflow.internalBinaryRead(reader, reader.uint32(), options, message.lastEvent);
                    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: ExecutionflowTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Executionflow Current = 1 [json_name = "Current"]; */
        if (message.current)
            Executionflow.internalBinaryWrite(message.current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.Executionflow Previous = 2 [json_name = "Previous"]; */
        if (message.previous)
            Executionflow.internalBinaryWrite(message.previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.Executionflow LastEvent = 3 [json_name = "LastEvent"]; */
        if (message.lastEvent)
            Executionflow.internalBinaryWrite(message.lastEvent, writer.tag(3, 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.ExecutionflowTriplet
 */
export const ExecutionflowTriplet = new ExecutionflowTriplet$Type();
