// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix // @generated from protobuf file "notification.proto" (package "api", syntax proto3) // tslint:disable import { ServiceType } from "@protobuf-ts/runtime-rpc"; 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"; /** * @generated from protobuf message api.Notification */ export interface Notification { /** * @generated from protobuf field: string Payload = 1 */ Payload: string; /** * @generated from protobuf field: api.NotificationType Type = 2 */ Type: NotificationType; /** * @generated from protobuf field: string TemplateName = 3 */ TemplateName: string; /** * @generated from protobuf field: string AckID = 4 */ AckID: string; /** * @generated from protobuf field: api.NotificationCategory Category = 5 */ Category: NotificationCategory; /** * @generated from protobuf field: string ID = 6 */ ID: string; } /** * @generated from protobuf message api.NotificationRequest */ export interface NotificationRequest { /** * @generated from protobuf field: string Payload = 1 */ Payload: string; /** * @generated from protobuf field: api.NotificationType Type = 2 */ Type: NotificationType; /** * @generated from protobuf field: string TemplateName = 3 */ TemplateName: string; /** * @generated from protobuf field: api.NotificationCategory Category = 4 */ Category: NotificationCategory; } /** * @generated from protobuf message api.PublishToUserRequest */ export interface PublishToUserRequest { /** * @generated from protobuf field: string UserID = 1 */ UserID: string; /** * @generated from protobuf field: int64 ExpirationDate = 2 */ ExpirationDate: bigint; /** * @generated from protobuf field: api.NotificationRequest Notification = 3 */ Notification?: NotificationRequest; } /** * @generated from protobuf message api.PublishToUserResult */ export interface PublishToUserResult { } /** * @generated from protobuf message api.NotificationListItem */ export interface NotificationListItem { /** * @generated from protobuf field: string Payload = 1 */ Payload: string; /** * @generated from protobuf field: api.NotificationType Type = 2 */ Type: NotificationType; /** * @generated from protobuf field: string TemplateName = 3 */ TemplateName: string; /** * @generated from protobuf field: api.NotificationCategory Category = 4 */ Category: NotificationCategory; /** * @generated from protobuf field: string ID = 5 */ ID: string; } /** * @generated from protobuf message api.ListNotificationRequest */ export interface ListNotificationRequest { } /** * @generated from protobuf message api.ListNotificationResult */ export interface ListNotificationResult { /** * @generated from protobuf field: repeated api.NotificationListItem Notifications = 1 */ Notifications: NotificationListItem[]; } /** * @generated from protobuf enum api.NotificationType */ export enum NotificationType { /** * @generated from protobuf enum value: NOTIFICATION_TYPE_UNDEFINED = 0; */ NOTIFICATION_TYPE_UNDEFINED = 0, /** * @generated from protobuf enum value: NOTIFICATION_TYPE_TEXT = 1; */ NOTIFICATION_TYPE_TEXT = 1, /** * @generated from protobuf enum value: NOTIFICATION_TYPE_ADAPTIVE_CARD = 2; */ NOTIFICATION_TYPE_ADAPTIVE_CARD = 2 } /** * @generated from protobuf enum api.NotificationCategory */ export enum NotificationCategory { /** * @generated from protobuf enum value: NOTIFICATION_CATEGORY_UNDEFINED = 0; */ NOTIFICATION_CATEGORY_UNDEFINED = 0, /** * @generated from protobuf enum value: NOTIFICATION_CATEGORY_DATA_EXTRACTION = 1; */ NOTIFICATION_CATEGORY_DATA_EXTRACTION = 1, /** * @generated from protobuf enum value: NOTIFICATION_CATEGORY_SYSTEM = 2; */ NOTIFICATION_CATEGORY_SYSTEM = 2 } // @generated message type with reflection information, may provide speed optimized methods class Notification$Type extends MessageType { constructor() { super("api.Notification", [ { no: 1, name: "Payload", kind: "scalar", localName: "Payload", jsonName: "Payload", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Payload of the notification" } } }, { no: 2, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.NotificationType", NotificationType], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Payload type of the notification" } } }, { no: 3, name: "TemplateName", kind: "scalar", localName: "TemplateName", jsonName: "TemplateName", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Name of the ECard related to the notification payload" } } }, { no: 4, name: "AckID", kind: "scalar", localName: "AckID", jsonName: "AckID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "ID to acknowledge notification to notification-server, filled by the server" } } }, { no: 5, name: "Category", kind: "enum", localName: "Category", jsonName: "Category", T: () => ["api.NotificationCategory", NotificationCategory], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Category of the notification" } } }, { no: 6, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "ID of the notification" } } } ]); } create(value?: PartialMessage): Notification { const message = globalThis.Object.create((this.messagePrototype!)); message.Payload = ""; message.Type = 0; message.TemplateName = ""; message.AckID = ""; message.Category = 0; message.ID = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Notification): Notification { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Payload */ 1: message.Payload = reader.string(); break; case /* api.NotificationType Type */ 2: message.Type = reader.int32(); break; case /* string TemplateName */ 3: message.TemplateName = reader.string(); break; case /* string AckID */ 4: message.AckID = reader.string(); break; case /* api.NotificationCategory Category */ 5: message.Category = reader.int32(); break; case /* string ID */ 6: message.ID = 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: Notification, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Payload = 1; */ if (message.Payload !== "") writer.tag(1, WireType.LengthDelimited).string(message.Payload); /* api.NotificationType Type = 2; */ if (message.Type !== 0) writer.tag(2, WireType.Varint).int32(message.Type); /* string TemplateName = 3; */ if (message.TemplateName !== "") writer.tag(3, WireType.LengthDelimited).string(message.TemplateName); /* string AckID = 4; */ if (message.AckID !== "") writer.tag(4, WireType.LengthDelimited).string(message.AckID); /* api.NotificationCategory Category = 5; */ if (message.Category !== 0) writer.tag(5, WireType.Varint).int32(message.Category); /* string ID = 6; */ if (message.ID !== "") writer.tag(6, WireType.LengthDelimited).string(message.ID); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.Notification */ export const Notification = new Notification$Type(); // @generated message type with reflection information, may provide speed optimized methods class NotificationRequest$Type extends MessageType { constructor() { super("api.NotificationRequest", [ { no: 1, name: "Payload", kind: "scalar", localName: "Payload", jsonName: "Payload", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Payload of the notification" } } }, { no: 2, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.NotificationType", NotificationType], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Payload type of the notification" } } }, { no: 3, name: "TemplateName", kind: "scalar", localName: "TemplateName", jsonName: "TemplateName", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Name of the ECard related to the notification payload" } } }, { no: 4, name: "Category", kind: "enum", localName: "Category", jsonName: "Category", T: () => ["api.NotificationCategory", NotificationCategory], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Category of the notification" } } } ]); } create(value?: PartialMessage): NotificationRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.Payload = ""; message.Type = 0; message.TemplateName = ""; message.Category = 0; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NotificationRequest): NotificationRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Payload */ 1: message.Payload = reader.string(); break; case /* api.NotificationType Type */ 2: message.Type = reader.int32(); break; case /* string TemplateName */ 3: message.TemplateName = reader.string(); break; case /* api.NotificationCategory Category */ 4: message.Category = reader.int32(); 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: NotificationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Payload = 1; */ if (message.Payload !== "") writer.tag(1, WireType.LengthDelimited).string(message.Payload); /* api.NotificationType Type = 2; */ if (message.Type !== 0) writer.tag(2, WireType.Varint).int32(message.Type); /* string TemplateName = 3; */ if (message.TemplateName !== "") writer.tag(3, WireType.LengthDelimited).string(message.TemplateName); /* api.NotificationCategory Category = 4; */ if (message.Category !== 0) writer.tag(4, WireType.Varint).int32(message.Category); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.NotificationRequest */ export const NotificationRequest = new NotificationRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class PublishToUserRequest$Type extends MessageType { constructor() { super("api.PublishToUserRequest", [ { no: 1, name: "UserID", kind: "scalar", localName: "UserID", jsonName: "UserID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Id of user who will receive the notification" } } }, { no: 2, name: "ExpirationDate", kind: "scalar", localName: "ExpirationDate", jsonName: "ExpirationDate", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/, options: { "validate.rules": { int64: { gte: "0" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Timestamp of notification expiration. If zero, platform default expiration date is used" } } }, { no: 3, name: "Notification", kind: "message", localName: "Notification", jsonName: "Notification", T: () => NotificationRequest } ]); } create(value?: PartialMessage): PublishToUserRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.UserID = ""; message.ExpirationDate = 0n; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PublishToUserRequest): PublishToUserRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string UserID */ 1: message.UserID = reader.string(); break; case /* int64 ExpirationDate */ 2: message.ExpirationDate = reader.int64().toBigInt(); break; case /* api.NotificationRequest Notification */ 3: message.Notification = NotificationRequest.internalBinaryRead(reader, reader.uint32(), options, message.Notification); 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: PublishToUserRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string UserID = 1; */ if (message.UserID !== "") writer.tag(1, WireType.LengthDelimited).string(message.UserID); /* int64 ExpirationDate = 2; */ if (message.ExpirationDate !== 0n) writer.tag(2, WireType.Varint).int64(message.ExpirationDate); /* api.NotificationRequest Notification = 3; */ if (message.Notification) NotificationRequest.internalBinaryWrite(message.Notification, 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.PublishToUserRequest */ export const PublishToUserRequest = new PublishToUserRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class PublishToUserResult$Type extends MessageType { constructor() { super("api.PublishToUserResult", []); } create(value?: PartialMessage): PublishToUserResult { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PublishToUserResult): PublishToUserResult { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { 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: PublishToUserResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.PublishToUserResult */ export const PublishToUserResult = new PublishToUserResult$Type(); // @generated message type with reflection information, may provide speed optimized methods class NotificationListItem$Type extends MessageType { constructor() { super("api.NotificationListItem", [ { no: 1, name: "Payload", kind: "scalar", localName: "Payload", jsonName: "Payload", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Payload of the notification" } } }, { no: 2, name: "Type", kind: "enum", localName: "Type", jsonName: "Type", T: () => ["api.NotificationType", NotificationType], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Payload type of the notification" } } }, { no: 3, name: "TemplateName", kind: "scalar", localName: "TemplateName", jsonName: "TemplateName", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Name of the ECard related to the notification payload" } } }, { no: 4, name: "Category", kind: "enum", localName: "Category", jsonName: "Category", T: () => ["api.NotificationCategory", NotificationCategory], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Category of the notification" } } }, { no: 5, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "ID of the notification" } } } ]); } create(value?: PartialMessage): NotificationListItem { const message = globalThis.Object.create((this.messagePrototype!)); message.Payload = ""; message.Type = 0; message.TemplateName = ""; message.Category = 0; message.ID = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NotificationListItem): NotificationListItem { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* string Payload */ 1: message.Payload = reader.string(); break; case /* api.NotificationType Type */ 2: message.Type = reader.int32(); break; case /* string TemplateName */ 3: message.TemplateName = reader.string(); break; case /* api.NotificationCategory Category */ 4: message.Category = reader.int32(); break; case /* string ID */ 5: message.ID = 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: NotificationListItem, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Payload = 1; */ if (message.Payload !== "") writer.tag(1, WireType.LengthDelimited).string(message.Payload); /* api.NotificationType Type = 2; */ if (message.Type !== 0) writer.tag(2, WireType.Varint).int32(message.Type); /* string TemplateName = 3; */ if (message.TemplateName !== "") writer.tag(3, WireType.LengthDelimited).string(message.TemplateName); /* api.NotificationCategory Category = 4; */ if (message.Category !== 0) writer.tag(4, WireType.Varint).int32(message.Category); /* string ID = 5; */ if (message.ID !== "") writer.tag(5, WireType.LengthDelimited).string(message.ID); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.NotificationListItem */ export const NotificationListItem = new NotificationListItem$Type(); // @generated message type with reflection information, may provide speed optimized methods class ListNotificationRequest$Type extends MessageType { constructor() { super("api.ListNotificationRequest", []); } create(value?: PartialMessage): ListNotificationRequest { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListNotificationRequest): ListNotificationRequest { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { 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: ListNotificationRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.ListNotificationRequest */ export const ListNotificationRequest = new ListNotificationRequest$Type(); // @generated message type with reflection information, may provide speed optimized methods class ListNotificationResult$Type extends MessageType { constructor() { super("api.ListNotificationResult", [ { no: 1, name: "Notifications", kind: "message", localName: "Notifications", jsonName: "Notifications", repeat: 2 /*RepeatType.UNPACKED*/, T: () => NotificationListItem } ]); } create(value?: PartialMessage): ListNotificationResult { const message = globalThis.Object.create((this.messagePrototype!)); message.Notifications = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListNotificationResult): ListNotificationResult { let message = target ?? this.create(), end = reader.pos + length; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { case /* repeated api.NotificationListItem Notifications */ 1: message.Notifications.push(NotificationListItem.internalBinaryRead(reader, reader.uint32(), options)); 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: ListNotificationResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* repeated api.NotificationListItem Notifications = 1; */ for (let i = 0; i < message.Notifications.length; i++) NotificationListItem.internalBinaryWrite(message.Notifications[i], writer.tag(1, 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.ListNotificationResult */ export const ListNotificationResult = new ListNotificationResult$Type(); /** * @generated ServiceType for protobuf service api.NotificationService */ export const NotificationService = new ServiceType("api.NotificationService", [ { name: "PublishToUser", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin Notification"], description: "Send notification to user" }, "api.rscType": "Platform", "api.roles": "Platform.Notification", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: PublishToUserRequest, O: PublishToUserResult }, { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Admin Notification"], description: "List all notifications of connected user" }, "api.rscType": "Platform", "api.roles": "", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: ListNotificationRequest, O: ListNotificationResult } ], { "api.k8sService": "notification-server", "api.roleManager": true, "api.resourceManager": true });