// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "user-groups.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 { RequestProjectHeader } from "./shared";
/**
 * @generated from protobuf message api.UserGroup
 */
export interface UserGroup {
    /**
     * @generated from protobuf field: string ProjectID = 1 [json_name = "ProjectID"];
     */
    projectID: string;
    /**
     * @generated from protobuf field: string EntityRefID = 2 [json_name = "EntityRefID"];
     */
    entityRefID: string;
    /**
     * @generated from protobuf field: api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];
     */
    entityRefType: EntityRefType;
    /**
     * @generated from protobuf field: repeated string AllowedRoles = 4 [json_name = "AllowedRoles"];
     */
    allowedRoles: string[];
    /**
     * @generated from protobuf field: bool AllowAllRoles = 5 [json_name = "AllowAllRoles"];
     */
    allowAllRoles: boolean; // if true, AllowedRoles is ignored
}
/**
 * @generated from protobuf message api.PutUserGroupsRequest
 */
export interface PutUserGroupsRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string EntityRefID = 2 [json_name = "EntityRefID"];
     */
    entityRefID: string;
    /**
     * @generated from protobuf field: api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];
     */
    entityRefType: EntityRefType;
    /**
     * @generated from protobuf field: repeated string AllowedRoles = 4 [json_name = "AllowedRoles"];
     */
    allowedRoles: string[];
    /**
     * @generated from protobuf field: bool AllowAllRoles = 5 [json_name = "AllowAllRoles"];
     */
    allowAllRoles: boolean; // if true, AllowedRoles is ignored
}
/**
 * @generated from protobuf message api.PutUserGroupsResult
 */
export interface PutUserGroupsResult {
    /**
     * @generated from protobuf field: api.UserGroup UserGroup = 1 [json_name = "UserGroup"];
     */
    userGroup?: UserGroup;
}
/**
 * @generated from protobuf message api.GetUserGroupsRequest
 */
export interface GetUserGroupsRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string EntityRefID = 2 [json_name = "EntityRefID"];
     */
    entityRefID: string;
    /**
     * @generated from protobuf field: api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];
     */
    entityRefType: EntityRefType;
}
/**
 * @generated from protobuf message api.GetUserGroupsResult
 */
export interface GetUserGroupsResult {
    /**
     * @generated from protobuf field: api.UserGroup UserGroup = 1 [json_name = "UserGroup"];
     */
    userGroup?: UserGroup;
}
/**
 * @generated from protobuf message api.DeleteUserGroupsRequest
 */
export interface DeleteUserGroupsRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string EntityRefID = 2 [json_name = "EntityRefID"];
     */
    entityRefID: string;
    /**
     * @generated from protobuf field: api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];
     */
    entityRefType: EntityRefType;
}
/**
 * @generated from protobuf message api.DeleteUserGroupsResult
 */
export interface DeleteUserGroupsResult {
}
/**
 * @generated from protobuf message api.ListUserGroupsRequest
 */
export interface ListUserGroupsRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.EntityRefType EntityRefType = 2 [json_name = "EntityRefType"];
     */
    entityRefType: EntityRefType;
}
/**
 * @generated from protobuf message api.ListUserGroupsResult
 */
export interface ListUserGroupsResult {
    /**
     * @generated from protobuf field: repeated api.UserGroup UserGroups = 1 [json_name = "UserGroups"];
     */
    userGroups: UserGroup[];
}
/**
 * @generated from protobuf enum api.EntityRefType
 */
