Files
npm-core-sdk/stock.ts
2025-08-19 08:32:31 +00:00

602 lines
33 KiB
TypeScript

// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
// @generated from protobuf file "stock.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 { QuantityByLV } from "./warehousingShared";
import { QuantityInLV } from "./warehousingShared";
import { StockStatusStruct } from "./warehousingShared";
import { StockMovement } from "./warehousingShared";
import { StockSnapshot } from "./warehousingShared";
import { ActorPayload } from "./actor";
import { EnrichedGoods } from "./warehousingShared";
//
// This entity represents the quantity of goods physically present into a warehouse.
//
// The Stock ID.RefID will be built from the Goods 'key' attributes (itemID, LVBranchID, PriorityDate and SegmentationKeys) and the ActorID.
//
// It means the Stock 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.
//
// What about the 'inventory' events... ?? Just a specific case to not expose the ID and build it dynamically from Goods attributes ?
//
// Because Stock key is based on ItemID, the project must defined its requested items by ID into the order.
//
//
//
// Comments updated 2021/02/17
/**
* @generated from protobuf message api.StockPayload
*/
export interface StockPayload {
/**
* @generated from protobuf field: api.EnrichedGoods Goods = 1
*/
Goods?: EnrichedGoods;
/**
* @generated from protobuf field: string ActorID = 2
*/
ActorID: string;
/**
* @generated from protobuf field: api.ActorPayload Actor = 3
*/
Actor?: ActorPayload;
/**
* @generated from protobuf field: api.StockSnapshot Snapshot = 4
*/
Snapshot?: StockSnapshot; // this struct is managed into preAgg cumulateSnapshotQuantity method
/**
* @generated from protobuf field: api.StockMovement Movement = 5
*/
Movement?: StockMovement;
/**
* @generated from protobuf field: api.StockStatusStruct Status = 6
*/
Status?: StockStatusStruct; // Status field is not accessible from APIs
/**
* @generated from protobuf field: api.QuantityInLV QuantityInBaseLV = 7
*/
QuantityInBaseLV?: QuantityInLV;
/**
* @generated from protobuf field: repeated api.QuantityByLV QuantityByLVs = 8
*/
QuantityByLVs: QuantityByLV[];
/**
* @generated from protobuf field: string LVDetailledQuantity = 9
*/
LVDetailledQuantity: string;
/**
* @generated from protobuf field: repeated api.StockMovement LatestMovements = 10
*/
LatestMovements: StockMovement[];
/**
* Only used for clickhouse extended-stock
*
* @generated from protobuf field: double RequestedStockValue = 11
*/
RequestedStockValue: number;
/**
* Only used for clickhouse extended-stock
*
* @generated from protobuf field: double ToReceiveStockValue = 12
*/
ToReceiveStockValue: number;
/**
* Only used for clickhouse extended-stock
*
* @generated from protobuf field: string LastUpdateStockDateTime = 13
*/
LastUpdateStockDateTime: string;
/**
* Only used for clickhouse extended-stock
*
* @generated from protobuf field: string LastUpdateRequestedDateTime = 14
*/
LastUpdateRequestedDateTime: string;
/**
* Only used for clickhouse extended-stock
*
* @generated from protobuf field: string LastUpdateToReceiveDateTime = 15
*/
LastUpdateToReceiveDateTime: string;
}
/**
*
* Stock entity Structure
*
* @generated from protobuf message api.Stock
*/
export interface Stock {
/**
* @generated from protobuf field: api.EventHeader LastEventHeader = 1
*/
LastEventHeader?: EventHeader;
/**
* @generated from protobuf field: api.EntityID ID = 2
*/
ID?: EntityID;
/**
* @generated from protobuf field: api.StockPayload Payload = 3
*/
Payload?: StockPayload;
}
/**
* @generated from protobuf message api.StockEnrichment
*/
export interface StockEnrichment {
/**
* @generated from protobuf field: string ParentEventID = 1
*/
ParentEventID: string;
/**
* @generated from protobuf field: string EntityName = 2
*/
EntityName: string;
/**
* @generated from protobuf field: string EntityRefID = 3
*/
EntityRefID: string;
/**
* @generated from protobuf field: string RefFilter = 4
*/
RefFilter: string;
/**
* @generated from protobuf field: string MergePath = 5
*/
MergePath: string;
/**
* @generated from protobuf oneof: Content
*/
Content: {
oneofKind: "Item";
/**
* @generated from protobuf field: api.ItemPayload Item = 10
*/
Item: ItemPayload;
} | {
oneofKind: "Actor";
/**
* @generated from protobuf field: api.ActorPayload Actor = 11
*/
Actor: ActorPayload;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf field: string Project = 6
*/
Project: string;
/**
* @generated from protobuf field: string ParentEntityName = 7
*/
ParentEntityName: string;
/**
* @generated from protobuf field: string ParentEntityID = 8
*/
ParentEntityID: string;
}
/**
* @generated from protobuf message api.StockTriplet
*/
export interface StockTriplet {
/**
* @generated from protobuf field: api.Stock Current = 1
*/
Current?: Stock;
/**
* @generated from protobuf field: api.Stock Previous = 2
*/
Previous?: Stock;
/**
* @generated from protobuf field: api.Stock LastEvent = 3
*/
LastEvent?: Stock;
}
// @generated message type with reflection information, may provide speed optimized methods
class StockPayload$Type extends MessageType<StockPayload> {
constructor() {
super("api.StockPayload", [
{ no: 1, name: "Goods", kind: "message", localName: "Goods", jsonName: "Goods", T: () => EnrichedGoods },
{ no: 2, name: "ActorID", kind: "scalar", localName: "ActorID", jsonName: "ActorID", T: 9 /*ScalarType.STRING*/, options: { "api.entityRef": "Actor", "api.dataRestrictionKey": "Stock", "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.kpiItems": { Items: [{ Context: "Stock", Group: "stock", Queryable: true }, { Context: "Stock", Group: "stock_extended", Queryable: true }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
{ no: 3, name: "Actor", kind: "message", localName: "Actor", jsonName: "Actor", T: () => ActorPayload, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.extractRefExclude": "Stock" } },
{ no: 4, name: "Snapshot", kind: "message", localName: "Snapshot", jsonName: "Snapshot", T: () => StockSnapshot, options: { "api.aggSkip": "Snapshotted", "api.kpiExclude": { Items: [{ Context: "Stock", Group: "stock_extended" }] } } },
{ no: 5, name: "Movement", kind: "message", localName: "Movement", jsonName: "Movement", T: () => StockMovement, options: { "api.aggSkip": "Moved", "api.kpiExclude": { Items: [{ Context: "Stock", Group: "stock_extended" }] } } },
{ no: 6, name: "Status", kind: "message", localName: "Status", jsonName: "Status", T: () => StockStatusStruct, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.kpiExclude": { Items: [{ Context: "Stock", Group: "stock_extended" }] } } },
{ no: 7, name: "QuantityInBaseLV", kind: "message", localName: "QuantityInBaseLV", jsonName: "QuantityInBaseLV", T: () => QuantityInLV, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
{ no: 8, name: "QuantityByLVs", kind: "message", localName: "QuantityByLVs", jsonName: "QuantityByLVs", repeat: 2 /*RepeatType.UNPACKED*/, T: () => QuantityByLV, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.aggKey": "LVID" } },
{ no: 9, name: "LVDetailledQuantity", kind: "scalar", localName: "LVDetailledQuantity", jsonName: "LVDetailledQuantity", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
{ no: 10, name: "LatestMovements", kind: "message", localName: "LatestMovements", jsonName: "LatestMovements", repeat: 2 /*RepeatType.UNPACKED*/, T: () => StockMovement, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.aggKey": "ID", "api.kpiExclude": { Items: [{ Context: "Stock", Group: "stock" }, { Context: "Stock", Group: "stock_extended" }] }, "api.indexationSkip": true } },
{ no: 11, name: "RequestedStockValue", kind: "scalar", localName: "RequestedStockValue", jsonName: "RequestedStockValue", T: 1 /*ScalarType.DOUBLE*/, options: { "validate.rules": { double: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.kpiItems": { Items: [{ Context: "Stock", Group: "stock_extended", Queryable: true, CustomType: "AggregateFunction(sum,Decimal64(6))" }] } } },
{ no: 12, name: "ToReceiveStockValue", kind: "scalar", localName: "ToReceiveStockValue", jsonName: "ToReceiveStockValue", T: 1 /*ScalarType.DOUBLE*/, options: { "validate.rules": { double: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.kpiItems": { Items: [{ Context: "Stock", Group: "stock_extended", Queryable: true, CustomType: "AggregateFunction(sum,Decimal64(6))" }] } } },
{ no: 13, name: "LastUpdateStockDateTime", kind: "scalar", localName: "LastUpdateStockDateTime", jsonName: "LastUpdateStockDateTime", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.indexationType": { Types: [{ Context: "Stock", Type: "text" }] }, "api.kpiItems": { Items: [{ Context: "Stock", Group: "stock_extended", CustomType: "SimpleAggregateFunction(max,DateTime)" }] }, "api.viewType": { Types: [{ Context: "*", Type: "date" }] } } },
{ no: 14, name: "LastUpdateRequestedDateTime", kind: "scalar", localName: "LastUpdateRequestedDateTime", jsonName: "LastUpdateRequestedDateTime", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.indexationType": { Types: [{ Context: "Stock", Type: "text" }] }, "api.kpiItems": { Items: [{ Context: "Stock", Group: "stock_extended", CustomType: "SimpleAggregateFunction(max,DateTime)" }] }, "api.viewType": { Types: [{ Context: "*", Type: "date" }] } } },
{ no: 15, name: "LastUpdateToReceiveDateTime", kind: "scalar", localName: "LastUpdateToReceiveDateTime", jsonName: "LastUpdateToReceiveDateTime", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.indexationType": { Types: [{ Context: "Stock", Type: "text" }] }, "api.kpiItems": { Items: [{ Context: "Stock", Group: "stock_extended", CustomType: "SimpleAggregateFunction(max,DateTime)" }] }, "api.viewType": { Types: [{ Context: "*", Type: "date" }] } } }
]);
}
create(value?: PartialMessage<StockPayload>): StockPayload {
const message = globalThis.Object.create((this.messagePrototype!));
message.ActorID = "";
message.QuantityByLVs = [];
message.LVDetailledQuantity = "";
message.LatestMovements = [];
message.RequestedStockValue = 0;
message.ToReceiveStockValue = 0;
message.LastUpdateStockDateTime = "";
message.LastUpdateRequestedDateTime = "";
message.LastUpdateToReceiveDateTime = "";
if (value !== undefined)
reflectionMergePartial<StockPayload>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockPayload): StockPayload {
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:
message.Goods = EnrichedGoods.internalBinaryRead(reader, reader.uint32(), options, message.Goods);
break;
case /* string ActorID */ 2:
message.ActorID = reader.string();
break;
case /* api.ActorPayload Actor */ 3:
message.Actor = ActorPayload.internalBinaryRead(reader, reader.uint32(), options, message.Actor);
break;
case /* api.StockSnapshot Snapshot */ 4:
message.Snapshot = StockSnapshot.internalBinaryRead(reader, reader.uint32(), options, message.Snapshot);
break;
case /* api.StockMovement Movement */ 5:
message.Movement = StockMovement.internalBinaryRead(reader, reader.uint32(), options, message.Movement);
break;
case /* api.StockStatusStruct Status */ 6:
message.Status = StockStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.Status);
break;
case /* api.QuantityInLV QuantityInBaseLV */ 7:
message.QuantityInBaseLV = QuantityInLV.internalBinaryRead(reader, reader.uint32(), options, message.QuantityInBaseLV);
break;
case /* repeated api.QuantityByLV QuantityByLVs */ 8:
message.QuantityByLVs.push(QuantityByLV.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* string LVDetailledQuantity */ 9:
message.LVDetailledQuantity = reader.string();
break;
case /* repeated api.StockMovement LatestMovements */ 10:
message.LatestMovements.push(StockMovement.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* double RequestedStockValue */ 11:
message.RequestedStockValue = reader.double();
break;
case /* double ToReceiveStockValue */ 12:
message.ToReceiveStockValue = reader.double();
break;
case /* string LastUpdateStockDateTime */ 13:
message.LastUpdateStockDateTime = reader.string();
break;
case /* string LastUpdateRequestedDateTime */ 14:
message.LastUpdateRequestedDateTime = reader.string();
break;
case /* string LastUpdateToReceiveDateTime */ 15:
message.LastUpdateToReceiveDateTime = 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: StockPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.EnrichedGoods Goods = 1; */
if (message.Goods)
EnrichedGoods.internalBinaryWrite(message.Goods, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* string ActorID = 2; */
if (message.ActorID !== "")
writer.tag(2, WireType.LengthDelimited).string(message.ActorID);
/* api.ActorPayload Actor = 3; */
if (message.Actor)
ActorPayload.internalBinaryWrite(message.Actor, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
/* api.StockSnapshot Snapshot = 4; */
if (message.Snapshot)
StockSnapshot.internalBinaryWrite(message.Snapshot, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
/* api.StockMovement Movement = 5; */
if (message.Movement)
StockMovement.internalBinaryWrite(message.Movement, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
/* api.StockStatusStruct Status = 6; */
if (message.Status)
StockStatusStruct.internalBinaryWrite(message.Status, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
/* api.QuantityInLV QuantityInBaseLV = 7; */
if (message.QuantityInBaseLV)
QuantityInLV.internalBinaryWrite(message.QuantityInBaseLV, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
/* repeated api.QuantityByLV QuantityByLVs = 8; */
for (let i = 0; i < message.QuantityByLVs.length; i++)
QuantityByLV.internalBinaryWrite(message.QuantityByLVs[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join();
/* string LVDetailledQuantity = 9; */
if (message.LVDetailledQuantity !== "")
writer.tag(9, WireType.LengthDelimited).string(message.LVDetailledQuantity);
/* repeated api.StockMovement LatestMovements = 10; */
for (let i = 0; i < message.LatestMovements.length; i++)
StockMovement.internalBinaryWrite(message.LatestMovements[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join();
/* double RequestedStockValue = 11; */
if (message.RequestedStockValue !== 0)
writer.tag(11, WireType.Bit64).double(message.RequestedStockValue);
/* double ToReceiveStockValue = 12; */
if (message.ToReceiveStockValue !== 0)
writer.tag(12, WireType.Bit64).double(message.ToReceiveStockValue);
/* string LastUpdateStockDateTime = 13; */
if (message.LastUpdateStockDateTime !== "")
writer.tag(13, WireType.LengthDelimited).string(message.LastUpdateStockDateTime);
/* string LastUpdateRequestedDateTime = 14; */
if (message.LastUpdateRequestedDateTime !== "")
writer.tag(14, WireType.LengthDelimited).string(message.LastUpdateRequestedDateTime);
/* string LastUpdateToReceiveDateTime = 15; */
if (message.LastUpdateToReceiveDateTime !== "")
writer.tag(15, WireType.LengthDelimited).string(message.LastUpdateToReceiveDateTime);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.StockPayload
*/
export const StockPayload = new StockPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Stock$Type extends MessageType<Stock> {
constructor() {
super("api.Stock", [
{ no: 1, name: "LastEventHeader", kind: "message", localName: "LastEventHeader", jsonName: "LastEventHeader", T: () => EventHeader },
{ no: 2, name: "ID", kind: "message", localName: "ID", jsonName: "ID", T: () => EntityID },
{ no: 3, name: "Payload", kind: "message", localName: "Payload", jsonName: "Payload", T: () => StockPayload }
]);
}
create(value?: PartialMessage<Stock>): Stock {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<Stock>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Stock): Stock {
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:
message.LastEventHeader = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.LastEventHeader);
break;
case /* api.EntityID ID */ 2:
message.ID = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.ID);
break;
case /* api.StockPayload Payload */ 3:
message.Payload = StockPayload.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: Stock, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.EventHeader LastEventHeader = 1; */
if (message.LastEventHeader)
EventHeader.internalBinaryWrite(message.LastEventHeader, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.EntityID ID = 2; */
if (message.ID)
EntityID.internalBinaryWrite(message.ID, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* api.StockPayload Payload = 3; */
if (message.Payload)
StockPayload.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.Stock
*/
export const Stock = new Stock$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockEnrichment$Type extends MessageType<StockEnrichment> {
constructor() {
super("api.StockEnrichment", [
{ no: 1, name: "ParentEventID", kind: "scalar", localName: "ParentEventID", jsonName: "ParentEventID", T: 9 /*ScalarType.STRING*/ },
{ no: 2, name: "EntityName", kind: "scalar", localName: "EntityName", jsonName: "EntityName", T: 9 /*ScalarType.STRING*/ },
{ no: 3, name: "EntityRefID", kind: "scalar", localName: "EntityRefID", jsonName: "EntityRefID", T: 9 /*ScalarType.STRING*/ },
{ no: 4, name: "RefFilter", kind: "scalar", localName: "RefFilter", jsonName: "RefFilter", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "MergePath", kind: "scalar", localName: "MergePath", jsonName: "MergePath", T: 9 /*ScalarType.STRING*/ },
{ no: 10, name: "Item", kind: "message", localName: "Item", jsonName: "Item", oneof: "Content", T: () => ItemPayload },
{ no: 11, name: "Actor", kind: "message", localName: "Actor", jsonName: "Actor", oneof: "Content", T: () => ActorPayload },
{ no: 6, name: "Project", kind: "scalar", localName: "Project", jsonName: "Project", T: 9 /*ScalarType.STRING*/ },
{ no: 7, name: "ParentEntityName", kind: "scalar", localName: "ParentEntityName", jsonName: "ParentEntityName", T: 9 /*ScalarType.STRING*/ },
{ no: 8, name: "ParentEntityID", kind: "scalar", localName: "ParentEntityID", jsonName: "ParentEntityID", T: 9 /*ScalarType.STRING*/ }
]);
}
create(value?: PartialMessage<StockEnrichment>): StockEnrichment {
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<StockEnrichment>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockEnrichment): StockEnrichment {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string ParentEventID */ 1:
message.ParentEventID = reader.string();
break;
case /* string EntityName */ 2:
message.EntityName = reader.string();
break;
case /* string EntityRefID */ 3:
message.EntityRefID = reader.string();
break;
case /* string RefFilter */ 4:
message.RefFilter = reader.string();
break;
case /* string MergePath */ 5:
message.MergePath = reader.string();
break;
case /* api.ItemPayload Item */ 10:
message.Content = {
oneofKind: "Item",
Item: ItemPayload.internalBinaryRead(reader, reader.uint32(), options, (message.Content as any).Item)
};
break;
case /* api.ActorPayload Actor */ 11:
message.Content = {
oneofKind: "Actor",
Actor: ActorPayload.internalBinaryRead(reader, reader.uint32(), options, (message.Content as any).Actor)
};
break;
case /* string Project */ 6:
message.Project = reader.string();
break;
case /* string ParentEntityName */ 7:
message.ParentEntityName = reader.string();
break;
case /* string 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: StockEnrichment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string ParentEventID = 1; */
if (message.ParentEventID !== "")
writer.tag(1, WireType.LengthDelimited).string(message.ParentEventID);
/* string EntityName = 2; */
if (message.EntityName !== "")
writer.tag(2, WireType.LengthDelimited).string(message.EntityName);
/* string EntityRefID = 3; */
if (message.EntityRefID !== "")
writer.tag(3, WireType.LengthDelimited).string(message.EntityRefID);
/* string RefFilter = 4; */
if (message.RefFilter !== "")
writer.tag(4, WireType.LengthDelimited).string(message.RefFilter);
/* string MergePath = 5; */
if (message.MergePath !== "")
writer.tag(5, WireType.LengthDelimited).string(message.MergePath);
/* string Project = 6; */
if (message.Project !== "")
writer.tag(6, WireType.LengthDelimited).string(message.Project);
/* string ParentEntityName = 7; */
if (message.ParentEntityName !== "")
writer.tag(7, WireType.LengthDelimited).string(message.ParentEntityName);
/* string ParentEntityID = 8; */
if (message.ParentEntityID !== "")
writer.tag(8, WireType.LengthDelimited).string(message.ParentEntityID);
/* api.ItemPayload Item = 10; */
if (message.Content.oneofKind === "Item")
ItemPayload.internalBinaryWrite(message.Content.Item, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
/* api.ActorPayload Actor = 11; */
if (message.Content.oneofKind === "Actor")
ActorPayload.internalBinaryWrite(message.Content.Actor, writer.tag(11, 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.StockEnrichment
*/
export const StockEnrichment = new StockEnrichment$Type();
// @generated message type with reflection information, may provide speed optimized methods
class StockTriplet$Type extends MessageType<StockTriplet> {
constructor() {
super("api.StockTriplet", [
{ no: 1, name: "Current", kind: "message", localName: "Current", jsonName: "Current", T: () => Stock },
{ no: 2, name: "Previous", kind: "message", localName: "Previous", jsonName: "Previous", T: () => Stock },
{ no: 3, name: "LastEvent", kind: "message", localName: "LastEvent", jsonName: "LastEvent", T: () => Stock }
]);
}
create(value?: PartialMessage<StockTriplet>): StockTriplet {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<StockTriplet>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StockTriplet): StockTriplet {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.Stock Current */ 1:
message.Current = Stock.internalBinaryRead(reader, reader.uint32(), options, message.Current);
break;
case /* api.Stock Previous */ 2:
message.Previous = Stock.internalBinaryRead(reader, reader.uint32(), options, message.Previous);
break;
case /* api.Stock LastEvent */ 3:
message.LastEvent = Stock.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: StockTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.Stock Current = 1; */
if (message.Current)
Stock.internalBinaryWrite(message.Current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.Stock Previous = 2; */
if (message.Previous)
Stock.internalBinaryWrite(message.Previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* api.Stock LastEvent = 3; */
if (message.LastEvent)
Stock.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.StockTriplet
*/
export const StockTriplet = new StockTriplet$Type();