// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "movement.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 { ItemPayload } from "./item";
import { EntityID } from "./shared";
import { EventHeader } from "./shared";
import { AttachmentSummary } from "./shared";
import { QuantityInLV } from "./warehousingShared";
import { MovementStatusStruct } from "./warehousingShared";
import { ClaimSummary } from "./shared";
import { StockMovement } from "./warehousingShared";
import { ActorPayload } from "./actor";
import { EnrichedGoods } from "./warehousingShared";
// 
// This entity represents the stock Movement for a goods.
// 
// The Movement ID.RefID will be built as  UID
// 
// It means the Movement input events could not be exposed directly to end user, we need to keep it 'behind' other entities in order to being able to build its ID.RefID.
// 
// 
// Comments updated 2024/04/04

/**
 * @generated from protobuf message api.MovementPayload
 */
export interface MovementPayload {
    /**
     * @generated from protobuf field: api.EnrichedGoods Goods = 1 [json_name = "Goods"];
     */
    goods?: EnrichedGoods;
    /**
     * @generated from protobuf field: string ActorID = 2 [json_name = "ActorID"];
     */
    actorID: string;
    /**
     * @generated from protobuf field: api.ActorPayload Actor = 3 [json_name = "Actor"];
     */
    actor?: ActorPayload;
    /**
     * @generated from protobuf field: api.StockMovement Movement = 4 [json_name = "Movement"];
     */
    movement?: StockMovement;
    /**
     * @generated from protobuf field: repeated api.ClaimSummary Claims = 5 [json_name = "Claims"];
     */
    claims: ClaimSummary[];
    /**
     * @generated from protobuf field: int32 ClaimNumber = 6 [json_name = "ClaimNumber"];
     */
    claimNumber: number;
    /**
     * @generated from protobuf field: api.MovementStatusStruct Status = 7 [json_name = "Status"];
     */
    status?: MovementStatusStruct; // Status field is not accessible from APIs
    /**
     * @generated from protobuf field: api.QuantityInLV QuantityInBaseLV = 8 [json_name = "QuantityInBaseLV"];
     */
    quantityInBaseLV?: QuantityInLV;
    /**
     * @generated from protobuf field: repeated api.AttachmentSummary Attachments = 9 [json_name = "Attachments"];
     */
    attachments: AttachmentSummary[];
    /**
     * @generated from protobuf field: int32 AttachmentNumber = 10 [json_name = "AttachmentNumber"];
     */
    attachmentNumber: number;
}
/**
 *
 * Movement entity Structure
 *
 * @generated from protobuf message api.Movement
 */