export enum EntityRefType {
    /**
     * @generated from protobuf enum value: REF_TYPE_UNKNOWN = 0;
     */
    REF_TYPE_UNKNOWN = 0,
    /**
     * @generated from protobuf enum value: REF_TYPE_PARTNER = 1;
     */
    REF_TYPE_PARTNER = 1
}
// @generated message type with reflection information, may provide speed optimized methods
class UserGroup$Type extends MessageType<UserGroup> {
    constructor() {
        super("api.UserGroup", [
            { no: 1, name: "ProjectID", kind: "scalar", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "EntityRefID", kind: "scalar", jsonName: "EntityRefID", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "EntityRefType", kind: "enum", jsonName: "EntityRefType", T: () => ["api.EntityRefType", EntityRefType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 4, name: "AllowedRoles", kind: "scalar", jsonName: "AllowedRoles", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "AllowAllRoles", kind: "scalar", jsonName: "AllowAllRoles", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value?: PartialMessage<UserGroup>): UserGroup {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.projectID = "";
        message.entityRefID = "";
        message.entityRefType = 0;
        message.allowedRoles = [];
        message.allowAllRoles = false;
        if (value !== undefined)
            reflectionMergePartial<UserGroup>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UserGroup): UserGroup {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string ProjectID = 1 [json_name = "ProjectID"];*/ 1:
                    message.projectID = reader.string();
                    break;
                case /* string EntityRefID = 2 [json_name = "EntityRefID"];*/ 2:
                    message.entityRefID = reader.string();
                    break;
                case /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];*/ 3:
                    message.entityRefType = reader.int32();
                    break;
                case /* repeated string AllowedRoles = 4 [json_name = "AllowedRoles"];*/ 4:
                    message.allowedRoles.push(reader.string());
                    break;
                case /* bool AllowAllRoles = 5 [json_name = "AllowAllRoles"];*/ 5:
                    message.allowAllRoles = reader.bool();
                    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: UserGroup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string ProjectID = 1 [json_name = "ProjectID"]; */
        if (message.projectID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.projectID);
        /* string EntityRefID = 2 [json_name = "EntityRefID"]; */
        if (message.entityRefID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.entityRefID);
        /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"]; */
        if (message.entityRefType !== 0)
            writer.tag(3, WireType.Varint).int32(message.entityRefType);
        /* repeated string AllowedRoles = 4 [json_name = "AllowedRoles"]; */
        for (let i = 0; i < message.allowedRoles.length; i++)
            writer.tag(4, WireType.LengthDelimited).string(message.allowedRoles[i]);
        /* bool AllowAllRoles = 5 [json_name = "AllowAllRoles"]; */
        if (message.allowAllRoles !== false)
            writer.tag(5, WireType.Varint).bool(message.allowAllRoles);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.UserGroup
 */
export const UserGroup = new UserGroup$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PutUserGroupsRequest$Type extends MessageType<PutUserGroupsRequest> {
    constructor() {
        super("api.PutUserGroupsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "EntityRefID", kind: "scalar", jsonName: "EntityRefID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "EntityRefType", kind: "enum", jsonName: "EntityRefType", T: () => ["api.EntityRefType", EntityRefType], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 4, name: "AllowedRoles", kind: "scalar", jsonName: "AllowedRoles", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "AllowAllRoles", kind: "scalar", jsonName: "AllowAllRoles", T: 8 /*ScalarType.BOOL*/ }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "EntityRefType", "EntityRefID"] } } });
    }
    create(value?: PartialMessage<PutUserGroupsRequest>): PutUserGroupsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.entityRefID = "";
        message.entityRefType = 0;
        message.allowedRoles = [];
        message.allowAllRoles = false;
        if (value !== undefined)
            reflectionMergePartial<PutUserGroupsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PutUserGroupsRequest): PutUserGroupsRequest {
        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 /* string EntityRefID = 2 [json_name = "EntityRefID"];*/ 2:
                    message.entityRefID = reader.string();
                    break;
                case /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];*/ 3:
                    message.entityRefType = reader.int32();
                    break;
                case /* repeated string AllowedRoles = 4 [json_name = "AllowedRoles"];*/ 4:
                    message.allowedRoles.push(reader.string());
                    break;
                case /* bool AllowAllRoles = 5 [json_name = "AllowAllRoles"];*/ 5:
                    message.allowAllRoles = reader.bool();
                    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: PutUserGroupsRequest, 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();
        /* string EntityRefID = 2 [json_name = "EntityRefID"]; */
        if (message.entityRefID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.entityRefID);
        /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"]; */
        if (message.entityRefType !== 0)
            writer.tag(3, WireType.Varint).int32(message.entityRefType);
        /* repeated string AllowedRoles = 4 [json_name = "AllowedRoles"]; */
        for (let i = 0; i < message.allowedRoles.length; i++)
            writer.tag(4, WireType.LengthDelimited).string(message.allowedRoles[i]);
        /* bool AllowAllRoles = 5 [json_name = "AllowAllRoles"]; */
        if (message.allowAllRoles !== false)
            writer.tag(5, WireType.Varint).bool(message.allowAllRoles);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.PutUserGroupsRequest
 */
