Files
npm-core-sdk/transportShared.ts
2025-03-20 10:05:56 +00:00

609 lines
31 KiB
TypeScript

// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "transportShared.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 { TradeTier } from "./tradeShared";
import { GeographicalCoordinates } from "./repositoryShared";
import { DateTime } from "./shared";
//
// Tracking entity status structure
/**
* @generated from protobuf message api.TrackingStatus
*/
export interface TrackingStatus {
/**
* @generated from protobuf field: api.TrackingStatusCode StatusCode = 1 [json_name = "StatusCode"];
*/
statusCode: TrackingStatusCode;
/**
* UTC date/time in <a href='https://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format
*
* @generated from protobuf field: string Date = 2 [json_name = "Date"];
*/
date: string;
/**
* Status effective date. Set by the event's RefDate that triggered the status change.
*
* @generated from protobuf field: api.DateTime ActualDate = 3 [json_name = "ActualDate"];
*/
actualDate?: DateTime;
}
/**
* @generated from protobuf message api.TrackingStatusStruct
*/
export interface TrackingStatusStruct {
/**
* Current status of the Handlingunit entity
*
* @generated from protobuf field: api.TrackingStatus Current = 1 [json_name = "Current"];
*/
current?: TrackingStatus;
/**
* List of all status history of the Handlingunit entity
*
* @generated from protobuf field: repeated api.TrackingStatus History = 2 [json_name = "History"];
*/
history: TrackingStatus[];
/**
* @generated from protobuf field: string CreationDate = 3 [json_name = "CreationDate"];
*/
creationDate: string;
}
/**
* @generated from protobuf message api.TrackingSummary
*/
export interface TrackingSummary {
/**
* @generated from protobuf field: string TrackingID = 1 [json_name = "TrackingID"];
*/
trackingID: string;
/**
* @generated from protobuf field: api.TrackingStatus Status = 2 [json_name = "Status"];
*/
status?: TrackingStatus;
/**
* @generated from protobuf field: string TrackedHandlingunitID = 3 [json_name = "TrackedHandlingunitID"];
*/
trackedHandlingunitID: string;
/**
* @generated from protobuf field: string TrackingURL = 4 [json_name = "TrackingURL"];
*/
trackingURL: string;
/**
* @generated from protobuf field: string NextTrackingID = 5 [json_name = "NextTrackingID"];
*/
nextTrackingID: string;
/**
* @generated from protobuf field: api.GeographicalCoordinates Location = 6 [json_name = "Location"];
*/
location?: GeographicalCoordinates;
/**
* @generated from protobuf field: string Reason = 7 [json_name = "Reason"];
*/
reason: string;
/**
* @generated from protobuf field: string PlusCode = 8 [json_name = "PlusCode"];
*/
plusCode: string;
/**
* DateTime DispatchedDateTime = 8 ;
*
* @generated from protobuf field: api.TradeTier HUCarrier = 9 [json_name = "HUCarrier"];
*/
hUCarrier?: TradeTier;
/**
* @generated from protobuf field: api.TradeTier HUShipFrom = 10 [json_name = "HUShipFrom"];
*/
hUShipFrom?: TradeTier;
/**
* @generated from protobuf field: api.TradeTier HUShipTo = 11 [json_name = "HUShipTo"];
*/
hUShipTo?: TradeTier;
}
/**
*
* Description for tracking event could be added ...
*
* @generated from protobuf message api.TrackingEvent
*/
export interface TrackingEvent {
/**
* @generated from protobuf field: api.DateTime Date = 1 [json_name = "Date"];
*/
date?: DateTime;
/**
* @generated from protobuf field: api.TrackingEventCode Code = 2 [json_name = "Code"];
*/
code: TrackingEventCode;
/**
* @generated from protobuf field: api.GeographicalCoordinates Location = 3 [json_name = "Location"];
*/
location?: GeographicalCoordinates;
/**
* @generated from protobuf field: string Reason = 4 [json_name = "Reason"];
*/
reason: string;
/**
* @generated from protobuf field: string PlusCode = 5 [json_name = "PlusCode"];
*/
plusCode: string;
}
/**
*
* All statuses for Tracking entity.
*
* Thsese status are computed from the tracking event code. They globally match to IFTSTA event codes.
*
* https://hardisgroupe.sharepoint.com/:p:/r/sites/N1/_layouts/15/Doc.aspx?sourcedoc=%7B5ECE4F90-6775-4EDA-BC25-7AD4982F8415%7D&file=Statuts%20N1_v2.pptx&action=edit&mobileredirect=true
*
* @generated from protobuf enum api.TrackingStatusCode
*/
export enum TrackingStatusCode {
/**
* @generated from protobuf enum value: TRACKINGSTATUS_0000_UNKNOWN = 0;
*/
TRACKINGSTATUS_0000_UNKNOWN = 0,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_0500_INSTRUCTION_RECEIVED = 500;
*/
TRACKINGSTATUS_0500_INSTRUCTION_RECEIVED = 500,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_1000_BOOKED = 1000;
*/
TRACKINGSTATUS_1000_BOOKED = 1000,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_1500_COLLECTING = 1500;
*/
TRACKINGSTATUS_1500_COLLECTING = 1500,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_2000_COLLECTION_ERROR = 2000;
*/
TRACKINGSTATUS_2000_COLLECTION_ERROR = 2000,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_2500_COLLECTED = 2500;
*/
TRACKINGSTATUS_2500_COLLECTED = 2500,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_3000_HANDLED_BY_CARRIER = 3000;
*/
TRACKINGSTATUS_3000_HANDLED_BY_CARRIER = 3000,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_3500_DELIVERY_ERROR = 3500;
*/
TRACKINGSTATUS_3500_DELIVERY_ERROR = 3500,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_4000_INTERRUPTED = 4000;
*/
TRACKINGSTATUS_4000_INTERRUPTED = 4000,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_4500_DELIVERING = 4500;
*/
TRACKINGSTATUS_4500_DELIVERING = 4500,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_4800_CARRIER_SWITCHED = 4800;
*/
TRACKINGSTATUS_4800_CARRIER_SWITCHED = 4800,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_5000_DELIVERY_COMPLETED = 5000;
*/
TRACKINGSTATUS_5000_DELIVERY_COMPLETED = 5000,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_5500_CANCELED = 5500;
*/
TRACKINGSTATUS_5500_CANCELED = 5500
}
//
// All events for Tracking entity
//
// cf fichier https://hardisgroupe.sharepoint.com/:p:/r/sites/N1/_layouts/15/Doc.aspx?sourcedoc=%7BDA983A7C-230B-4E43-BE0D-63C69BB55FFF%7D&file=evt%20transports.pptx&action=edit&mobileredirect=true
//
// All events are extracted from IFTSTA. These events are used to compute statuses.
/**
* @generated from protobuf enum api.TrackingEventCode
*/
export enum TrackingEventCode {
/**
* @generated from protobuf enum value: TRACKING_EVENT_UNKNOWN = 0;
*/
TRACKING_EVENT_UNKNOWN = 0,
/**
* Instrcutions d'expédition reçues
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_321 = 1;
*/
TRACKING_EVENT_IFTSTA_321 = 1,
/**
* Réservation des moyens réalisés
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_6 = 2;
*/
TRACKING_EVENT_IFTSTA_6 = 2,
/**
* Enlèvement en cours
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_5 = 3;
*/
TRACKING_EVENT_IFTSTA_5 = 3,
/**
* Enlèvement non réalisé
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_53 = 4;
*/
TRACKING_EVENT_IFTSTA_53 = 4,
/**
* Enlevé
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_13 = 5;
*/
TRACKING_EVENT_IFTSTA_13 = 5,
/**
* Pris en charge par le transporteur
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_349 = 6;
*/
TRACKING_EVENT_IFTSTA_349 = 6,
/**
* Livraison en cours
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_113 = 7;
*/
TRACKING_EVENT_IFTSTA_113 = 7,
/**
* Interruption de l'acheminement
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_90 = 8;
*/
TRACKING_EVENT_IFTSTA_90 = 8,
/**
* Livraison non aboutie
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_56 = 9;
*/
TRACKING_EVENT_IFTSTA_56 = 9,
/**
* Livraison effectuée
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_21 = 10;
*/
TRACKING_EVENT_IFTSTA_21 = 10,
/**
* Processus terminé
*
* @generated from protobuf enum value: TRACKING_EVENT_IFTSTA_14 = 11;
*/
TRACKING_EVENT_IFTSTA_14 = 11
}
// @generated message type with reflection information, may provide speed optimized methods
class TrackingStatus$Type extends MessageType<TrackingStatus> {
constructor() {
super("api.TrackingStatus", [
{ no: 1, name: "StatusCode", kind: "enum", jsonName: "StatusCode", T: () => ["api.TrackingStatusCode", TrackingStatusCode], options: { "api.dataRestrictionKey": "Tracking", "api.indexationType": { Types: [{ Context: "*", Type: "generatedText" }] }, "api.kpiItems": { Items: [{ Context: "Tracking", Group: "tracking", Queryable: true }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortText" }] } } },
{ no: 2, name: "Date", kind: "scalar", jsonName: "Date", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { dateIso8601: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "UTC date/time in <a href='https://en.wikipedia.org/wiki/ISO_8601'>ISO 8601</a> format" }, "api.indexationType": { Types: [{ Context: "*", Type: "date" }] }, "api.kpiItems": { Items: [{ Context: "Tracking", Group: "tracking", Queryable: true }] }, "api.viewType": { Types: [{ Context: "*", Type: "date" }] } } },
{ no: 3, name: "ActualDate", kind: "message", jsonName: "ActualDate", T: () => DateTime, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Status effective date. Set by the event's RefDate that triggered the status change." } } }
]);
}
create(value?: PartialMessage<TrackingStatus>): TrackingStatus {
const message = globalThis.Object.create((this.messagePrototype!));
message.statusCode = 0;
message.date = "";
if (value !== undefined)
reflectionMergePartial<TrackingStatus>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingStatus): TrackingStatus {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.TrackingStatusCode StatusCode = 1 [json_name = "StatusCode"];*/ 1:
message.statusCode = reader.int32();
break;
case /* string Date = 2 [json_name = "Date"];*/ 2:
message.date = reader.string();
break;
case /* api.DateTime ActualDate = 3 [json_name = "ActualDate"];*/ 3:
message.actualDate = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.actualDate);
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: TrackingStatus, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.TrackingStatusCode StatusCode = 1 [json_name = "StatusCode"]; */
if (message.statusCode !== 0)
writer.tag(1, WireType.Varint).int32(message.statusCode);
/* string Date = 2 [json_name = "Date"]; */
if (message.date !== "")
writer.tag(2, WireType.LengthDelimited).string(message.date);
/* api.DateTime ActualDate = 3 [json_name = "ActualDate"]; */
if (message.actualDate)
DateTime.internalBinaryWrite(message.actualDate, 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.TrackingStatus
*/
export const TrackingStatus = new TrackingStatus$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingStatusStruct$Type extends MessageType<TrackingStatusStruct> {
constructor() {
super("api.TrackingStatusStruct", [
{ no: 1, name: "Current", kind: "message", jsonName: "Current", T: () => TrackingStatus },
{ no: 2, name: "History", kind: "message", jsonName: "History", repeat: 1 /*RepeatType.PACKED*/, T: () => TrackingStatus, options: { "api.aggKey": "Date" } },
{ no: 3, name: "CreationDate", kind: "scalar", jsonName: "CreationDate", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { dateIso8601: true } } } }
]);
}
create(value?: PartialMessage<TrackingStatusStruct>): TrackingStatusStruct {
const message = globalThis.Object.create((this.messagePrototype!));
message.history = [];
message.creationDate = "";
if (value !== undefined)
reflectionMergePartial<TrackingStatusStruct>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingStatusStruct): TrackingStatusStruct {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.TrackingStatus Current = 1 [json_name = "Current"];*/ 1:
message.current = TrackingStatus.internalBinaryRead(reader, reader.uint32(), options, message.current);
break;
case /* repeated api.TrackingStatus History = 2 [json_name = "History"];*/ 2:
message.history.push(TrackingStatus.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* string CreationDate = 3 [json_name = "CreationDate"];*/ 3:
message.creationDate = 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: TrackingStatusStruct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.TrackingStatus Current = 1 [json_name = "Current"]; */
if (message.current)
TrackingStatus.internalBinaryWrite(message.current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* repeated api.TrackingStatus History = 2 [json_name = "History"]; */
for (let i = 0; i < message.history.length; i++)
TrackingStatus.internalBinaryWrite(message.history[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* string CreationDate = 3 [json_name = "CreationDate"]; */
if (message.creationDate !== "")
writer.tag(3, WireType.LengthDelimited).string(message.creationDate);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.TrackingStatusStruct
*/
export const TrackingStatusStruct = new TrackingStatusStruct$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingSummary$Type extends MessageType<TrackingSummary> {
constructor() {
super("api.TrackingSummary", [
{ no: 1, name: "TrackingID", kind: "scalar", jsonName: "TrackingID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "api.dataRestrictionKey": "Handlingunit", "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.kpiItems": { Items: [{ Context: "Handlingunit", Group: "handlingunit", Queryable: true }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
{ no: 2, name: "Status", kind: "message", jsonName: "Status", T: () => TrackingStatus, options: { "api.kpiExclude": { Items: [{ Context: "Handlingunit", Group: "handlingunit" }] } } },
{ no: 3, name: "TrackedHandlingunitID", kind: "scalar", jsonName: "TrackedHandlingunitID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
{ no: 4, name: "TrackingURL", kind: "scalar", jsonName: "TrackingURL", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "NextTrackingID", kind: "scalar", jsonName: "NextTrackingID", T: 9 /*ScalarType.STRING*/, options: { "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
{ no: 6, name: "Location", kind: "message", jsonName: "Location", T: () => GeographicalCoordinates },
{ no: 7, name: "Reason", kind: "scalar", jsonName: "Reason", T: 9 /*ScalarType.STRING*/, options: { "api.dataRestrictionKey": "Handlingunit", "api.kpiItems": { Items: [{ Context: "Handlingunit", Group: "handlingunit", Queryable: true }] } } },
{ no: 8, name: "PlusCode", kind: "scalar", jsonName: "PlusCode", T: 9 /*ScalarType.STRING*/, options: { "api.indexationType": { Types: [{ Context: "*", Type: "generatedText" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortText" }] } } },
{ no: 9, name: "HUCarrier", kind: "message", jsonName: "HUCarrier", T: () => TradeTier, options: { "api.extractRefExclude": "Handlingunit" } },
{ no: 10, name: "HUShipFrom", kind: "message", jsonName: "HUShipFrom", T: () => TradeTier, options: { "api.extractRefExclude": "Handlingunit" } },
{ no: 11, name: "HUShipTo", kind: "message", jsonName: "HUShipTo", T: () => TradeTier, options: { "api.extractRefExclude": "Handlingunit" } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["TrackingID", "TrackedHandlingunitID"] } } });
}
create(value?: PartialMessage<TrackingSummary>): TrackingSummary {
const message = globalThis.Object.create((this.messagePrototype!));
message.trackingID = "";
message.trackedHandlingunitID = "";
message.trackingURL = "";
message.nextTrackingID = "";
message.reason = "";
message.plusCode = "";
if (value !== undefined)
reflectionMergePartial<TrackingSummary>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingSummary): TrackingSummary {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* string TrackingID = 1 [json_name = "TrackingID"];*/ 1:
message.trackingID = reader.string();
break;
case /* api.TrackingStatus Status = 2 [json_name = "Status"];*/ 2:
message.status = TrackingStatus.internalBinaryRead(reader, reader.uint32(), options, message.status);
break;
case /* string TrackedHandlingunitID = 3 [json_name = "TrackedHandlingunitID"];*/ 3:
message.trackedHandlingunitID = reader.string();
break;
case /* string TrackingURL = 4 [json_name = "TrackingURL"];*/ 4:
message.trackingURL = reader.string();
break;
case /* string NextTrackingID = 5 [json_name = "NextTrackingID"];*/ 5:
message.nextTrackingID = reader.string();
break;
case /* api.GeographicalCoordinates Location = 6 [json_name = "Location"];*/ 6:
message.location = GeographicalCoordinates.internalBinaryRead(reader, reader.uint32(), options, message.location);
break;
case /* string Reason = 7 [json_name = "Reason"];*/ 7:
message.reason = reader.string();
break;
case /* string PlusCode = 8 [json_name = "PlusCode"];*/ 8:
message.plusCode = reader.string();
break;
case /* api.TradeTier HUCarrier = 9 [json_name = "HUCarrier"];*/ 9:
message.hUCarrier = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.hUCarrier);
break;
case /* api.TradeTier HUShipFrom = 10 [json_name = "HUShipFrom"];*/ 10:
message.hUShipFrom = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.hUShipFrom);
break;
case /* api.TradeTier HUShipTo = 11 [json_name = "HUShipTo"];*/ 11:
message.hUShipTo = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.hUShipTo);
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: TrackingSummary, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* string TrackingID = 1 [json_name = "TrackingID"]; */
if (message.trackingID !== "")
writer.tag(1, WireType.LengthDelimited).string(message.trackingID);
/* api.TrackingStatus Status = 2 [json_name = "Status"]; */
if (message.status)
TrackingStatus.internalBinaryWrite(message.status, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* string TrackedHandlingunitID = 3 [json_name = "TrackedHandlingunitID"]; */
if (message.trackedHandlingunitID !== "")
writer.tag(3, WireType.LengthDelimited).string(message.trackedHandlingunitID);
/* string TrackingURL = 4 [json_name = "TrackingURL"]; */
if (message.trackingURL !== "")
writer.tag(4, WireType.LengthDelimited).string(message.trackingURL);
/* string NextTrackingID = 5 [json_name = "NextTrackingID"]; */
if (message.nextTrackingID !== "")
writer.tag(5, WireType.LengthDelimited).string(message.nextTrackingID);
/* api.GeographicalCoordinates Location = 6 [json_name = "Location"]; */
if (message.location)
GeographicalCoordinates.internalBinaryWrite(message.location, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
/* string Reason = 7 [json_name = "Reason"]; */
if (message.reason !== "")
writer.tag(7, WireType.LengthDelimited).string(message.reason);
/* string PlusCode = 8 [json_name = "PlusCode"]; */
if (message.plusCode !== "")
writer.tag(8, WireType.LengthDelimited).string(message.plusCode);
/* api.TradeTier HUCarrier = 9 [json_name = "HUCarrier"]; */
if (message.hUCarrier)
TradeTier.internalBinaryWrite(message.hUCarrier, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier HUShipFrom = 10 [json_name = "HUShipFrom"]; */
if (message.hUShipFrom)
TradeTier.internalBinaryWrite(message.hUShipFrom, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier HUShipTo = 11 [json_name = "HUShipTo"]; */
if (message.hUShipTo)
TradeTier.internalBinaryWrite(message.hUShipTo, 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.TrackingSummary
*/
export const TrackingSummary = new TrackingSummary$Type();
// @generated message type with reflection information, may provide speed optimized methods
class TrackingEvent$Type extends MessageType<TrackingEvent> {
constructor() {
super("api.TrackingEvent", [
{ no: 1, name: "Date", kind: "message", jsonName: "Date", T: () => DateTime, options: { "validate.rules": { message: { required: true } } } },
{ no: 2, name: "Code", kind: "enum", jsonName: "Code", T: () => ["api.TrackingEventCode", TrackingEventCode], options: { "validate.rules": { enum: { definedOnly: true } }, "api.indexationType": { Types: [{ Context: "*", Type: "generatedText" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortText" }] } } },
{ no: 3, name: "Location", kind: "message", jsonName: "Location", T: () => GeographicalCoordinates },
{ no: 4, name: "Reason", kind: "scalar", jsonName: "Reason", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "PlusCode", kind: "scalar", jsonName: "PlusCode", T: 9 /*ScalarType.STRING*/, options: { "api.indexationType": { Types: [{ Context: "*", Type: "generatedText" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortText" }] } } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Description for tracking event could be added ..." } } });
}
create(value?: PartialMessage<TrackingEvent>): TrackingEvent {
const message = globalThis.Object.create((this.messagePrototype!));
message.code = 0;
message.reason = "";
message.plusCode = "";
if (value !== undefined)
reflectionMergePartial<TrackingEvent>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TrackingEvent): TrackingEvent {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.DateTime Date = 1 [json_name = "Date"];*/ 1:
message.date = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.date);
break;
case /* api.TrackingEventCode Code = 2 [json_name = "Code"];*/ 2:
message.code = reader.int32();
break;
case /* api.GeographicalCoordinates Location = 3 [json_name = "Location"];*/ 3:
message.location = GeographicalCoordinates.internalBinaryRead(reader, reader.uint32(), options, message.location);
break;
case /* string Reason = 4 [json_name = "Reason"];*/ 4:
message.reason = reader.string();
break;
case /* string PlusCode = 5 [json_name = "PlusCode"];*/ 5:
message.plusCode = 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: TrackingEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.DateTime Date = 1 [json_name = "Date"]; */
if (message.date)
DateTime.internalBinaryWrite(message.date, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.TrackingEventCode Code = 2 [json_name = "Code"]; */
if (message.code !== 0)
writer.tag(2, WireType.Varint).int32(message.code);
/* api.GeographicalCoordinates Location = 3 [json_name = "Location"]; */
if (message.location)
GeographicalCoordinates.internalBinaryWrite(message.location, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
/* string Reason = 4 [json_name = "Reason"]; */
if (message.reason !== "")
writer.tag(4, WireType.LengthDelimited).string(message.reason);
/* string PlusCode = 5 [json_name = "PlusCode"]; */
if (message.plusCode !== "")
writer.tag(5, WireType.LengthDelimited).string(message.plusCode);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.TrackingEvent
*/
export const TrackingEvent = new TrackingEvent$Type();