// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "partnerInput.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";
import { AttachmentSummary } from "./shared";
import { ResponseHeader } from "./shared";
import { RequestProjectHeader } from "./shared";
import { EntityID } from "./shared";
import { EventHeader } from "./shared";
import { Address } from "./repositoryShared";
// Event Payload 

/**
 * @generated from protobuf message api.PartnerCreatedPayload
 */
export interface PartnerCreatedPayload {
    /**
     * @generated from protobuf field: string Name = 1 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: string LegalStructure = 2 [json_name = "LegalStructure"];
     */
    legalStructure: string;
    // repeated MetadataElement MetaData = 3 
    //    [
    //         (metadata) = true, (aggKey) = "Key" 
    //    ];

    /**
     * @generated from protobuf field: api.Address Address = 4 [json_name = "Address"];
     */
    address?: Address;
    /**
     * @generated from protobuf field: string PhotoURI = 5 [json_name = "PhotoURI"];
     */
    photoURI: string;
    /**
     * @deprecated
     * @generated from protobuf field: repeated string AllowedRoles = 6 [deprecated = true, json_name = "AllowedRoles"];
     */
    allowedRoles: string[];
}
/**
 * Event message
 *
 * @generated from protobuf message api.PartnerCreatedEvent
 */
export interface PartnerCreatedEvent {
    /**
     * @generated from protobuf field: api.EventHeader Header = 1 [json_name = "Header"];
     */
    header?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerCreatedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerCreatedPayload;
}
/**
 * API Request
 *
 * @generated from protobuf message api.PartnerCreatedRequest
 */
export interface PartnerCreatedRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerCreatedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerCreatedPayload;
}
/**
 * API Response
 *
 * @generated from protobuf message api.PartnerCreatedResponse
 */
export interface PartnerCreatedResponse {
    /**
     * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"];
     */
    header?: ResponseHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
}
// Event Payload 

/**
 * @generated from protobuf message api.PartnerDeletedPayload
 */
export interface PartnerDeletedPayload {
}
/**
 * Event message
 *
 * @generated from protobuf message api.PartnerDeletedEvent
 */
export interface PartnerDeletedEvent {
    /**
     * @generated from protobuf field: api.EventHeader Header = 1 [json_name = "Header"];
     */
    header?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerDeletedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerDeletedPayload;
}
/**
 * API Request
 *
 * @generated from protobuf message api.PartnerDeletedRequest
 */
export interface PartnerDeletedRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerDeletedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerDeletedPayload;
}
/**
 * API Response
 *
 * @generated from protobuf message api.PartnerDeletedResponse
 */
export interface PartnerDeletedResponse {
    /**
     * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"];
     */
    header?: ResponseHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
}
// 
// AttachmentAdded : this message tells that an attachment is added for the handlingUnit

/**
 * @generated from protobuf message api.PartnerAttachmentAddedPayload
 */
export interface PartnerAttachmentAddedPayload {
    /**
     * @generated from protobuf field: repeated api.AttachmentSummary Attachments = 1 [json_name = "Attachments"];
     */
    attachments: AttachmentSummary[];
}
/**
 * @generated from protobuf message api.PartnerAttachmentAddedEvent
 */
export interface PartnerAttachmentAddedEvent {
    /**
     * @generated from protobuf field: api.EventHeader Header = 1 [json_name = "Header"];
     */
    header?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerAttachmentAddedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerAttachmentAddedPayload;
}
/**
 * @generated from protobuf message api.PartnerAttachmentAddedRequest
 */
export interface PartnerAttachmentAddedRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerAttachmentAddedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerAttachmentAddedPayload;
}
/**
 * @generated from protobuf message api.PartnerAttachmentAddedResponse
 */
export interface PartnerAttachmentAddedResponse {
    /**
     * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"];
     */
    header?: ResponseHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
}
// 
// AttachmentRemoved : this message tells that an attachment is removed for the handlingUnit

/**
 * @generated from protobuf message api.PartnerAttachmentRemovedPayload
 */
export interface PartnerAttachmentRemovedPayload {
    /**
     * @generated from protobuf field: repeated api.AttachmentSummary Attachments = 1 [json_name = "Attachments"];
     */
    attachments: AttachmentSummary[];
}
/**
 * @generated from protobuf message api.PartnerAttachmentRemovedEvent
 */
