// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "stockInput.proto" (package "api", syntax proto3)
// tslint:disable
import { ServiceType } from "@protobuf-ts/runtime-rpc";
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { StockSnapshot } from "./warehousingShared";
import { ResponseHeader } from "./shared";
import { NoID } from "./shared";
import { RequestProjectHeader } from "./shared";
import { EntityID } from "./shared";
import { EventHeader } from "./shared";
import { StockMovement } from "./warehousingShared";
import { ActorPayload } from "./actor";
import { EnrichedGoods } from "./warehousingShared";
/**
 *
 * Update the goods stock counter with the provided goods quantity.
 * Also updates the prepared quantity (outbound).
 * May also update the pre-received qty (inbound).
 *
 * This event is received from Stock entity.
 *
 * This event is used when the Stock is physically moved from/into the warehouse to De/Increment the physical Stock counter of this goods.
 *
 * The ID part of the request is removed, because the Stock ID.RefID is built internally from the Payload.Goods.
 * A specific algorithm will be implemented on api-server and all actions which result this event.
 *
 * @generated from protobuf message api.StockMovedPayload
 */
export interface StockMovedPayload {
    /**
     * @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 = 7 [json_name = "Actor"];
     */
    actor?: ActorPayload;
    /**
     * @generated from protobuf field: api.StockMovement Movement = 8 [json_name = "Movement"];
     */
    movement?: StockMovement;
}
/**
 * @generated from protobuf message api.StockMovedEvent
 */
export interface StockMovedEvent {
    /**
     * @generated from protobuf field: api.EventHeader Header = 1 [json_name = "Header"];
     */
    header?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.StockMovedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: StockMovedPayload;
}
/**
 * @generated from protobuf message api.StockMovedRequest
 */
