Files
npm-core-sdk/transportShared.ts
2025-08-19 12:29:58 +00:00

613 lines
30 KiB
TypeScript

// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix
// @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
*/
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
*/
Date: string;
/**
* Status effective date. Set by the event's RefDate that triggered the status change.
*
* @generated from protobuf field: api.DateTime ActualDate = 3
*/
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
*/
Current?: TrackingStatus;
/**
* List of all status history of the Handlingunit entity
*
* @generated from protobuf field: repeated api.TrackingStatus History = 2
*/
History: TrackingStatus[];
/**
* @generated from protobuf field: string CreationDate = 3
*/
CreationDate: string;
}
/**
* @generated from protobuf message api.TrackingSummary
*/
export interface TrackingSummary {
/**
* @generated from protobuf field: string TrackingID = 1
*/
TrackingID: string;
/**
* @generated from protobuf field: api.TrackingStatus Status = 2
*/
Status?: TrackingStatus;
/**
* @generated from protobuf field: string TrackedHandlingunitID = 3
*/
TrackedHandlingunitID: string;
/**
* @generated from protobuf field: string TrackingURL = 4
*/
TrackingURL: string;
/**
* @generated from protobuf field: string NextTrackingID = 5
*/
NextTrackingID: string;
/**
* @generated from protobuf field: api.GeographicalCoordinates Location = 6
*/
Location?: GeographicalCoordinates;
/**
* @generated from protobuf field: string Reason = 7
*/
Reason: string;
/**
* @generated from protobuf field: string PlusCode = 8
*/
PlusCode: string;
/**
* DateTime DispatchedDateTime = 8 ;
*
* @generated from protobuf field: api.TradeTier HUCarrier = 9
*/
HUCarrier?: TradeTier;
/**
* @generated from protobuf field: api.TradeTier HUShipFrom = 10
*/
HUShipFrom?: TradeTier;
/**
* @generated from protobuf field: api.TradeTier HUShipTo = 11
*/
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
*/
Date?: DateTime;
/**
* @generated from protobuf field: api.TrackingEventCode Code = 2
*/
Code: TrackingEventCode;
/**
* @generated from protobuf field: api.GeographicalCoordinates Location = 3
*/
Location?: GeographicalCoordinates;
/**
* @generated from protobuf field: string Reason = 4
*/
Reason: string;
/**
* @generated from protobuf field: string PlusCode = 5
*/
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,
/**
* @generated from protobuf enum value: TRACKINGSTATUS_9500_ANOMALY = 9500;
*/
TRACKINGSTATUS_9500_ANOMALY = 9500
}
//
// 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", localName: "StatusCode", 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", localName: "Date", 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", localName: "ActualDate", 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:
message.StatusCode = reader.int32();
break;
case /* string Date */ 2:
message.Date = reader.string();
break;
case /* api.DateTime 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; */
if (message.StatusCode !== 0)
writer.tag(1, WireType.Varint).int32(message.StatusCode);
/* string Date = 2; */
if (message.Date !== "")
writer.tag(2, WireType.LengthDelimited).string(message.Date);
/* api.DateTime ActualDate = 3; */
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", localName: "Current", jsonName: "Current", T: () => TrackingStatus },
{ no: 2, name: "History", kind: "message", localName: "History", jsonName: "History", repeat: 2 /*RepeatType.UNPACKED*/, T: () => TrackingStatus, options: { "api.aggKey": "Date" } },
{ no: 3, name: "CreationDate", kind: "scalar", localName: "CreationDate", 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:
message.Current = TrackingStatus.internalBinaryRead(reader, reader.uint32(), options, message.Current);
break;
case /* repeated api.TrackingStatus History */ 2:
message.History.push(TrackingStatus.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* string 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; */
if (message.Current)
TrackingStatus.internalBinaryWrite(message.Current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* repeated api.TrackingStatus History = 2; */
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; */
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", localName: "TrackingID", 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", localName: "Status", jsonName: "Status", T: () => TrackingStatus, options: { "api.kpiExclude": { Items: [{ Context: "Handlingunit", Group: "handlingunit" }] } } },
{ no: 3, name: "TrackedHandlingunitID", kind: "scalar", localName: "TrackedHandlingunitID", 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", localName: "TrackingURL", jsonName: "TrackingURL", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "NextTrackingID", kind: "scalar", localName: "NextTrackingID", 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", localName: "Location", jsonName: "Location", T: () => GeographicalCoordinates },
{ no: 7, name: "Reason", kind: "scalar", localName: "Reason", 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", localName: "PlusCode", 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", localName: "HUCarrier", jsonName: "HUCarrier", T: () => TradeTier, options: { "api.extractRefExclude": "Handlingunit" } },
{ no: 10, name: "HUShipFrom", kind: "message", localName: "HUShipFrom", jsonName: "HUShipFrom", T: () => TradeTier, options: { "api.extractRefExclude": "Handlingunit" } },
{ no: 11, name: "HUShipTo", kind: "message", localName: "HUShipTo", 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:
message.TrackingID = reader.string();
break;
case /* api.TrackingStatus Status */ 2:
message.Status = TrackingStatus.internalBinaryRead(reader, reader.uint32(), options, message.Status);
break;
case /* string TrackedHandlingunitID */ 3:
message.TrackedHandlingunitID = reader.string();
break;
case /* string TrackingURL */ 4:
message.TrackingURL = reader.string();
break;
case /* string NextTrackingID */ 5:
message.NextTrackingID = reader.string();
break;
case /* api.GeographicalCoordinates Location */ 6:
message.Location = GeographicalCoordinates.internalBinaryRead(reader, reader.uint32(), options, message.Location);
break;
case /* string Reason */ 7:
message.Reason = reader.string();
break;
case /* string PlusCode */ 8:
message.PlusCode = reader.string();
break;
case /* api.TradeTier HUCarrier */ 9:
message.HUCarrier = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.HUCarrier);
break;
case /* api.TradeTier HUShipFrom */ 10:
message.HUShipFrom = TradeTier.internalBinaryRead(reader, reader.uint32(), options, message.HUShipFrom);
break;
case /* api.TradeTier 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; */
if (message.TrackingID !== "")
writer.tag(1, WireType.LengthDelimited).string(message.TrackingID);
/* api.TrackingStatus Status = 2; */
if (message.Status)
TrackingStatus.internalBinaryWrite(message.Status, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* string TrackedHandlingunitID = 3; */
if (message.TrackedHandlingunitID !== "")
writer.tag(3, WireType.LengthDelimited).string(message.TrackedHandlingunitID);
/* string TrackingURL = 4; */
if (message.TrackingURL !== "")
writer.tag(4, WireType.LengthDelimited).string(message.TrackingURL);
/* string NextTrackingID = 5; */
if (message.NextTrackingID !== "")
writer.tag(5, WireType.LengthDelimited).string(message.NextTrackingID);
/* api.GeographicalCoordinates Location = 6; */
if (message.Location)
GeographicalCoordinates.internalBinaryWrite(message.Location, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
/* string Reason = 7; */
if (message.Reason !== "")
writer.tag(7, WireType.LengthDelimited).string(message.Reason);
/* string PlusCode = 8; */
if (message.PlusCode !== "")
writer.tag(8, WireType.LengthDelimited).string(message.PlusCode);
/* api.TradeTier HUCarrier = 9; */
if (message.HUCarrier)
TradeTier.internalBinaryWrite(message.HUCarrier, writer.tag(9, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier HUShipFrom = 10; */
if (message.HUShipFrom)
TradeTier.internalBinaryWrite(message.HUShipFrom, writer.tag(10, WireType.LengthDelimited).fork(), options).join();
/* api.TradeTier HUShipTo = 11; */
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", localName: "Date", jsonName: "Date", T: () => DateTime, options: { "validate.rules": { message: { required: true } } } },
{ no: 2, name: "Code", kind: "enum", localName: "Code", 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", localName: "Location", jsonName: "Location", T: () => GeographicalCoordinates },
{ no: 4, name: "Reason", kind: "scalar", localName: "Reason", jsonName: "Reason", T: 9 /*ScalarType.STRING*/ },
{ no: 5, name: "PlusCode", kind: "scalar", localName: "PlusCode", 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:
message.Date = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.Date);
break;
case /* api.TrackingEventCode Code */ 2:
message.Code = reader.int32();
break;
case /* api.GeographicalCoordinates Location */ 3:
message.Location = GeographicalCoordinates.internalBinaryRead(reader, reader.uint32(), options, message.Location);
break;
case /* string Reason */ 4:
message.Reason = reader.string();
break;
case /* string 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; */
if (message.Date)
DateTime.internalBinaryWrite(message.Date, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.TrackingEventCode Code = 2; */
if (message.Code !== 0)
writer.tag(2, WireType.Varint).int32(message.Code);
/* api.GeographicalCoordinates Location = 3; */
if (message.Location)
GeographicalCoordinates.internalBinaryWrite(message.Location, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
/* string Reason = 4; */
if (message.Reason !== "")
writer.tag(4, WireType.LengthDelimited).string(message.Reason);
/* string PlusCode = 5; */
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();