// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix // @generated from protobuf file "partner.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 { AttachmentSummary } from "./shared"; import { PartnerStatusStruct } from "./repositoryShared"; import { Address } from "./repositoryShared"; import { EntityID } from "./shared"; import { EventHeader } from "./shared"; // // Aggregation object message /** * @generated from protobuf message api.Partner */ export interface Partner { /** * @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.PartnerPayload Payload = 3 */ Payload?: PartnerPayload; } /** * @generated from protobuf message api.PartnerPayload */ export interface PartnerPayload { /** * @generated from protobuf field: string Name = 1 */ Name: string; /** * @generated from protobuf field: string LegalStructure = 2 */ LegalStructure: string; // repeated MetadataElement MetaData = 3 // [ // (metadata) = true, (aggKey) = "Key" // ]; /** * @generated from protobuf field: api.Address Address = 4 */ Address?: Address; /** * @generated from protobuf field: api.PartnerStatusStruct Status = 6 */ Status?: PartnerStatusStruct; // Status field is not accessible from APIs /** * @generated from protobuf field: string PhotoURI = 7 */ PhotoURI: string; /** * @generated from protobuf field: repeated api.AttachmentSummary Attachments = 8 */ Attachments: AttachmentSummary[]; /** * @generated from protobuf field: int32 AttachmentNumber = 9 */ AttachmentNumber: number; /** * @deprecated * @generated from protobuf field: repeated string AllowedRoles = 10 [deprecated = true] */ AllowedRoles: string[]; } /** * @generated from protobuf message api.PartnerTriplet */ export interface PartnerTriplet { /** * @generated from protobuf field: api.Partner Current = 1 */ Current?: Partner; /** * @generated from protobuf field: api.Partner Previous = 2 */ Previous?: Partner; /** * @generated from protobuf field: api.Partner LastEvent = 3 */ LastEvent?: Partner; } // @generated message type with reflection information, may provide speed optimized methods class Partner$Type extends MessageType { constructor() { super("api.Partner", [ { 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: () => PartnerPayload } ]); } create(value?: PartialMessage): Partner { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Partner): Partner { 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.PartnerPayload Payload */ 3: message.Payload = PartnerPayload.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: Partner, 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.PartnerPayload Payload = 3; */ if (message.Payload) PartnerPayload.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.Partner */ export const Partner = new Partner$Type(); // @generated message type with reflection information, may provide speed optimized methods class PartnerPayload$Type extends MessageType { constructor() { super("api.PartnerPayload", [ { no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "api.dataRestrictionKey": "Movement,Executionflow,Handlingunit,Order,Item,Actor,Partner,Tracking", "api.kpiItems": { Items: [{ Context: "Actor", Group: "actor", Queryable: true }, { Context: "Stock", Group: "stock_extended", Queryable: true, CustomType: "SimpleAggregateFunction(anyLast,String)" }, { Context: "Executionflow", Group: "executionflow", Queryable: true }, { Context: "Handlingunit", Group: "handlingunit", Queryable: true }, { Context: "Order", Group: "order", Queryable: true }, { Context: "Partner", Group: "partner", Queryable: true }, { Context: "Tracking", Group: "tracking", Queryable: true }] } } }, { no: 2, name: "LegalStructure", kind: "scalar", localName: "LegalStructure", jsonName: "LegalStructure", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "Address", kind: "message", localName: "Address", jsonName: "Address", T: () => Address }, { no: 6, name: "Status", kind: "message", localName: "Status", jsonName: "Status", T: () => PartnerStatusStruct, options: { "n1validate.rules": { message: { unauthorized: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { readOnly: true }, "api.enrichmentClear": "Tracking,Order,Executionflow" } }, { no: 7, name: "PhotoURI", kind: "scalar", localName: "PhotoURI", jsonName: "PhotoURI", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"https://reflex-visibility-forever.jpg\"" }, "api.viewType": { Types: [{ Context: "*", Type: "image" }] } } }, { no: 8, 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", "api.enrichmentClear": "Tracking,Order,Executionflow" } }, { no: 9, 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" }, "api.enrichmentClear": "Tracking,Order,Executionflow" } }, { no: 10, name: "AllowedRoles", kind: "scalar", localName: "AllowedRoles", jsonName: "AllowedRoles", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Deprecated since release 1.7. Roles allowed for these partner's users" }, "api.enrichmentClear": "Tracking,Order,Executionflow" } } ]); } create(value?: PartialMessage): PartnerPayload { const message = globalThis.Object.create((this.messagePrototype!)); message.Name = ""; message.LegalStructure = ""; message.PhotoURI = ""; message.Attachments = []; message.AttachmentNumber = 0; message.AllowedRoles = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerPayload): PartnerPayload { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Name */ 1: message.Name = reader.string(); break; case /* string LegalStructure */ 2: message.LegalStructure = reader.string(); break; case /* api.Address Address */ 4: message.Address = Address.internalBinaryRead(reader, reader.uint32(), options, message.Address); break; case /* api.PartnerStatusStruct Status */ 6: message.Status = PartnerStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.Status); break; case /* string PhotoURI */ 7: message.PhotoURI = reader.string(); break; case /* repeated api.AttachmentSummary Attachments */ 8: message.Attachments.push(AttachmentSummary.internalBinaryRead(reader, reader.uint32(), options)); break; case /* int32 AttachmentNumber */ 9: message.AttachmentNumber = reader.int32(); break; case /* repeated string AllowedRoles = 10 [deprecated = true] */ 10: message.AllowedRoles.push(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: PartnerPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Name = 1; */ if (message.Name !== "") writer.tag(1, WireType.LengthDelimited).string(message.Name); /* string LegalStructure = 2; */ if (message.LegalStructure !== "") writer.tag(2, WireType.LengthDelimited).string(message.LegalStructure); /* api.Address Address = 4; */ if (message.Address) Address.internalBinaryWrite(message.Address, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); /* api.PartnerStatusStruct Status = 6; */ if (message.Status) PartnerStatusStruct.internalBinaryWrite(message.Status, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); /* string PhotoURI = 7; */ if (message.PhotoURI !== "") writer.tag(7, WireType.LengthDelimited).string(message.PhotoURI); /* repeated api.AttachmentSummary Attachments = 8; */ for (let i = 0; i < message.Attachments.length; i++) AttachmentSummary.internalBinaryWrite(message.Attachments[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); /* int32 AttachmentNumber = 9; */ if (message.AttachmentNumber !== 0) writer.tag(9, WireType.Varint).int32(message.AttachmentNumber); /* repeated string AllowedRoles = 10 [deprecated = true]; */ for (let i = 0; i < message.AllowedRoles.length; i++) writer.tag(10, WireType.LengthDelimited).string(message.AllowedRoles[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.PartnerPayload */ export const PartnerPayload = new PartnerPayload$Type(); // @generated message type with reflection information, may provide speed optimized methods class PartnerTriplet$Type extends MessageType { constructor() { super("api.PartnerTriplet", [ { no: 1, name: "Current", kind: "message", localName: "Current", jsonName: "Current", T: () => Partner }, { no: 2, name: "Previous", kind: "message", localName: "Previous", jsonName: "Previous", T: () => Partner }, { no: 3, name: "LastEvent", kind: "message", localName: "LastEvent", jsonName: "LastEvent", T: () => Partner } ]); } create(value?: PartialMessage): PartnerTriplet { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerTriplet): PartnerTriplet { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* api.Partner Current */ 1: message.Current = Partner.internalBinaryRead(reader, reader.uint32(), options, message.Current); break; case /* api.Partner Previous */ 2: message.Previous = Partner.internalBinaryRead(reader, reader.uint32(), options, message.Previous); break; case /* api.Partner LastEvent */ 3: message.LastEvent = Partner.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: PartnerTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* api.Partner Current = 1; */ if (message.Current) Partner.internalBinaryWrite(message.Current, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* api.Partner Previous = 2; */ if (message.Previous) Partner.internalBinaryWrite(message.Previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); /* api.Partner LastEvent = 3; */ if (message.LastEvent) Partner.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.PartnerTriplet */ export const PartnerTriplet = new PartnerTriplet$Type();