export interface StockMovedRequest {
    /**
     * Header of the event request
     *
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.NoID ID = 4 [json_name = "ID"];
     */
    iD?: NoID;
    /**
     * Content of the event request
     *
     * @generated from protobuf field: api.StockMovedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: StockMovedPayload;
}
/**
 * @generated from protobuf message api.StockMovedResponse
 */
export interface StockMovedResponse {
    /**
     * Header of the response
     *
     * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"];
     */
    header?: ResponseHeader;
    /**
     * Identifier of the stock the request event was applied on
     *
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
}
/**
 *
 * The measured stock quantity at the given date time.
 * Event received from a wms inventory.
 *
 * The ID part of the request is removed, because the Stock ID.RefID is built internally from the Payload.Goods.
 * A specific algorithm will be implemented on api-server and all actions which result this event.
 *
 * @generated from protobuf message api.StockSnapshottedPayload
 */
export interface StockSnapshottedPayload {
    /**
     * Description of the goods
     *
     * @generated from protobuf field: api.EnrichedGoods Goods = 1 [json_name = "Goods"];
     */
    goods?: EnrichedGoods;
    /**
     * Identifier of the actor where the stock is located
     *
     * @generated from protobuf field: string ActorID = 2 [json_name = "ActorID"];
     */
    actorID: string;
    /**
     * @generated from protobuf field: api.ActorPayload Actor = 7 [json_name = "Actor"];
     */
    actor?: ActorPayload;
    /**
     * Description of the snapshot
     *
     * @generated from protobuf field: api.StockSnapshot Snapshot = 8 [json_name = "Snapshot"];
     */
    snapshot?: StockSnapshot;
}
/**
 * @generated from protobuf message api.StockSnapshottedEvent
 */
export interface StockSnapshottedEvent {
    /**
     * @generated from protobuf field: api.EventHeader Header = 1 [json_name = "Header"];
     */
    header?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.StockSnapshottedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: StockSnapshottedPayload;
}
/**
 * @generated from protobuf message api.StockSnapshottedRequest
 */
export interface StockSnapshottedRequest {
    /**
     * Header of the event request
     *
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.NoID ID = 4 [json_name = "ID"];
     */
    iD?: NoID;
    /**
     * Content of the event request
     *
     * @generated from protobuf field: api.StockSnapshottedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: StockSnapshottedPayload;
}
/**
 * @generated from protobuf message api.StockSnapshottedResponse
 */
export interface StockSnapshottedResponse {
    /**
     * Header of the response
     *
     * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"];
     */
    header?: ResponseHeader;
    /**
     * Identifier of the stock the request event was applied on
     *
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
}
/**
 *
 * DEPRECATED
 * The stock entry has been deleted.
 * Event received from a wms.
 *
 * The ID part of the request is removed, because the Stock ID.RefID is built internally from the Payload.Goods.
 * A specific algorithm will be implemented on api-server and all actions which result this event.
 *
 * @generated from protobuf message api.StockDeletedPayload
 */
export interface StockDeletedPayload {
    /**
     * Description of the goods
     *
     * @generated from protobuf field: api.EnrichedGoods Goods = 1 [json_name = "Goods"];
     */
    goods?: EnrichedGoods;
    /**
     * Identifier of the actor where the stock is located
     *
     * @generated from protobuf field: string ActorID = 2 [json_name = "ActorID"];
     */
    actorID: string;
    /**
     * @generated from protobuf field: api.ActorPayload Actor = 7 [json_name = "Actor"];
     */
    actor?: ActorPayload;
}
/**
 * @generated from protobuf message api.StockDeletedEvent
 */
export interface StockDeletedEvent {
    /**
     * @generated from protobuf field: api.EventHeader Header = 1 [json_name = "Header"];
     */
    header?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.StockDeletedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: StockDeletedPayload;
}
/**
 * @generated from protobuf message api.StockDeletedRequest
 */
export interface StockDeletedRequest {
    /**
     * Header of the event request
     *
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.NoID ID = 4 [json_name = "ID"];
     */
    iD?: NoID;
    /**
     * Content of the event request
     *
     * @generated from protobuf field: api.StockDeletedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: StockDeletedPayload;
}
/**
 * @generated from protobuf message api.StockDeletedResponse
 */
export interface StockDeletedResponse {
    /**
     * Header of the response
     *
     * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"];
     */
    header?: ResponseHeader;
    /**
     * Identifier of the stock the request event was applied on
     *
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
}
// @generated message type with reflection information, may provide speed optimized methods
class StockMovedPayload$Type extends MessageType<StockMovedPayload> {
    constructor() {
        super("api.StockMovedPayload", [
            { no: 1, name: "Goods", kind: "message", jsonName: "Goods", T: () => EnrichedGoods, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ActorID", kind: "scalar", jsonName: "ActorID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "api.entityRef": "Actor" } },
            { no: 7, name: "Actor", kind: "message", jsonName: "Actor", T: () => ActorPayload, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
            { no: 8, name: "Movement", kind: "message", jsonName: "Movement", T: () => StockMovement, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Update the goods stock counter with the provided goods quantity", required: ["Goods", "ActorID", "Movement"] } }, "api.messageType": "Event", "api.payload": true, "api.inputEvent": "Moved", "api.postAggMethods": "computeMovementQuantity,quantityByBranchLVs", "api.preAggMethods": "filterMovement,stackMovement", "api.idGenMethod": "genStockMovedId" });
    }
    create(value?: PartialMessage<StockMovedPayload>): StockMovedPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.actorID = "";
        if (value !== undefined)
            reflectionMergePartial<StockMovedPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockMovedPayload): StockMovedPayload {
        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 = 7 [json_name = "Actor"];*/ 7:
                    message.actor = ActorPayload.internalBinaryRead(reader, reader.uint32(), options, message.actor);
                    break;
                case /* api.StockMovement Movement = 8 [json_name = "Movement"];*/ 8:
                    message.movement = StockMovement.internalBinaryRead(reader, reader.uint32(), options, message.movement);
                    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: StockMovedPayload, 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 = 7 [json_name = "Actor"]; */
        if (message.actor)
            ActorPayload.internalBinaryWrite(message.actor, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* api.StockMovement Movement = 8 [json_name = "Movement"]; */
        if (message.movement)
            StockMovement.internalBinaryWrite(message.movement, writer.tag(8, 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.StockMovedPayload
 */
export const StockMovedPayload = new StockMovedPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockMovedEvent$Type extends MessageType<StockMovedEvent> {
    constructor() {
        super("api.StockMovedEvent", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => EventHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => StockMovedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "api.messageType": "Event", "api.inputEvent": "Moved" });
    }
    create(value?: PartialMessage<StockMovedEvent>): StockMovedEvent {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockMovedEvent>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockMovedEvent): StockMovedEvent {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = EventHeader.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.StockMovedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = StockMovedPayload.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: StockMovedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            EventHeader.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.StockMovedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            StockMovedPayload.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.StockMovedEvent
 */
export const StockMovedEvent = new StockMovedEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockMovedRequest$Type extends MessageType<StockMovedRequest> {
    constructor() {
        super("api.StockMovedRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Header of the event request" } } },
            { no: 4, name: "ID", kind: "message", jsonName: "ID", T: () => NoID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => StockMovedPayload, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Content of the event request" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Payload"] } }, "api.messageType": "Request", "api.inputEvent": "Moved" });
    }
    create(value?: PartialMessage<StockMovedRequest>): StockMovedRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockMovedRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockMovedRequest): StockMovedRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.NoID ID = 4 [json_name = "ID"];*/ 4:
                    message.iD = NoID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.StockMovedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = StockMovedPayload.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: StockMovedRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.NoID ID = 4 [json_name = "ID"]; */
        if (message.iD)
            NoID.internalBinaryWrite(message.iD, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.StockMovedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            StockMovedPayload.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.StockMovedRequest
 */
export const StockMovedRequest = new StockMovedRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockMovedResponse$Type extends MessageType<StockMovedResponse> {
    constructor() {
        super("api.StockMovedResponse", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Header of the response" } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the stock the request event was applied on" } } }
        ], { "api.messageType": "Response", "api.inputEvent": "Moved" });
    }
    create(value?: PartialMessage<StockMovedResponse>): StockMovedResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockMovedResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockMovedResponse): StockMovedResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResponseHeader.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;
                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: StockMovedResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResponseHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResponseHeader.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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.StockMovedResponse
 */
export const StockMovedResponse = new StockMovedResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockSnapshottedPayload$Type extends MessageType<StockSnapshottedPayload> {
    constructor() {
        super("api.StockSnapshottedPayload", [
            { no: 1, name: "Goods", kind: "message", jsonName: "Goods", T: () => EnrichedGoods, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Description of the goods" } } },
            { no: 2, name: "ActorID", kind: "scalar", jsonName: "ActorID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the actor where the stock is located" }, "api.entityRef": "Actor" } },
            { no: 7, name: "Actor", kind: "message", jsonName: "Actor", T: () => ActorPayload, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
            { no: 8, name: "Snapshot", kind: "message", jsonName: "Snapshot", T: () => StockSnapshot, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Description of the snapshot" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "The measured stock quantity at the given date time", required: ["Goods", "ActorID", "Snapshot"] } }, "api.messageType": "Event", "api.payload": true, "api.inputEvent": "Snapshotted", "api.postAggMethods": "computeSnapshotQuantity,quantityByBranchLVs", "api.preAggMethods": "cumulateSnapshotQuantity", "api.idGenMethod": "genStockSnapshottedId" });
    }
    create(value?: PartialMessage<StockSnapshottedPayload>): StockSnapshottedPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.actorID = "";
        if (value !== undefined)
            reflectionMergePartial<StockSnapshottedPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockSnapshottedPayload): StockSnapshottedPayload {
        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 = 7 [json_name = "Actor"];*/ 7:
                    message.actor = ActorPayload.internalBinaryRead(reader, reader.uint32(), options, message.actor);
                    break;
                case /* api.StockSnapshot Snapshot = 8 [json_name = "Snapshot"];*/ 8:
                    message.snapshot = StockSnapshot.internalBinaryRead(reader, reader.uint32(), options, message.snapshot);
                    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: StockSnapshottedPayload, 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 = 7 [json_name = "Actor"]; */
        if (message.actor)
            ActorPayload.internalBinaryWrite(message.actor, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* api.StockSnapshot Snapshot = 8 [json_name = "Snapshot"]; */
        if (message.snapshot)
            StockSnapshot.internalBinaryWrite(message.snapshot, writer.tag(8, 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.StockSnapshottedPayload
 */
export const StockSnapshottedPayload = new StockSnapshottedPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockSnapshottedEvent$Type extends MessageType<StockSnapshottedEvent> {
    constructor() {
        super("api.StockSnapshottedEvent", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => EventHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => StockSnapshottedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "api.messageType": "Event", "api.inputEvent": "Snapshotted" });
    }
    create(value?: PartialMessage<StockSnapshottedEvent>): StockSnapshottedEvent {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockSnapshottedEvent>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockSnapshottedEvent): StockSnapshottedEvent {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = EventHeader.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.StockSnapshottedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = StockSnapshottedPayload.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: StockSnapshottedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            EventHeader.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.StockSnapshottedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            StockSnapshottedPayload.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.StockSnapshottedEvent
 */
export const StockSnapshottedEvent = new StockSnapshottedEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockSnapshottedRequest$Type extends MessageType<StockSnapshottedRequest> {
    constructor() {
        super("api.StockSnapshottedRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Header of the event request" } } },
            { no: 4, name: "ID", kind: "message", jsonName: "ID", T: () => NoID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => StockSnapshottedPayload, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Content of the event request" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Payload"] } }, "api.messageType": "Request", "api.inputEvent": "Snapshotted" });
    }
    create(value?: PartialMessage<StockSnapshottedRequest>): StockSnapshottedRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockSnapshottedRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockSnapshottedRequest): StockSnapshottedRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.NoID ID = 4 [json_name = "ID"];*/ 4:
                    message.iD = NoID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.StockSnapshottedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = StockSnapshottedPayload.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: StockSnapshottedRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.NoID ID = 4 [json_name = "ID"]; */
        if (message.iD)
            NoID.internalBinaryWrite(message.iD, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.StockSnapshottedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            StockSnapshottedPayload.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.StockSnapshottedRequest
 */
export const StockSnapshottedRequest = new StockSnapshottedRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockSnapshottedResponse$Type extends MessageType<StockSnapshottedResponse> {
    constructor() {
        super("api.StockSnapshottedResponse", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Header of the response" } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the stock the request event was applied on" } } }
        ], { "api.messageType": "Response", "api.inputEvent": "Snapshotted" });
    }
    create(value?: PartialMessage<StockSnapshottedResponse>): StockSnapshottedResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockSnapshottedResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockSnapshottedResponse): StockSnapshottedResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResponseHeader.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;
                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: StockSnapshottedResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResponseHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResponseHeader.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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.StockSnapshottedResponse
 */
