// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "notif.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 { NotifTypeEnum } from "./collabShared";
import { EntityID } from "./shared";
import { EventHeader } from "./shared";
// 
// Aggregation object message

/**
 * @generated from protobuf message api.Notif
 */
export interface Notif {
    /**
     * @generated from protobuf field: api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"];
     */
    lastEventHeader?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.NotifPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: NotifPayload;
}
/**
 * @generated from protobuf message api.NotifPayload
 */
export interface NotifPayload {
    /**
     * Type Of Change to be notified
     *
     * @generated from protobuf field: api.NotifTypeEnum NotificationType = 1 [json_name = "NotificationType"];
     */
    notificationType: NotifTypeEnum;
    /**
     * Identifier of the issuer
     *
     * @generated from protobuf field: string IssuerID = 2 [json_name = "IssuerID"];
     */
    issuerID: string;
    /**
     * List of contacts
     *
     * @generated from protobuf field: repeated string Contacts = 3 [json_name = "Contacts"];
     */
    contacts: string[];
    /**
     * Details of the notification
     *
     * @generated from protobuf field: string Details = 4 [json_name = "Details"];
     */
    details: string;
    /**
     * Entity domain
     *
     * @generated from protobuf field: string EntityDomain = 5 [json_name = "EntityDomain"];
     */
    entityDomain: string;
    /**
     * Type of entity
     *
     * @generated from protobuf field: string EntityType = 6 [json_name = "EntityType"];
     */
    entityType: string;
    /**
     * ID of entity
     *
     * @generated from protobuf field: string EntityRefID = 7 [json_name = "EntityRefID"];
     */
    entityRefID: string;
    /**
     * @generated from protobuf field: string Tags = 8 [json_name = "Tags"];
     */
    tags: string;
}
/**
 * @generated from protobuf message api.NotifTriplet
 */