export interface PartnerAttachmentRemovedEvent {
    /**
     * @generated from protobuf field: api.EventHeader Header = 1 [json_name = "Header"];
     */
    header?: EventHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerAttachmentRemovedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerAttachmentRemovedPayload;
}
/**
 * @generated from protobuf message api.PartnerAttachmentRemovedRequest
 */
export interface PartnerAttachmentRemovedRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
    /**
     * @generated from protobuf field: api.PartnerAttachmentRemovedPayload Payload = 3 [json_name = "Payload"];
     */
    payload?: PartnerAttachmentRemovedPayload;
}
/**
 * @generated from protobuf message api.PartnerAttachmentRemovedResponse
 */
export interface PartnerAttachmentRemovedResponse {
    /**
     * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"];
     */
    header?: ResponseHeader;
    /**
     * @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
     */
    iD?: EntityID;
}
// @generated message type with reflection information, may provide speed optimized methods
class PartnerCreatedPayload$Type extends MessageType<PartnerCreatedPayload> {
    constructor() {
        super("api.PartnerCreatedPayload", [
            { no: 1, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "LegalStructure", kind: "scalar", jsonName: "LegalStructure", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "Address", kind: "message", jsonName: "Address", T: () => Address },
            { no: 5, name: "PhotoURI", kind: "scalar", 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: 6, name: "AllowedRoles", kind: "scalar", 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.messageType": "Event", "api.payload": true, "api.inputEvent": "Created" });
    }
    create(value?: PartialMessage<PartnerCreatedPayload>): PartnerCreatedPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.name = "";
        message.legalStructure = "";
        message.photoURI = "";
        message.allowedRoles = [];
        if (value !== undefined)
            reflectionMergePartial<PartnerCreatedPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerCreatedPayload): PartnerCreatedPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Name = 1 [json_name = "Name"];*/ 1:
                    message.name = reader.string();
                    break;
                case /* string LegalStructure = 2 [json_name = "LegalStructure"];*/ 2:
                    message.legalStructure = reader.string();
                    break;
                case /* api.Address Address = 4 [json_name = "Address"];*/ 4:
                    message.address = Address.internalBinaryRead(reader, reader.uint32(), options, message.address);
                    break;
                case /* string PhotoURI = 5 [json_name = "PhotoURI"];*/ 5:
                    message.photoURI = reader.string();
                    break;
                case /* repeated string AllowedRoles = 6 [deprecated = true, json_name = "AllowedRoles"];*/ 6:
                    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: PartnerCreatedPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Name = 1 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.name);
        /* string LegalStructure = 2 [json_name = "LegalStructure"]; */
        if (message.legalStructure !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.legalStructure);
        /* api.Address Address = 4 [json_name = "Address"]; */
        if (message.address)
            Address.internalBinaryWrite(message.address, writer.tag(4, WireType.LengthDelimited).fork(), options).join();
        /* string PhotoURI = 5 [json_name = "PhotoURI"]; */
        if (message.photoURI !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.photoURI);
        /* repeated string AllowedRoles = 6 [deprecated = true, json_name = "AllowedRoles"]; */
        for (let i = 0; i < message.allowedRoles.length; i++)
            writer.tag(6, 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.PartnerCreatedPayload
 */
export const PartnerCreatedPayload = new PartnerCreatedPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerCreatedEvent$Type extends MessageType<PartnerCreatedEvent> {
    constructor() {
        super("api.PartnerCreatedEvent", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => EventHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerCreatedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "api.messageType": "Event", "api.inputEvent": "Created" });
    }
    create(value?: PartialMessage<PartnerCreatedEvent>): PartnerCreatedEvent {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerCreatedEvent>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerCreatedEvent): PartnerCreatedEvent {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerCreatedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerCreatedPayload.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: PartnerCreatedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            EventHeader.internalBinaryWrite(message.header, 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.PartnerCreatedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerCreatedPayload.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.PartnerCreatedEvent
 */
export const PartnerCreatedEvent = new PartnerCreatedEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerCreatedRequest$Type extends MessageType<PartnerCreatedRequest> {
    constructor() {
        super("api.PartnerCreatedRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerCreatedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ID", "Payload"] } }, "api.messageType": "Request", "api.inputEvent": "Created" });
    }
    create(value?: PartialMessage<PartnerCreatedRequest>): PartnerCreatedRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerCreatedRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerCreatedRequest): PartnerCreatedRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerCreatedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerCreatedPayload.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: PartnerCreatedRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, 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.PartnerCreatedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerCreatedPayload.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.PartnerCreatedRequest
 */
export const PartnerCreatedRequest = new PartnerCreatedRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerCreatedResponse$Type extends MessageType<PartnerCreatedResponse> {
    constructor() {
        super("api.PartnerCreatedResponse", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID }
        ], { "api.messageType": "Response", "api.inputEvent": "Created" });
    }
    create(value?: PartialMessage<PartnerCreatedResponse>): PartnerCreatedResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerCreatedResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerCreatedResponse): PartnerCreatedResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResponseHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    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: PartnerCreatedResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResponseHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResponseHeader.internalBinaryWrite(message.header, 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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PartnerCreatedResponse
 */
export const PartnerCreatedResponse = new PartnerCreatedResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerDeletedPayload$Type extends MessageType<PartnerDeletedPayload> {
    constructor() {
        super("api.PartnerDeletedPayload", [], { "api.messageType": "Event", "api.payload": true, "api.inputEvent": "Deleted" });
    }
    create(value?: PartialMessage<PartnerDeletedPayload>): PartnerDeletedPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerDeletedPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerDeletedPayload): PartnerDeletedPayload {
        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: PartnerDeletedPayload, 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.PartnerDeletedPayload
 */
export const PartnerDeletedPayload = new PartnerDeletedPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerDeletedEvent$Type extends MessageType<PartnerDeletedEvent> {
    constructor() {
        super("api.PartnerDeletedEvent", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => EventHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerDeletedPayload }
        ], { "api.messageType": "Event", "api.inputEvent": "Deleted" });
    }
    create(value?: PartialMessage<PartnerDeletedEvent>): PartnerDeletedEvent {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerDeletedEvent>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerDeletedEvent): PartnerDeletedEvent {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerDeletedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerDeletedPayload.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: PartnerDeletedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            EventHeader.internalBinaryWrite(message.header, 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.PartnerDeletedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerDeletedPayload.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.PartnerDeletedEvent
 */
export const PartnerDeletedEvent = new PartnerDeletedEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerDeletedRequest$Type extends MessageType<PartnerDeletedRequest> {
    constructor() {
        super("api.PartnerDeletedRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerDeletedPayload }
        ], { "api.messageType": "Request", "api.inputEvent": "Deleted" });
    }
    create(value?: PartialMessage<PartnerDeletedRequest>): PartnerDeletedRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerDeletedRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerDeletedRequest): PartnerDeletedRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerDeletedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerDeletedPayload.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: PartnerDeletedRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, 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.PartnerDeletedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerDeletedPayload.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.PartnerDeletedRequest
 */
export const PartnerDeletedRequest = new PartnerDeletedRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerDeletedResponse$Type extends MessageType<PartnerDeletedResponse> {
    constructor() {
        super("api.PartnerDeletedResponse", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID }
        ], { "api.messageType": "Response", "api.inputEvent": "Deleted" });
    }
    create(value?: PartialMessage<PartnerDeletedResponse>): PartnerDeletedResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerDeletedResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerDeletedResponse): PartnerDeletedResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResponseHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    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: PartnerDeletedResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResponseHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResponseHeader.internalBinaryWrite(message.header, 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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PartnerDeletedResponse
 */
export const PartnerDeletedResponse = new PartnerDeletedResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentAddedPayload$Type extends MessageType<PartnerAttachmentAddedPayload> {
    constructor() {
        super("api.PartnerAttachmentAddedPayload", [
            { no: 1, name: "Attachments", kind: "message", jsonName: "Attachments", repeat: 1 /*RepeatType.PACKED*/, T: () => AttachmentSummary, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Number of attachments added per type" } } }
        ], { "api.messageType": "Event", "api.payload": true, "api.inputEvent": "AttachmentAdded" });
    }
    create(value?: PartialMessage<PartnerAttachmentAddedPayload>): PartnerAttachmentAddedPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.attachments = [];
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentAddedPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentAddedPayload): PartnerAttachmentAddedPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.AttachmentSummary Attachments = 1 [json_name = "Attachments"];*/ 1:
                    message.attachments.push(AttachmentSummary.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: PartnerAttachmentAddedPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.AttachmentSummary Attachments = 1 [json_name = "Attachments"]; */
        for (let i = 0; i < message.attachments.length; i++)
            AttachmentSummary.internalBinaryWrite(message.attachments[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.PartnerAttachmentAddedPayload
 */
export const PartnerAttachmentAddedPayload = new PartnerAttachmentAddedPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentAddedEvent$Type extends MessageType<PartnerAttachmentAddedEvent> {
    constructor() {
        super("api.PartnerAttachmentAddedEvent", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => EventHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerAttachmentAddedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "api.messageType": "Event", "api.inputEvent": "AttachmentAdded", "api.preAggMethods": "addAttachment" });
    }
    create(value?: PartialMessage<PartnerAttachmentAddedEvent>): PartnerAttachmentAddedEvent {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentAddedEvent>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentAddedEvent): PartnerAttachmentAddedEvent {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerAttachmentAddedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerAttachmentAddedPayload.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: PartnerAttachmentAddedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            EventHeader.internalBinaryWrite(message.header, 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.PartnerAttachmentAddedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerAttachmentAddedPayload.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.PartnerAttachmentAddedEvent
 */
export const PartnerAttachmentAddedEvent = new PartnerAttachmentAddedEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentAddedRequest$Type extends MessageType<PartnerAttachmentAddedRequest> {
    constructor() {
        super("api.PartnerAttachmentAddedRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerAttachmentAddedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ID", "Payload"] } }, "api.messageType": "Request", "api.inputEvent": "AttachmentAdded" });
    }
    create(value?: PartialMessage<PartnerAttachmentAddedRequest>): PartnerAttachmentAddedRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentAddedRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentAddedRequest): PartnerAttachmentAddedRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerAttachmentAddedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerAttachmentAddedPayload.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: PartnerAttachmentAddedRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, 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.PartnerAttachmentAddedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerAttachmentAddedPayload.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.PartnerAttachmentAddedRequest
 */
export const PartnerAttachmentAddedRequest = new PartnerAttachmentAddedRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentAddedResponse$Type extends MessageType<PartnerAttachmentAddedResponse> {
    constructor() {
        super("api.PartnerAttachmentAddedResponse", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID }
        ], { "api.messageType": "Response", "api.inputEvent": "AttachmentAdded" });
    }
    create(value?: PartialMessage<PartnerAttachmentAddedResponse>): PartnerAttachmentAddedResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentAddedResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentAddedResponse): PartnerAttachmentAddedResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResponseHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    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: PartnerAttachmentAddedResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResponseHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResponseHeader.internalBinaryWrite(message.header, 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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PartnerAttachmentAddedResponse
 */
export const PartnerAttachmentAddedResponse = new PartnerAttachmentAddedResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentRemovedPayload$Type extends MessageType<PartnerAttachmentRemovedPayload> {
    constructor() {
        super("api.PartnerAttachmentRemovedPayload", [
            { no: 1, name: "Attachments", kind: "message", jsonName: "Attachments", repeat: 1 /*RepeatType.PACKED*/, T: () => AttachmentSummary, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Number of attachments removed per type" } } }
        ], { "api.messageType": "Event", "api.payload": true, "api.inputEvent": "AttachmentRemoved" });
    }
    create(value?: PartialMessage<PartnerAttachmentRemovedPayload>): PartnerAttachmentRemovedPayload {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.attachments = [];
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentRemovedPayload>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentRemovedPayload): PartnerAttachmentRemovedPayload {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.AttachmentSummary Attachments = 1 [json_name = "Attachments"];*/ 1:
                    message.attachments.push(AttachmentSummary.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: PartnerAttachmentRemovedPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.AttachmentSummary Attachments = 1 [json_name = "Attachments"]; */
        for (let i = 0; i < message.attachments.length; i++)
            AttachmentSummary.internalBinaryWrite(message.attachments[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.PartnerAttachmentRemovedPayload
 */
export const PartnerAttachmentRemovedPayload = new PartnerAttachmentRemovedPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentRemovedEvent$Type extends MessageType<PartnerAttachmentRemovedEvent> {
    constructor() {
        super("api.PartnerAttachmentRemovedEvent", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => EventHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerAttachmentRemovedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "api.messageType": "Event", "api.inputEvent": "AttachmentRemoved", "api.preAggMethods": "removeAttachment" });
    }
    create(value?: PartialMessage<PartnerAttachmentRemovedEvent>): PartnerAttachmentRemovedEvent {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentRemovedEvent>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentRemovedEvent): PartnerAttachmentRemovedEvent {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.EventHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerAttachmentRemovedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerAttachmentRemovedPayload.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: PartnerAttachmentRemovedEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.EventHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            EventHeader.internalBinaryWrite(message.header, 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.PartnerAttachmentRemovedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerAttachmentRemovedPayload.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.PartnerAttachmentRemovedEvent
 */
export const PartnerAttachmentRemovedEvent = new PartnerAttachmentRemovedEvent$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentRemovedRequest$Type extends MessageType<PartnerAttachmentRemovedRequest> {
    constructor() {
        super("api.PartnerAttachmentRemovedRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID, options: { "validate.rules": { message: { required: true } } } },
            { no: 3, name: "Payload", kind: "message", jsonName: "Payload", T: () => PartnerAttachmentRemovedPayload, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "ID", "Payload"] } }, "api.messageType": "Request", "api.inputEvent": "AttachmentRemoved" });
    }
    create(value?: PartialMessage<PartnerAttachmentRemovedRequest>): PartnerAttachmentRemovedRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentRemovedRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentRemovedRequest): PartnerAttachmentRemovedRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    break;
                case /* api.PartnerAttachmentRemovedPayload Payload = 3 [json_name = "Payload"];*/ 3:
                    message.payload = PartnerAttachmentRemovedPayload.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: PartnerAttachmentRemovedRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            RequestProjectHeader.internalBinaryWrite(message.header, 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.PartnerAttachmentRemovedPayload Payload = 3 [json_name = "Payload"]; */
        if (message.payload)
            PartnerAttachmentRemovedPayload.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.PartnerAttachmentRemovedRequest
 */
export const PartnerAttachmentRemovedRequest = new PartnerAttachmentRemovedRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PartnerAttachmentRemovedResponse$Type extends MessageType<PartnerAttachmentRemovedResponse> {
    constructor() {
        super("api.PartnerAttachmentRemovedResponse", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader },
            { no: 2, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID }
        ], { "api.messageType": "Response", "api.inputEvent": "AttachmentRemoved" });
    }
    create(value?: PartialMessage<PartnerAttachmentRemovedResponse>): PartnerAttachmentRemovedResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PartnerAttachmentRemovedResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PartnerAttachmentRemovedResponse): PartnerAttachmentRemovedResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1:
                    message.header = ResponseHeader.internalBinaryRead(reader, reader.uint32(), options, message.header);
                    break;
                case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
                    message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD);
                    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: PartnerAttachmentRemovedResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.ResponseHeader Header = 1 [json_name = "Header"]; */
        if (message.header)
            ResponseHeader.internalBinaryWrite(message.header, 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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PartnerAttachmentRemovedResponse
 */
export const PartnerAttachmentRemovedResponse = new PartnerAttachmentRemovedResponse$Type();
/**
 * @generated ServiceType for protobuf service api.PartnerInputAPI
 */
export const PartnerInputAPI = new ServiceType("api.PartnerInputAPI", [
    { name: "Created", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Partner Inputs"], description: "An Partner has been created. This is called from Reflex Platform Admin service to share the Organisation partners. For each created partner, a user group should be created by calling api.UserGroupsService/Put." }, "api.rscType": "Project", "api.roles": "Platform.Project-Input", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: PartnerCreatedRequest, O: PartnerCreatedResponse },
    { name: "Deleted", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Partner Inputs"], description: "An Partner has been deleted. This is called from Reflex Platform Admin service to share the Organisation partners." }, "api.rscType": "Project", "api.roles": "Platform.Project-Input", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: PartnerDeletedRequest, O: PartnerDeletedResponse },
    { name: "AttachmentAdded", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Partner Inputs"], description: "An attachment is added for the Partner." }, "api.rscType": "Project", "api.roles": "Platform.Project-Attachment", "api.platformReserved": true, "google.api.method_visibility": { restriction: "INTERNAL" } }, I: PartnerAttachmentAddedRequest, O: PartnerAttachmentAddedResponse },
    { name: "AttachmentRemoved", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Partner Inputs"], description: "An attachment is removed for the Partner." }, "api.rscType": "Project", "api.roles": "Platform.Project-Attachment", "api.platformReserved": true, "google.api.method_visibility": { restriction: "INTERNAL" } }, I: PartnerAttachmentRemovedRequest, O: PartnerAttachmentRemovedResponse }
], { "api.serviceType": "Api", "api.k8sService": "api-server" });