export const PutUserGroupsRequest = new PutUserGroupsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class PutUserGroupsResult$Type extends MessageType<PutUserGroupsResult> {
    constructor() {
        super("api.PutUserGroupsResult", [
            { no: 1, name: "UserGroup", kind: "message", jsonName: "UserGroup", T: () => UserGroup }
        ]);
    }
    create(value?: PartialMessage<PutUserGroupsResult>): PutUserGroupsResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<PutUserGroupsResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PutUserGroupsResult): PutUserGroupsResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.UserGroup UserGroup = 1 [json_name = "UserGroup"];*/ 1:
                    message.userGroup = UserGroup.internalBinaryRead(reader, reader.uint32(), options, message.userGroup);
                    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: PutUserGroupsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.UserGroup UserGroup = 1 [json_name = "UserGroup"]; */
        if (message.userGroup)
            UserGroup.internalBinaryWrite(message.userGroup, 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.PutUserGroupsResult
 */
export const PutUserGroupsResult = new PutUserGroupsResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetUserGroupsRequest$Type extends MessageType<GetUserGroupsRequest> {
    constructor() {
        super("api.GetUserGroupsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "EntityRefID", kind: "scalar", jsonName: "EntityRefID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "EntityRefType", kind: "enum", jsonName: "EntityRefType", T: () => ["api.EntityRefType", EntityRefType], options: { "validate.rules": { enum: { definedOnly: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "EntityRefType", "EntityRefID"] } } });
    }
    create(value?: PartialMessage<GetUserGroupsRequest>): GetUserGroupsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.entityRefID = "";
        message.entityRefType = 0;
        if (value !== undefined)
            reflectionMergePartial<GetUserGroupsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserGroupsRequest): GetUserGroupsRequest {
        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 /* string EntityRefID = 2 [json_name = "EntityRefID"];*/ 2:
                    message.entityRefID = reader.string();
                    break;
                case /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];*/ 3:
                    message.entityRefType = 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: GetUserGroupsRequest, 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();
        /* string EntityRefID = 2 [json_name = "EntityRefID"]; */
        if (message.entityRefID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.entityRefID);
        /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"]; */
        if (message.entityRefType !== 0)
            writer.tag(3, WireType.Varint).int32(message.entityRefType);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetUserGroupsRequest
 */