export interface NotifTriplet {
    /**
     * @generated from protobuf field: api.Notif Current = 1 [json_name = "Current"];
     */
    current?: Notif;
    /**
     * @generated from protobuf field: api.Notif Previous = 2 [json_name = "Previous"];
     */
    previous?: Notif;
    /**
     * @generated from protobuf field: api.Notif LastEvent = 3 [json_name = "LastEvent"];
     */
    lastEvent?: Notif;
}
// @generated message type with reflection information, may provide speed optimized methods
class Notif$Type extends MessageType<Notif> {
    constructor() {
        super("api.Notif", [
            { no: 1, name: "LastEventHeader", kind: "message", jsonName: "LastEventHeader", T: () => EventHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => NotifPayload }
        ]);
    }
    create(value?: PartialMessage<Notif>): Notif {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<Notif>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Notif): Notif {
        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 [json_name = "LastEventHeader"];*/ 1:
                    message.lastEventHeader = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.lastEventHeader);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.NotifPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = NotifPayload.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: Notif, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"]; */
        if (message.lastEventHeader)
            EventHeader.internalBinaryWrite(message.lastEventHeader, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.EntityID ID = 2 [json_name = "ID"]; */
        if (message.iD)
            EntityID.internalBinaryWrite(message.iD, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.NotifPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            NotifPayload.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.Notif
 */
export const Notif = new Notif$Type();
// @generated message type with reflection information, may provide speed optimized methods
class NotifPayload$Type extends MessageType<NotifPayload> {
    constructor() {
        super("api.NotifPayload", [
            { no: 1, name: "NotificationType", kind: "enum", jsonName: "NotificationType", T: () => ["api.NotifTypeEnum", NotifTypeEnum], options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Type of change to be notified" } } },
            { no: 2, name: "IssuerID", kind: "scalar", jsonName: "IssuerID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the issuer (uuid format)" }, "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
            { no: 3, name: "Contacts", kind: "scalar", jsonName: "Contacts", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "List of contacts" } } },
            { no: 4, name: "Details", kind: "scalar", jsonName: "Details", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "EntityDomain", kind: "scalar", jsonName: "EntityDomain", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { in: ["trade", "collab"] } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Entity domain" } } },
            { no: 6, name: "EntityType", kind: "scalar", jsonName: "EntityType", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Type of entity" } } },
            { no: 7, name: "EntityRefID", kind: "scalar", jsonName: "EntityRefID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "ID of entity" }, "api.indexationType": { Types: [{ Context: "*", Type: "generatedText,keyword" }] }, "api.viewType": { Types: [{ Context: "*", Type: "shortKeyword" }] } } },
            { no: 8, name: "Tags", kind: "scalar", jsonName: "Tags", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Tags" } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["NotificationType", "IssuerID", "Contacts", "OldStatus", "NewStatus", "EntityDomain", "EntityType", "EntityRefID"] } } });
    }
    create(value?: PartialMessage<NotifPayload>): NotifPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.notificationType = 0;
        message.issuerID = "";
        message.contacts = [];
        message.details = "";
        message.entityDomain = "";
        message.entityType = "";
        message.entityRefID = "";
        message.tags = "";
        if (value !== undefined)
            reflectionMergePartial<NotifPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NotifPayload): NotifPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.NotifTypeEnum NotificationType = 1 [json_name = "NotificationType"];*/ 1:
                    message.notificationType = reader.int32();
                    break;
                case /* string IssuerID = 2 [json_name = "IssuerID"];*/ 2:
                    message.issuerID = reader.string();
                    break;
                case /* repeated string Contacts = 3 [json_name = "Contacts"];*/ 3:
                    message.contacts.push(reader.string());
                    break;
                case /* string Details = 4 [json_name = "Details"];*/ 4:
                    message.details = reader.string();
                    break;
                case /* string EntityDomain = 5 [json_name = "EntityDomain"];*/ 5:
                    message.entityDomain = reader.string();
                    break;
                case /* string EntityType = 6 [json_name = "EntityType"];*/ 6:
                    message.entityType = reader.string();
                    break;
                case /* string EntityRefID = 7 [json_name = "EntityRefID"];*/ 7:
                    message.entityRefID = reader.string();
                    break;
                case /* string Tags = 8 [json_name = "Tags"];*/ 8:
                    message.tags = 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: NotifPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.NotifTypeEnum NotificationType = 1 [json_name = "NotificationType"]; */
        if (message.notificationType !== 0)
            writer.tag(1, WireType.Varint).int32(message.notificationType);
        /* string IssuerID = 2 [json_name = "IssuerID"]; */
        if (message.issuerID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.issuerID);
        /* repeated string Contacts = 3 [json_name = "Contacts"]; */
        for (let i = 0; i < message.contacts.length; i++)
            writer.tag(3, WireType.LengthDelimited).string(message.contacts[i]);
        /* string Details = 4 [json_name = "Details"]; */
        if (message.details !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.details);
        /* string EntityDomain = 5 [json_name = "EntityDomain"]; */
        if (message.entityDomain !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.entityDomain);
        /* string EntityType = 6 [json_name = "EntityType"]; */
        if (message.entityType !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.entityType);
        /* string EntityRefID = 7 [json_name = "EntityRefID"]; */
        if (message.entityRefID !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.entityRefID);
        /* string Tags = 8 [json_name = "Tags"]; */
        if (message.tags !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.tags);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.NotifPayload
 */
export const NotifPayload = new NotifPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class NotifTriplet$Type extends MessageType<NotifTriplet> {
    constructor() {
        super("api.NotifTriplet", [
            { no: 1, name: "Current", kind: "message", jsonName: "Current", T: () => Notif },
            { no: 2, name: "Previous", kind: "message", jsonName: "Previous", T: () => Notif },
            { no: 3, name: "LastEvent", kind: "message", jsonName: "LastEvent", T: () => Notif }
        ]);
    }
    create(value?: PartialMessage<NotifTriplet>): NotifTriplet {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<NotifTriplet>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NotifTriplet): NotifTriplet {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Notif Current = 1 [json_name = "Current"];*/ 1:
                    message.current = Notif.internalBinaryRead(reader, reader.uint32(), options, message.current);
                    break;
                case /* api.Notif Previous = 2 [json_name = "Previous"];*/ 2:
                    message.previous = Notif.internalBinaryRead(reader, reader.uint32(), options, message.previous);
                    break;
                case /* api.Notif LastEvent = 3 [json_name = "LastEvent"];*/ 3:
                    message.lastEvent = Notif.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: NotifTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Notif Current = 1 [json_name = "Current"]; */
        if (message.current)
            Notif.internalBinaryWrite(message.current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
        /* api.Notif Previous = 2 [json_name = "Previous"]; */
        if (message.previous)
            Notif.internalBinaryWrite(message.previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        /* api.Notif LastEvent = 3 [json_name = "LastEvent"]; */
        if (message.lastEvent)
            Notif.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.NotifTriplet
 */
export const NotifTriplet = new NotifTriplet$Type();
