Files
npm-core-sdk/order.ts
2025-12-09 11:20:34 +00:00

701 lines
39 KiB
TypeScript

// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
// @generated from protobuf file "order.proto" (package "api", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import { UnknownFieldHandler } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { reflectionMergePartial } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { PartnerPayload } from "./partner";
import { ActorPayload } from "./actor";
import { ItemPayload } from "./item";
import { EntityID } from "./shared";
import { EventHeader } from "./shared";
import { ETAbyExecutionflow } from "./tradeShared";
import { ClaimSummary } from "./shared";
import { AttachmentSummary } from "./shared";
import { OrderStatusStruct } from "./tradeShared";
import { ExecutionflowSummary } from "./tradeShared";
import { ETA } from "./tradeShared";
import { OrderLine } from "./tradeShared";
import { OrderRequestedMilestones } from "./tradeShared";
import { TradeTier } from "./tradeShared";
import { MetadataElement } from "./shared";
import { ReferencedID } from "./tradeShared";
import { DateTime } from "./shared";
//
// This entity wears the content of Trade order.
//
// Most of the structure represent the request, they may be modified by some events (ShipperAssigned, ...).
//
// Another set of data represents how the request was executed. These informations are coming from the ExecutionFlowEntity.
//
// Comments updated 2021/02/17
/**
* @generated from protobuf message api.OrderPayload
*/
export interface OrderPayload {
/**
* @generated from protobuf field: api.DateTime CreationDateTime = 1
*/
CreationDateTime?: DateTime;
/**
* @generated from protobuf field: api.ReferencedID ParentOrder = 2
*/
ParentOrder?: ReferencedID; // In case the order is linked to a parent order
/**
* @generated from protobuf field: string LanguageCodeISO6391 = 3
*/
LanguageCodeISO6391: string;
/**
* Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)
*
* @generated from protobuf field: repeated api.MetadataElement MetaData = 4
*/
MetaData: MetadataElement[];
/**
* @generated from protobuf field: api.TradeTier Buyer = 5
*/
Buyer?: TradeTier;
/**
* @generated from protobuf field: api.TradeTier Seller = 6
*/
Seller?: TradeTier;
/**
* Where to ship the order from
*
* @generated from protobuf field: api.TradeTier ShipFrom = 7
*/
ShipFrom?: TradeTier;
/**
* Where to ship the order to
*
* @generated from protobuf field: api.TradeTier ShipTo = 8
*/
ShipTo?: TradeTier;
/**
* Definition of the order carrier
*
* @generated from protobuf field: api.TradeTier Carrier = 9
*/
Carrier?: TradeTier;
/**
* Type of carrier service
*
* @generated from protobuf field: string CarrierService = 16
*/
CarrierService: string;
/**
* @generated from protobuf field: api.OrderRequestedMilestones RequestedMilestones = 10
*/
RequestedMilestones?: OrderRequestedMilestones;
/**
* Lines of the order
*
* @generated from protobuf field: repeated api.OrderLine Lines = 11
*/
Lines: OrderLine[];
/**
* @deprecated
* @generated from protobuf field: api.ETA EstimatedTimeArrival = 12 [deprecated = true]
*/
EstimatedTimeArrival?: ETA;
/**
* @generated from protobuf field: api.DateTime ActualCompletionDateTime = 13
*/
ActualCompletionDateTime?: DateTime;
/**
* @generated from protobuf field: repeated api.ExecutionflowSummary ExecutionflowSummary = 14
*/
ExecutionflowSummary: ExecutionflowSummary[]; // Summary describing how the order is executed by ExecutionFlow
/**
* @generated from protobuf field: api.OrderStatusStruct Status = 17
*/
Status?: OrderStatusStruct; // Status field is not accessible from APIs
/**
* @generated from protobuf field: repeated api.AttachmentSummary Attachments = 18
*/
Attachments: AttachmentSummary[];
/**
* @generated from protobuf field: int32 AttachmentNumber = 19
*/
AttachmentNumber: number;
/**
* @generated from protobuf field: repeated api.ClaimSummary Claims = 20
*/
Claims: ClaimSummary[];
/**
* @generated from protobuf field: int32 ClaimNumber = 21
*/
ClaimNumber: number;
/**
* @generated from protobuf field: repeated api.ETAbyExecutionflow ExecutionflowETAs = 22
*/
ExecutionflowETAs: ETAbyExecutionflow[]; // Estimated Time of Arrival for the ExecutionFlow(s) created for this order
/**
* @generated from protobuf field: api.ETA OrderETA = 23
*/
OrderETA?: ETA;
}
/**
* Order entity
*
* @generated from protobuf message api.Order
*/
export interface Order {
/**
* @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.OrderPayload Payload = 3
*/
Payload?: OrderPayload;
}
/**
* Order Enrichment
*
* @generated from protobuf message api.OrderEnrichment
*/
export interface OrderEnrichment {
/**
* @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: "Partner";
/**
* @generated from protobuf field: api.PartnerPayload Partner = 12
*/
Partner: PartnerPayload;
} | {
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.OrderTriplet
*/
export interface OrderTriplet {
/**
* @generated from protobuf field: api.Order Current = 1
*/
Current?: Order;
/**
* @generated from protobuf field: api.Order Previous = 2
*/
Previous?: Order;
/**
* @generated from protobuf field: api.Order LastEvent = 3
*/
LastEvent?: Order;
}
// @generated message type with reflection information, may provide speed optimized methods
class OrderPayload$Type extends MessageType<OrderPayload> {
constructor() {
super("api.OrderPayload", [
{ no: 1, name: "CreationDateTime", kind: "message", localName: "CreationDateTime", jsonName: "CreationDateTime", T: () => DateTime, options: { "api.aggSkip": "ExecutionflowDetected" } },
{ no: 2, name: "ParentOrder", kind: "message", localName: "ParentOrder", jsonName: "ParentOrder", T: () => ReferencedID },
{ no: 3, name: "LanguageCodeISO6391", kind: "scalar", localName: "LanguageCodeISO6391", jsonName: "LanguageCodeISO6391", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "2", maxLen: "3", languageIso639: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "<a href='https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes'>ISO 639 code</a> message language", example: "\"en\"" }, "api.indexationType": { Types: [{ Context: "*", Type: "generatedText" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortText" }] } } },
{ no: 4, name: "MetaData", kind: "message", localName: "MetaData", jsonName: "MetaData", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MetadataElement, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Metadata are characteristics specific to the project. They can be of several data form (string, integer, float, boolean or timestamp)" }, "api.metadata": true, "api.aggKey": "Key", "api.kpiExclude": { Items: [{ Context: "Order", Group: "order" }] }, "api.aggAppend": "MetaDataUpdated,ExecutionflowDetected" } },
{ no: 5, name: "Buyer", kind: "message", localName: "Buyer", jsonName: "Buyer", T: () => TradeTier },
{ no: 6, name: "Seller", kind: "message", localName: "Seller", jsonName: "Seller", T: () => TradeTier },
{ no: 7, name: "ShipFrom", kind: "message", localName: "ShipFrom", jsonName: "ShipFrom", T: () => TradeTier, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Where to ship the order from" }, "api.aggSkip": "ExecutionflowDetected" } },
{ no: 8, name: "ShipTo", kind: "message", localName: "ShipTo", jsonName: "ShipTo", T: () => TradeTier, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Where to ship the order to" }, "api.aggSkip": "ExecutionflowDetected" } },
{ no: 9, name: "Carrier", kind: "message", localName: "Carrier", jsonName: "Carrier", T: () => TradeTier, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Definition of the order carrier" }, "api.aggSkip": "ExecutionflowDetected" } },
{ no: 16, name: "CarrierService", kind: "scalar", localName: "CarrierService", jsonName: "CarrierService", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Type of carrier service" }, "api.dataRestrictionKey": "Order", "api.kpiItems": { Items: [{ Context: "Order", Group: "order", Queryable: true }] } } },
{ no: 10, name: "RequestedMilestones", kind: "message", localName: "RequestedMilestones", jsonName: "RequestedMilestones", T: () => OrderRequestedMilestones },
{ no: 11, name: "Lines", kind: "message", localName: "Lines", jsonName: "Lines", repeat: 2 /*RepeatType.UNPACKED*/, T: () => OrderLine, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Lines of the order" }, "api.aggKey": "LineID", "api.aggAppend": "Created,ExecutionflowDetected,LinesAdded,LinesDetected", "api.indexationLimit": 1000 } },
{ no: 12, name: "EstimatedTimeArrival", kind: "message", localName: "EstimatedTimeArrival", jsonName: "EstimatedTimeArrival", T: () => ETA, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Deprecated from 1.7 : Estimated time of arrival, use OrderETA" } } },
{ no: 13, name: "ActualCompletionDateTime", kind: "message", localName: "ActualCompletionDateTime", jsonName: "ActualCompletionDateTime", T: () => DateTime },
{ no: 14, name: "ExecutionflowSummary", kind: "message", localName: "ExecutionflowSummary", jsonName: "ExecutionflowSummary", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ExecutionflowSummary, options: { "api.aggKey": "ExecutionflowID", "api.aggAppend": "ExecutionflowUpdated,ExecutionflowDetected" } },
{ no: 17, name: "Status", kind: "message", localName: "Status", jsonName: "Status", T: () => OrderStatusStruct, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true } } },
{ no: 18, name: "Attachments", kind: "message", localName: "Attachments", jsonName: "Attachments", repeat: 2 /*RepeatType.UNPACKED*/, T: () => AttachmentSummary, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Number of attachments per type" }, "api.aggSkip": "AttachmentAdded,AttachmentRemoved" } },
{ no: 19, name: "AttachmentNumber", kind: "scalar", localName: "AttachmentNumber", jsonName: "AttachmentNumber", T: 5 /*ScalarType.INT32*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Total number of attachments" } } },
{ no: 20, name: "Claims", kind: "message", localName: "Claims", jsonName: "Claims", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ClaimSummary, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Number of claims per type" }, "api.aggKey": "ClaimTypeID", "api.aggSkip": "ClaimAdded" } },
{ no: 21, name: "ClaimNumber", kind: "scalar", localName: "ClaimNumber", jsonName: "ClaimNumber", T: 5 /*ScalarType.INT32*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Total number of claims" } } },
{ no: 22, name: "ExecutionflowETAs", kind: "message", localName: "ExecutionflowETAs", jsonName: "ExecutionflowETAs", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ETAbyExecutionflow, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "ETA for each executionflow attached to the order" }, "api.aggKey": "ExecutionflowID", "api.aggSkip": "ExecutionflowETAUpdated" } },
{ no: 23, name: "OrderETA", kind: "message", localName: "OrderETA", jsonName: "OrderETA", T: () => ETA, options: { "validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "ETA for the order, computed from ETA of the execitionFlows" }, "api.aggSkip": "ETAUpdated" } }
]);
}
create(value?: PartialMessage<OrderPayload>): OrderPayload {
const message = globalThis.Object.create((this.messagePrototype!));
message.LanguageCodeISO6391 = "";
message.MetaData = [];
message.CarrierService = "";
message.Lines = [];
message.ExecutionflowSummary = [];
message.Attachments = [];
message.AttachmentNumber = 0;
message.Claims = [];
message.ClaimNumber = 0;
message.ExecutionflowETAs = [];
if (value !== undefined)
reflectionMergePartial<OrderPayload>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OrderPayload): OrderPayload {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.DateTime CreationDateTime */ 1:
message.CreationDateTime = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.CreationDateTime);
break;
case /* api.ReferencedID ParentOrder */ 2:
message.ParentOrder = ReferencedID.internalBinaryRead(reader, reader.uint32(), options, message.ParentOrder);
break;
case /* string LanguageCodeISO6391 */ 3:
message.LanguageCodeISO6391 = reader.string();
break;
case /* repeated api.MetadataElement MetaData */ 4:
message.MetaData.push(MetadataElement.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* api.TradeTier Buyer */ 5:
message.Buyer = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.Buyer);
break;
case /* api.TradeTier Seller */ 6:
message.Seller = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.Seller);
break;
case /* api.TradeTier ShipFrom */ 7:
message.ShipFrom = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.ShipFrom);
break;
case /* api.TradeTier ShipTo */ 8:
message.ShipTo = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.ShipTo);
break;
case /* api.TradeTier Carrier */ 9:
message.Carrier = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.Carrier);
break;
case /* string CarrierService */ 16:
message.CarrierService = reader.string();
break;
case /* api.OrderRequestedMilestones RequestedMilestones */ 10:
message.RequestedMilestones = OrderRequestedMilestones.internalBinaryRead(reader, reader.uint32(), options, message.RequestedMilestones);
break;
case /* repeated api.OrderLine Lines */ 11:
message.Lines.push(OrderLine.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* api.ETA EstimatedTimeArrival = 12 [deprecated = true] */ 12:
message.EstimatedTimeArrival = ETA.internalBinaryRead(reader, reader.uint32(), options, message.EstimatedTimeArrival);
break;
case /* api.DateTime ActualCompletionDateTime */ 13:
message.ActualCompletionDateTime = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.ActualCompletionDateTime);
break;
case /* repeated api.ExecutionflowSummary ExecutionflowSummary */ 14:
message.ExecutionflowSummary.push(ExecutionflowSummary.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* api.OrderStatusStruct Status */ 17:
message.Status = OrderStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.Status);
break;
case /* repeated api.AttachmentSummary Attachments */ 18:
message.Attachments.push(AttachmentSummary.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* int32 AttachmentNumber */ 19:
message.AttachmentNumber = reader.int32();
break;
case /* repeated api.ClaimSummary Claims */ 20:
message.Claims.push(ClaimSummary.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* int32 ClaimNumber */ 21:
message.ClaimNumber = reader.int32();
break;
case /* repeated api.ETAbyExecutionflow ExecutionflowETAs */ 22:
message.ExecutionflowETAs.push(ETAbyExecutionflow.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* api.ETA OrderETA */ 23:
message.OrderETA = ETA.internalBinaryRead(reader, reader.uint32(), options, message.OrderETA);
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: OrderPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.DateTime CreationDateTime = 1; */
if (message.CreationDateTime)
DateTime.internalBinaryWrite(message.CreationDateTime, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.ReferencedID ParentOrder = 2; */
if (message.ParentOrder)
ReferencedID.internalBinaryWrite(message.ParentOrder, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* string LanguageCodeISO6391 = 3; */
if (message.LanguageCodeISO6391 !== "")
writer.tag(3, WireType.LengthDelimited).string(message.LanguageCodeISO6391);
/* repeated api.MetadataElement MetaData = 4; */
for (let i = 0; i < message.MetaData.length; i++)
MetadataElement.internalBinaryWrite(message.MetaData[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier Buyer = 5; */
if (message.Buyer)
TradeTier.internalBinaryWrite(message.Buyer, writer.tag(5, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier Seller = 6; */
if (message.Seller)
TradeTier.internalBinaryWrite(message.Seller, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier ShipFrom = 7; */
if (message.ShipFrom)
TradeTier.internalBinaryWrite(message.ShipFrom, writer.tag(7, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier ShipTo = 8; */
if (message.ShipTo)
TradeTier.internalBinaryWrite(message.ShipTo, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier Carrier = 9; */
if (message.Carrier)
TradeTier.internalBinaryWrite(message.Carrier, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
/* api.OrderRequestedMilestones RequestedMilestones = 10; */
if (message.RequestedMilestones)
OrderRequestedMilestones.internalBinaryWrite(message.RequestedMilestones, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
/* repeated api.OrderLine Lines = 11; */
for (let i = 0; i < message.Lines.length; i++)
OrderLine.internalBinaryWrite(message.Lines[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join();
/* api.ETA EstimatedTimeArrival = 12 [deprecated = true]; */
if (message.EstimatedTimeArrival)
ETA.internalBinaryWrite(message.EstimatedTimeArrival, writer.tag(12, WireType.LengthDelimited).fork(), options).join();
/* api.DateTime ActualCompletionDateTime = 13; */
if (message.ActualCompletionDateTime)
DateTime.internalBinaryWrite(message.ActualCompletionDateTime, writer.tag(13, WireType.LengthDelimited).fork(), options).join();
/* repeated api.ExecutionflowSummary ExecutionflowSummary = 14; */
for (let i = 0; i < message.ExecutionflowSummary.length; i++)
ExecutionflowSummary.internalBinaryWrite(message.ExecutionflowSummary[i], writer.tag(14, WireType.LengthDelimited).fork(), options).join();
/* string CarrierService = 16; */
if (message.CarrierService !== "")
writer.tag(16, WireType.LengthDelimited).string(message.CarrierService);
/* api.OrderStatusStruct Status = 17; */
if (message.Status)
OrderStatusStruct.internalBinaryWrite(message.Status, writer.tag(17, WireType.LengthDelimited).fork(), options).join();
/* repeated api.AttachmentSummary Attachments = 18; */
for (let i = 0; i < message.Attachments.length; i++)
AttachmentSummary.internalBinaryWrite(message.Attachments[i], writer.tag(18, WireType.LengthDelimited).fork(), options).join();
/* int32 AttachmentNumber = 19; */
if (message.AttachmentNumber !== 0)
writer.tag(19, WireType.Varint).int32(message.AttachmentNumber);
/* repeated api.ClaimSummary Claims = 20; */
for (let i = 0; i < message.Claims.length; i++)
ClaimSummary.internalBinaryWrite(message.Claims[i], writer.tag(20, WireType.LengthDelimited).fork(), options).join();
/* int32 ClaimNumber = 21; */
if (message.ClaimNumber !== 0)
writer.tag(21, WireType.Varint).int32(message.ClaimNumber);
/* repeated api.ETAbyExecutionflow ExecutionflowETAs = 22; */
for (let i = 0; i < message.ExecutionflowETAs.length; i++)
ETAbyExecutionflow.internalBinaryWrite(message.ExecutionflowETAs[i], writer.tag(22, WireType.LengthDelimited).fork(), options).join();
/* api.ETA OrderETA = 23; */
if (message.OrderETA)
ETA.internalBinaryWrite(message.OrderETA, writer.tag(23, 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.OrderPayload
*/
export const OrderPayload = new OrderPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class Order$Type extends MessageType<Order> {
constructor() {
super("api.Order", [
{ 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: () => OrderPayload }
]);
}
create(value?: PartialMessage<Order>): Order {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<Order>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Order): Order {
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.OrderPayload Payload */ 3:
message.Payload = OrderPayload.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: Order, 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.OrderPayload Payload = 3; */
if (message.Payload)
OrderPayload.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.Order
*/
export const Order = new Order$Type();
// @generated message type with reflection information, may provide speed optimized methods
class OrderEnrichment$Type extends MessageType<OrderEnrichment> {
constructor() {
super("api.OrderEnrichment", [
{ 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: 12, name: "Partner", kind: "message", localName: "Partner", jsonName: "Partner", oneof: "Content", T: () => PartnerPayload },
{ 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<OrderEnrichment>): OrderEnrichment {
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<OrderEnrichment>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OrderEnrichment): OrderEnrichment {
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 /* api.PartnerPayload Partner */ 12:
message.Content = {
oneofKind: "Partner",
Partner: PartnerPayload.internalBinaryRead(reader, reader.uint32(), options, (message.Content as any).Partner)
};
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: OrderEnrichment, 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();
/* api.PartnerPayload Partner = 12; */
if (message.Content.oneofKind === "Partner")
PartnerPayload.internalBinaryWrite(message.Content.Partner, writer.tag(12, 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.OrderEnrichment
*/
export const OrderEnrichment = new OrderEnrichment$Type();
// @generated message type with reflection information, may provide speed optimized methods
class OrderTriplet$Type extends MessageType<OrderTriplet> {
constructor() {
super("api.OrderTriplet", [
{ no: 1, name: "Current", kind: "message", localName: "Current", jsonName: "Current", T: () => Order },
{ no: 2, name: "Previous", kind: "message", localName: "Previous", jsonName: "Previous", T: () => Order },
{ no: 3, name: "LastEvent", kind: "message", localName: "LastEvent", jsonName: "LastEvent", T: () => Order }
]);
}
create(value?: PartialMessage<OrderTriplet>): OrderTriplet {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<OrderTriplet>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OrderTriplet): OrderTriplet {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.Order Current */ 1:
message.Current = Order.internalBinaryRead(reader, reader.uint32(), options, message.Current);
break;
case /* api.Order Previous */ 2:
message.Previous = Order.internalBinaryRead(reader, reader.uint32(), options, message.Previous);
break;
case /* api.Order LastEvent */ 3:
message.LastEvent = Order.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: OrderTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.Order Current = 1; */
if (message.Current)
Order.internalBinaryWrite(message.Current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.Order Previous = 2; */
if (message.Previous)
Order.internalBinaryWrite(message.Previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* api.Order LastEvent = 3; */
if (message.LastEvent)
Order.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.OrderTriplet
*/
export const OrderTriplet = new OrderTriplet$Type();