export const GetUserGroupsRequest = new GetUserGroupsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetUserGroupsResult$Type extends MessageType<GetUserGroupsResult> {
    constructor() {
        super("api.GetUserGroupsResult", [
            { no: 1, name: "UserGroup", kind: "message", jsonName: "UserGroup", T: () => UserGroup }
        ]);
    }
    create(value?: PartialMessage<GetUserGroupsResult>): GetUserGroupsResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<GetUserGroupsResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUserGroupsResult): GetUserGroupsResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.UserGroup UserGroup = 1 [json_name = "UserGroup"];*/ 1:
                    message.userGroup = UserGroup.internalBinaryRead(reader, reader.uint32(), options, message.userGroup);
                    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: GetUserGroupsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.UserGroup UserGroup = 1 [json_name = "UserGroup"]; */
        if (message.userGroup)
            UserGroup.internalBinaryWrite(message.userGroup, 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.GetUserGroupsResult
 */
export const GetUserGroupsResult = new GetUserGroupsResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteUserGroupsRequest$Type extends MessageType<DeleteUserGroupsRequest> {
    constructor() {
        super("api.DeleteUserGroupsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "EntityRefID", kind: "scalar", jsonName: "EntityRefID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "EntityRefType", kind: "enum", jsonName: "EntityRefType", T: () => ["api.EntityRefType", EntityRefType], options: { "validate.rules": { enum: { definedOnly: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "EntityRefType", "EntityRefID"] } } });
    }
    create(value?: PartialMessage<DeleteUserGroupsRequest>): DeleteUserGroupsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.entityRefID = "";
        message.entityRefType = 0;
        if (value !== undefined)
            reflectionMergePartial<DeleteUserGroupsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteUserGroupsRequest): DeleteUserGroupsRequest {
        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 /* string EntityRefID = 2 [json_name = "EntityRefID"];*/ 2:
                    message.entityRefID = reader.string();
                    break;
                case /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"];*/ 3:
                    message.entityRefType = 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: DeleteUserGroupsRequest, 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();
        /* string EntityRefID = 2 [json_name = "EntityRefID"]; */
        if (message.entityRefID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.entityRefID);
        /* api.EntityRefType EntityRefType = 3 [json_name = "EntityRefType"]; */
        if (message.entityRefType !== 0)
            writer.tag(3, WireType.Varint).int32(message.entityRefType);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DeleteUserGroupsRequest
 */
export const DeleteUserGroupsRequest = new DeleteUserGroupsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteUserGroupsResult$Type extends MessageType<DeleteUserGroupsResult> {
    constructor() {
        super("api.DeleteUserGroupsResult", []);
    }
    create(value?: PartialMessage<DeleteUserGroupsResult>): DeleteUserGroupsResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteUserGroupsResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteUserGroupsResult): DeleteUserGroupsResult {
        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: DeleteUserGroupsResult, 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.DeleteUserGroupsResult
 */
export const DeleteUserGroupsResult = new DeleteUserGroupsResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListUserGroupsRequest$Type extends MessageType<ListUserGroupsRequest> {
    constructor() {
        super("api.ListUserGroupsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "EntityRefType", kind: "enum", jsonName: "EntityRefType", T: () => ["api.EntityRefType", EntityRefType] }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
    }
    create(value?: PartialMessage<ListUserGroupsRequest>): ListUserGroupsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.entityRefType = 0;
        if (value !== undefined)
            reflectionMergePartial<ListUserGroupsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUserGroupsRequest): ListUserGroupsRequest {
        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.EntityRefType EntityRefType = 2 [json_name = "EntityRefType"];*/ 2:
                    message.entityRefType = 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: ListUserGroupsRequest, 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.EntityRefType EntityRefType = 2 [json_name = "EntityRefType"]; */
        if (message.entityRefType !== 0)
            writer.tag(2, WireType.Varint).int32(message.entityRefType);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ListUserGroupsRequest
 */
export const ListUserGroupsRequest = new ListUserGroupsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListUserGroupsResult$Type extends MessageType<ListUserGroupsResult> {
    constructor() {
        super("api.ListUserGroupsResult", [
            { no: 1, name: "UserGroups", kind: "message", jsonName: "UserGroups", repeat: 1 /*RepeatType.PACKED*/, T: () => UserGroup }
        ]);
    }
    create(value?: PartialMessage<ListUserGroupsResult>): ListUserGroupsResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.userGroups = [];
        if (value !== undefined)
            reflectionMergePartial<ListUserGroupsResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListUserGroupsResult): ListUserGroupsResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.UserGroup UserGroups = 1 [json_name = "UserGroups"];*/ 1:
                    message.userGroups.push(UserGroup.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: ListUserGroupsResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.UserGroup UserGroups = 1 [json_name = "UserGroups"]; */
        for (let i = 0; i < message.userGroups.length; i++)
            UserGroup.internalBinaryWrite(message.userGroups[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.ListUserGroupsResult
 */
export const ListUserGroupsResult = new ListUserGroupsResult$Type();
/**
 * @generated ServiceType for protobuf service api.UserGroupsService
 */
export const UserGroupsService = new ServiceType("api.UserGroupsService", [
    { name: "Get", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Groups"], description: "Get" }, "api.rscType": "Project", "api.roles": "Platform.UserGroups", "google.api.method_visibility": { restriction: "SDK" } }, I: GetUserGroupsRequest, O: GetUserGroupsResult },
    { name: "Put", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Groups"], description: "Update or create a UserGroup" }, "api.rscType": "Project", "google.api.method_visibility": { restriction: "SDK" } }, I: PutUserGroupsRequest, O: PutUserGroupsResult },
    { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Groups"], description: "Delete" }, "api.rscType": "Project", "google.api.method_visibility": { restriction: "SDK" } }, I: DeleteUserGroupsRequest, O: DeleteUserGroupsResult },
    { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["User Groups"], description: "List" }, "api.rscType": "Project", "google.api.method_visibility": { restriction: "SDK" } }, I: ListUserGroupsRequest, O: ListUserGroupsResult }
], { "api.k8sService": "organisation-server", "api.roleManager": true, "api.resourceManager": true });
