// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix // @generated from protobuf file "appointment.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 { MetadataElement } from "./shared"; import { AppointmentStatusStruct } from "./collabShared"; import { Slot } from "./slotbooking"; import { CarrierInformationWithValue } from "./slotbooking"; import { SegmentationSelection } from "./slotbooking"; import { Commission } from "./slotbooking"; import { AppointmentType } from "./slotbooking"; import { EntityID } from "./shared"; import { EventHeader } from "./shared"; // _common_ // import "visibility.proto"; /** * * Aggregation object message * * @generated from protobuf message api.Appointment */ export interface Appointment { /** * @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.AppointmentPayload Payload = 3 */ Payload?: AppointmentPayload; } /** * @generated from protobuf message api.AppointmentPayload */ export interface AppointmentPayload { /** * Type of appointment : Expedition / Reception / Both * * @generated from protobuf field: api.AppointmentType AppointmentType = 1 */ AppointmentType: AppointmentType; /** * List of the orders and projects for which the appointment is made, with the quantities * TODO ?? * * @generated from protobuf field: repeated api.Commission Commissions = 2 */ Commissions: Commission[]; /** * Set of segmentation constraining the slot booking * * @generated from protobuf field: repeated api.SegmentationSelection SegmentationSelections = 4 */ SegmentationSelections: SegmentationSelection[]; /** * Required carrierInformation, some can be obligatory * * @generated from protobuf field: repeated api.CarrierInformationWithValue CarrierInformation = 5 */ CarrierInformation: CarrierInformationWithValue[]; /** * The slot booked for the appointment * * @generated from protobuf field: api.Slot Slot = 6 */ Slot?: Slot; /** * User mails being notified on this appointment * TODO Need to add a structure to store platform user identifiers which can act on this appointment ? * * @generated from protobuf field: repeated string Emails = 7 */ Emails: string[]; /** * Appointment Status and status history * * @generated from protobuf field: api.AppointmentStatusStruct Status = 8 */ Status?: AppointmentStatusStruct; /** * Creation date of the appointment * * @generated from protobuf field: string CreationDate = 9 */ CreationDate: string; /** * @generated from protobuf field: repeated api.MetadataElement MetaData = 10 */ MetaData: MetadataElement[]; /** * @generated from protobuf field: string CarrierID = 11 */ CarrierID: string; /** * @generated from protobuf field: string CarrierName = 12 */ CarrierName: string; } /** * @generated from protobuf message api.AppointmentTriplet */ export interface AppointmentTriplet { /** * @generated from protobuf field: api.Appointment Current = 1 */ Current?: Appointment; /** * @generated from protobuf field: api.Appointment Previous = 2 */ Previous?: Appointment; /** * @generated from protobuf field: api.Appointment LastEvent = 3 */ LastEvent?: Appointment; } // @generated message type with reflection information, may provide speed optimized methods class Appointment$Type extends MessageType { constructor() { super("api.Appointment", [ { 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: () => AppointmentPayload } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Aggregation object message" } } }); } create(value?: PartialMessage): Appointment { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Appointment): Appointment { 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.AppointmentPayload Payload */ 3: message.Payload = AppointmentPayload.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: Appointment, 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.AppointmentPayload Payload = 3; */ if (message.Payload) AppointmentPayload.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.Appointment */ export const Appointment = new Appointment$Type(); // @generated message type with reflection information, may provide speed optimized methods class AppointmentPayload$Type extends MessageType { constructor() { super("api.AppointmentPayload", [ { no: 1, name: "AppointmentType", kind: "enum", localName: "AppointmentType", jsonName: "AppointmentType", T: () => ["api.AppointmentType", AppointmentType] }, { no: 2, name: "Commissions", kind: "message", localName: "Commissions", jsonName: "Commissions", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Commission }, { no: 4, name: "SegmentationSelections", kind: "message", localName: "SegmentationSelections", jsonName: "SegmentationSelections", repeat: 2 /*RepeatType.UNPACKED*/, T: () => SegmentationSelection }, { no: 5, name: "CarrierInformation", kind: "message", localName: "CarrierInformation", jsonName: "CarrierInformation", repeat: 2 /*RepeatType.UNPACKED*/, T: () => CarrierInformationWithValue }, { no: 6, name: "Slot", kind: "message", localName: "Slot", jsonName: "Slot", T: () => Slot }, { no: 7, name: "Emails", kind: "scalar", localName: "Emails", jsonName: "Emails", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { repeated: { minItems: "1", items: { string: { email: true, ignoreEmpty: true } } } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Must be a valid email address", example: "[\"John.doe@reflex.com\", \"will.smith@reflex.com\"]" } } }, { no: 8, name: "Status", kind: "message", localName: "Status", jsonName: "Status", T: () => AppointmentStatusStruct, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Status of the appointment" }, "api.aggSkip": "StatusUpdated" } }, { no: 9, name: "CreationDate", kind: "scalar", localName: "CreationDate", jsonName: "CreationDate", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { dateIso8601: true } }, "api.viewType": { Types: [{ Context: "*", Type: "date" }] } } }, { no: 10, 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 site. They can be of several data form (string, integer, float, boolean or timestamp)" }, "api.metadata": true, "api.aggKey": "Key" } }, { no: 11, name: "CarrierID", kind: "scalar", localName: "CarrierID", jsonName: "CarrierID", T: 9 /*ScalarType.STRING*/ }, { no: 12, name: "CarrierName", kind: "scalar", localName: "CarrierName", jsonName: "CarrierName", T: 9 /*ScalarType.STRING*/ } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["AppointmentType", "Segmentations"] } } }); } create(value?: PartialMessage): AppointmentPayload { const message = globalThis.Object.create((this.messagePrototype!)); message.AppointmentType = 0; message.Commissions = []; message.SegmentationSelections = []; message.CarrierInformation = []; message.Emails = []; message.CreationDate = ""; message.MetaData = []; message.CarrierID = ""; message.CarrierName = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AppointmentPayload): AppointmentPayload { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* api.AppointmentType AppointmentType */ 1: message.AppointmentType = reader.int32(); break; case /* repeated api.Commission Commissions */ 2: message.Commissions.push(Commission.internalBinaryRead(reader, reader.uint32(), options)); break; case /* repeated api.SegmentationSelection SegmentationSelections */ 4: message.SegmentationSelections.push(SegmentationSelection.internalBinaryRead(reader, reader.uint32(), options)); break; case /* repeated api.CarrierInformationWithValue CarrierInformation */ 5: message.CarrierInformation.push(CarrierInformationWithValue.internalBinaryRead(reader, reader.uint32(), options)); break; case /* api.Slot Slot */ 6: message.Slot = Slot.internalBinaryRead(reader, reader.uint32(), options, message.Slot); break; case /* repeated string Emails */ 7: message.Emails.push(reader.string()); break; case /* api.AppointmentStatusStruct Status */ 8: message.Status = AppointmentStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.Status); break; case /* string CreationDate */ 9: message.CreationDate = reader.string(); break; case /* repeated api.MetadataElement MetaData */ 10: message.MetaData.push(MetadataElement.internalBinaryRead(reader, reader.uint32(), options)); break; case /* string CarrierID */ 11: message.CarrierID = reader.string(); break; case /* string CarrierName */ 12: message.CarrierName = 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: AppointmentPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* api.AppointmentType AppointmentType = 1; */ if (message.AppointmentType !== 0) writer.tag(1, WireType.Varint).int32(message.AppointmentType); /* repeated api.Commission Commissions = 2; */ for (let i = 0; i < message.Commissions.length; i++) Commission.internalBinaryWrite(message.Commissions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* repeated api.SegmentationSelection SegmentationSelections = 4; */ for (let i = 0; i < message.SegmentationSelections.length; i++) SegmentationSelection.internalBinaryWrite(message.SegmentationSelections[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); /* repeated api.CarrierInformationWithValue CarrierInformation = 5; */ for (let i = 0; i < message.CarrierInformation.length; i++) CarrierInformationWithValue.internalBinaryWrite(message.CarrierInformation[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); /* api.Slot Slot = 6; */ if (message.Slot) Slot.internalBinaryWrite(message.Slot, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); /* repeated string Emails = 7; */ for (let i = 0; i < message.Emails.length; i++) writer.tag(7, WireType.LengthDelimited).string(message.Emails[i]); /* api.AppointmentStatusStruct Status = 8; */ if (message.Status) AppointmentStatusStruct.internalBinaryWrite(message.Status, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); /* string CreationDate = 9; */ if (message.CreationDate !== "") writer.tag(9, WireType.LengthDelimited).string(message.CreationDate); /* repeated api.MetadataElement MetaData = 10; */ for (let i = 0; i < message.MetaData.length; i++) MetadataElement.internalBinaryWrite(message.MetaData[i], writer.tag(10, WireType.LengthDelimited).fork(), options).join(); /* string CarrierID = 11; */ if (message.CarrierID !== "") writer.tag(11, WireType.LengthDelimited).string(message.CarrierID); /* string CarrierName = 12; */ if (message.CarrierName !== "") writer.tag(12, WireType.LengthDelimited).string(message.CarrierName); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.AppointmentPayload */ export const AppointmentPayload = new AppointmentPayload$Type(); // @generated message type with reflection information, may provide speed optimized methods class AppointmentTriplet$Type extends MessageType { constructor() { super("api.AppointmentTriplet", [ { no: 1, name: "Current", kind: "message", localName: "Current", jsonName: "Current", T: () => Appointment }, { no: 2, name: "Previous", kind: "message", localName: "Previous", jsonName: "Previous", T: () => Appointment }, { no: 3, name: "LastEvent", kind: "message", localName: "LastEvent", jsonName: "LastEvent", T: () => Appointment } ]); } create(value?: PartialMessage): AppointmentTriplet { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AppointmentTriplet): AppointmentTriplet { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* api.Appointment Current */ 1: message.Current = Appointment.internalBinaryRead(reader, reader.uint32(), options, message.Current); break; case /* api.Appointment Previous */ 2: message.Previous = Appointment.internalBinaryRead(reader, reader.uint32(), options, message.Previous); break; case /* api.Appointment LastEvent */ 3: message.LastEvent = Appointment.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: AppointmentTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* api.Appointment Current = 1; */ if (message.Current) Appointment.internalBinaryWrite(message.Current, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* api.Appointment Previous = 2; */ if (message.Previous) Appointment.internalBinaryWrite(message.Previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* api.Appointment LastEvent = 3; */ if (message.LastEvent) Appointment.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.AppointmentTriplet */ export const AppointmentTriplet = new AppointmentTriplet$Type();