export const StockSnapshottedResponse = new StockSnapshottedResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockDeletedPayload$Type extends MessageType<StockDeletedPayload> {
    constructor() {
        super("api.StockDeletedPayload", [
            { no: 1, name: "Goods", kind: "message", jsonName: "Goods", T: () => EnrichedGoods, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Description of the goods" } } },
            { no: 2, name: "ActorID", kind: "scalar", jsonName: "ActorID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the actor where the stock is located" }, "api.entityRef": "Actor" } },
            { no: 7, name: "Actor", kind: "message", jsonName: "Actor", T: () => ActorPayload, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "The stock entry has been deleted", required: ["Goods", "ActorID"] } }, "api.messageType": "Event", "api.payload": true, "api.inputEvent": "Deleted", "api.preAggMethods": "checkEmptyStock", "api.idGenMethod": "genStockDeletedId" });
    }
    create(value?: PartialMessage<StockDeletedPayload>): StockDeletedPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.actorID = "";
        if (value !== undefined)
            reflectionMergePartial<StockDeletedPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockDeletedPayload): StockDeletedPayload {
        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 = 7 [json_name = "Actor"];*/ 7:
                    message.actor = ActorPayload.internalBinaryRead(reader, reader.uint32(), options, message.actor);
                    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: StockDeletedPayload, 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 = 7 [json_name = "Actor"]; */
        if (message.actor)
            ActorPayload.internalBinaryWrite(message.actor, 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.StockDeletedPayload
 */
export const StockDeletedPayload = new StockDeletedPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockDeletedEvent$Type extends MessageType<StockDeletedEvent> {
    constructor() {
        super("api.StockDeletedEvent", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => EventHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => StockDeletedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "api.messageType": "Event", "api.inputEvent": "Deleted" });
    }
    create(value?: PartialMessage<StockDeletedEvent>): StockDeletedEvent {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockDeletedEvent>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockDeletedEvent): StockDeletedEvent {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = EventHeader.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.StockDeletedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = StockDeletedPayload.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: StockDeletedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            EventHeader.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.StockDeletedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            StockDeletedPayload.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.StockDeletedEvent
 */
export const StockDeletedEvent = new StockDeletedEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockDeletedRequest$Type extends MessageType<StockDeletedRequest> {
    constructor() {
        super("api.StockDeletedRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Header of the event request" } } },
            { no: 4, name: "ID", kind: "message", jsonName: "ID", T: () => NoID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => StockDeletedPayload, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Content of the event request" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Payload"] } }, "api.messageType": "Request", "api.inputEvent": "Deleted" });
    }
    create(value?: PartialMessage<StockDeletedRequest>): StockDeletedRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockDeletedRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockDeletedRequest): StockDeletedRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.NoID ID = 4 [json_name = "ID"];*/ 4:
                    message.iD = NoID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.StockDeletedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = StockDeletedPayload.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: StockDeletedRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.NoID ID = 4 [json_name = "ID"]; */
        if (message.iD)
            NoID.internalBinaryWrite(message.iD, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* api.StockDeletedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            StockDeletedPayload.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.StockDeletedRequest
 */
export const StockDeletedRequest = new StockDeletedRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockDeletedResponse$Type extends MessageType<StockDeletedResponse> {
    constructor() {
        super("api.StockDeletedResponse", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Header of the response" } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the stock the request event was applied on" } } }
        ], { "api.messageType": "Response", "api.inputEvent": "Deleted" });
    }
    create(value?: PartialMessage<StockDeletedResponse>): StockDeletedResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<StockDeletedResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockDeletedResponse): StockDeletedResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResponseHeader.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;
                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: StockDeletedResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResponseHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResponseHeader.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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.StockDeletedResponse
 */
export const StockDeletedResponse = new StockDeletedResponse$Type();
/**
 * @generated ServiceType for protobuf service api.StockInputAPI
 */
export const StockInputAPI = new ServiceType("api.StockInputAPI", [
    { name: "Moved", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Stock Inputs"], description: "A stock has been moved. Called internally from Movement entity." }, "api.rscType": "Project", "api.roles": "Platform.Project-Input", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: StockMovedRequest, O: StockMovedResponse },
    { name: "Snapshotted", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Stock Inputs"], description: "A stock image (snapshot) has been sent. This is typically called from a WMS." }, "api.rscType": "Project", "api.roles": "Platform.Project-Input", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: StockSnapshottedRequest, O: StockSnapshottedResponse },
    { name: "Deleted", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Stock Inputs"], description: "Deprecated from 1.8. A stock entry has been deleted. This is typically called from a WMS." }, "api.rscType": "Project", "api.roles": "Platform.Project-Input", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: StockDeletedRequest, O: StockDeletedResponse }
], { "api.serviceType": "Api", "api.k8sService": "api-server" });