export interface Movement {
    /**
     * @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.MovementPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: MovementPayload;
}
/**
 * @generated from protobuf message api.MovementEnrichment
 */
export interface MovementEnrichment {
    /**
     * @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: 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.MovementTriplet
 */
export interface MovementTriplet {
    /**
     * @generated from protobuf field: api.Movement Current = 1 [json_name = "Current"];
     */
    current?: Movement;
    /**
     * @generated from protobuf field: api.Movement Previous = 2 [json_name = "Previous"];
     */
    previous?: Movement;
    /**
     * @generated from protobuf field: api.Movement LastEvent = 3 [json_name = "LastEvent"];
     */
    lastEvent?: Movement;
}
// @generated message type with reflection information, may provide speed optimized methods
class MovementPayload$Type extends MessageType<MovementPayload> {
    constructor() {
        super("api.MovementPayload", [
            { no: 1, name: "Goods", kind: "message", jsonName: "Goods", T: () => EnrichedGoods, options: { "api.transientRef": "Stock,Payload.Goods,hard" } },
            { no: 2, name: "ActorID", kind: "scalar", jsonName: "ActorID", T: 9 /*ScalarType.STRING*/, options: { "api.entityRef": "Actor", "api.dataRestrictionKey": "Movement", "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.kpiItems": { Items: [{ Context: "Movement", Group: "movement", Queryable: true }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
            { no: 3, name: "Actor", kind: "message", jsonName: "Actor", T: () => ActorPayload, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.extractRefExclude": "Movement" } },
            { no: 4, name: "Movement", kind: "message", jsonName: "Movement", T: () => StockMovement },
            { no: 5, 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: 6, 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: 7, name: "Status", kind: "message", jsonName: "Status", T: () => MovementStatusStruct, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
            { no: 8, name: "QuantityInBaseLV", kind: "message", jsonName: "QuantityInBaseLV", T: () => QuantityInLV, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
            { no: 9, 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: 10, name: "AttachmentNumber", kind: "scalar", jsonName: "AttachmentNumber", T: 5 /*ScalarType.INT32*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Total number of attachments" } } }
        ]);
    }
    create(value?: PartialMessage<MovementPayload>): MovementPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.actorID = "";
        message.claims = [];
        message.claimNumber = 0;
        message.attachments = [];
        message.attachmentNumber = 0;
        if (value !== undefined)
            reflectionMergePartial<MovementPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementPayload): MovementPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EnrichedGoods Goods = 1 [json_name = "Goods"];*/ 1:
                    message.goods = EnrichedGoods.internalBinaryRead(reader, reader.uint32(), options, message.goods);
                    break;
                case /* string ActorID = 2 [json_name = "ActorID"];*/ 2:
                    message.actorID = reader.string();
                    break;
                case /* api.ActorPayload Actor = 3 [json_name = "Actor"];*/ 3:
                    message.actor = ActorPayload.internalBinaryRead(reader, reader.uint32(), options, message.actor);
                    break;
                case /* api.StockMovement Movement = 4 [json_name = "Movement"];*/ 4:
                    message.movement = StockMovement.internalBinaryRead(reader, reader.uint32(), options, message.movement);
                    break;
                case /* repeated api.ClaimSummary Claims = 5 [json_name = "Claims"];*/ 5:
                    message.claims.push(ClaimSummary.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* int32 ClaimNumber = 6 [json_name = "ClaimNumber"];*/ 6:
                    message.claimNumber = reader.int32();
                    break;
                case /* api.MovementStatusStruct Status = 7 [json_name = "Status"];*/ 7:
                    message.status = MovementStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.status);
                    break;
                case /* api.QuantityInLV QuantityInBaseLV = 8 [json_name = "QuantityInBaseLV"];*/ 8:
                    message.quantityInBaseLV = QuantityInLV.internalBinaryRead(reader, reader.uint32(), options, message.quantityInBaseLV);
                    break;
                case /* repeated api.AttachmentSummary Attachments = 9 [json_name = "Attachments"];*/ 9:
                    message.attachments.push(AttachmentSummary.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* int32 AttachmentNumber = 10 [json_name = "AttachmentNumber"];*/ 10:
                    message.attachmentNumber = reader.int32();
                    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: MovementPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EnrichedGoods Goods = 1 [json_name = "Goods"]; */
        if (message.goods)
            EnrichedGoods.internalBinaryWrite(message.goods, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* string ActorID = 2 [json_name = "ActorID"]; */
        if (message.actorID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.actorID);
        /* api.ActorPayload Actor = 3 [json_name = "Actor"]; */
        if (message.actor)
            ActorPayload.internalBinaryWrite(message.actor, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
        /* api.StockMovement Movement = 4 [json_name = "Movement"]; */
        if (message.movement)
            StockMovement.internalBinaryWrite(message.movement, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.ClaimSummary Claims = 5 [json_name = "Claims"]; */
        for (let i = 0; i < message.claims.length; i++)
            ClaimSummary.internalBinaryWrite(message.claims[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
        /* int32 ClaimNumber = 6 [json_name = "ClaimNumber"]; */
        if (message.claimNumber !== 0)
            writer.tag(6, WireType.Varint).int32(message.claimNumber);
        /* api.MovementStatusStruct Status = 7 [json_name = "Status"]; */
        if (message.status)
            MovementStatusStruct.internalBinaryWrite(message.status, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* api.QuantityInLV QuantityInBaseLV = 8 [json_name = "QuantityInBaseLV"]; */
        if (message.quantityInBaseLV)
            QuantityInLV.internalBinaryWrite(message.quantityInBaseLV, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
        /* repeated api.AttachmentSummary Attachments = 9 [json_name = "Attachments"]; */
        for (let i = 0; i < message.attachments.length; i++)
            AttachmentSummary.internalBinaryWrite(message.attachments[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join();
        /* int32 AttachmentNumber = 10 [json_name = "AttachmentNumber"]; */
        if (message.attachmentNumber !== 0)
            writer.tag(10, WireType.Varint).int32(message.attachmentNumber);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.MovementPayload
 */
export const MovementPayload = new MovementPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Movement$Type extends MessageType<Movement> {
    constructor() {
        super("api.Movement", [
            { 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: () => MovementPayload }
        ]);
    }
    create(value?: PartialMessage<Movement>): Movement {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<Movement>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Movement): Movement {
        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.MovementPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = MovementPayload.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: Movement, 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.MovementPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            MovementPayload.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.Movement
 */
export const Movement = new Movement$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementEnrichment$Type extends MessageType<MovementEnrichment> {
    constructor() {
        super("api.MovementEnrichment", [
            { 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: 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<MovementEnrichment>): MovementEnrichment {
        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<MovementEnrichment>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementEnrichment): MovementEnrichment {
        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 /* 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: MovementEnrichment, 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();
        /* 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.MovementEnrichment
 */
export const MovementEnrichment = new MovementEnrichment$Type();
// @generated message type with reflection information, may provide speed optimized methods
class MovementTriplet$Type extends MessageType<MovementTriplet> {
    constructor() {
        super("api.MovementTriplet", [
            { no: 1, name: "Current", kind: "message", jsonName: "Current", T: () => Movement },
            { no: 2, name: "Previous", kind: "message", jsonName: "Previous", T: () => Movement },
            { no: 3, name: "LastEvent", kind: "message", jsonName: "LastEvent", T: () => Movement }
        ]);
    }
    create(value?: PartialMessage<MovementTriplet>): MovementTriplet {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<MovementTriplet>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MovementTriplet): MovementTriplet {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Movement Current = 1 [json_name = "Current"];*/ 1:
                    message.current = Movement.internalBinaryRead(reader, reader.uint32(), options, message.current);
                    break;
                case /* api.Movement Previous = 2 [json_name = "Previous"];*/ 2:
                    message.previous = Movement.internalBinaryRead(reader, reader.uint32(), options, message.previous);
                    break;
                case /* api.Movement LastEvent = 3 [json_name = "LastEvent"];*/ 3:
                    message.lastEvent = Movement.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: MovementTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Movement Current = 1 [json_name = "Current"]; */
        if (message.current)
            Movement.internalBinaryWrite(message.current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.Movement Previous = 2 [json_name = "Previous"]; */
        if (message.previous)
            Movement.internalBinaryWrite(message.previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.Movement LastEvent = 3 [json_name = "LastEvent"]; */
        if (message.lastEvent)
            Movement.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.MovementTriplet
 */
export const MovementTriplet = new MovementTriplet$Type();
