// @generated by protobuf-ts 2.9.6
// @generated from protobuf file "rules.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 { EntityType } from "./shared";
// ========== MODEL MESSAGES ==========

/**
 * @generated from protobuf message api.Rule
 */
export interface Rule {
    /**
     * @generated from protobuf field: string ID = 1 [json_name = "ID"];
     */
    iD: string;
    /**
     * @generated from protobuf field: string OrganisationID = 2 [json_name = "OrganisationID"];
     */
    organisationID: string;
    /**
     * @generated from protobuf field: api.EntityType Entity = 3 [json_name = "Entity"];
     */
    entity: EntityType;
    /**
     * @generated from protobuf field: string Name = 4 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: string Description = 5 [json_name = "Description"];
     */
    description: string;
    /**
     * @generated from protobuf field: string Definition = 6 [json_name = "Definition"];
     */
    definition: string;
    /**
     * @generated from protobuf field: api.RuleType RuleType = 7 [json_name = "RuleType"];
     */
    ruleType: RuleType;
    /**
     * @generated from protobuf field: string RuleTypeID = 8 [json_name = "RuleTypeID"];
     */
    ruleTypeID: string;
    /**
     * @generated from protobuf field: bool Status = 9 [json_name = "Status"];
     */
    status: boolean;
}
// ========== REQUESTS & RESPONSE MESSAGES ==========

/**
 * Create
 *
 * @generated from protobuf message api.CreateRuleRequest
 */
export interface CreateRuleRequest {
    /**
     * @generated from protobuf field: string OrganisationID = 1 [json_name = "OrganisationID"];
     */
    organisationID: string;
    /**
     * @generated from protobuf field: api.EntityType Entity = 2 [json_name = "Entity"];
     */
    entity: EntityType;
    /**
     * @generated from protobuf field: string Name = 3 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: api.RuleType RuleType = 4 [json_name = "RuleType"];
     */
    ruleType: RuleType;
    /**
     * @generated from protobuf field: string RuleTypeID = 5 [json_name = "RuleTypeID"];
     */
    ruleTypeID: string;
    /**
     * @generated from protobuf field: string Description = 6 [json_name = "Description"];
     */
    description: string;
    /**
     * @generated from protobuf field: string Definition = 7 [json_name = "Definition"];
     */
    definition: string;
    /**
     * @generated from protobuf field: string Issuer = 8 [json_name = "Issuer"];
     */
    issuer: string; // Who created the rule, will be used as the commit's author when pushed to git
}
/**
 * @generated from protobuf message api.CreateRuleResponse
 */
export interface CreateRuleResponse {
    /**
     * @generated from protobuf field: api.Rule Rule = 1 [json_name = "Rule"];
     */
    rule?: Rule;
}
/**
 * Update
 *
 * @generated from protobuf message api.UpdateRuleRequest
 */
export interface UpdateRuleRequest {
    /**
     * @generated from protobuf field: string RuleID = 1 [json_name = "RuleID"];
     */
    ruleID: string;
    /**
     * @generated from protobuf field: string Name = 2 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: string Description = 3 [json_name = "Description"];
     */
    description: string;
    /**
     * @generated from protobuf field: string Definition = 4 [json_name = "Definition"];
     */
    definition: string;
    /**
     * @generated from protobuf field: api.EntityType Entity = 5 [json_name = "Entity"];
     */
    entity: EntityType;
    /**
     * @generated from protobuf field: string Issuer = 6 [json_name = "Issuer"];
     */
    issuer: string; // Who updated the rule, will be used as the commit's author when pushed to git
}
/**
 * @generated from protobuf message api.UpdateRuleResponse
 */
export interface UpdateRuleResponse {
    /**
     * @generated from protobuf field: api.Rule Rule = 1 [json_name = "Rule"];
     */
    rule?: Rule;
}
/**
 * Get
 *
 * @generated from protobuf message api.GetRuleRequest
 */
export interface GetRuleRequest {
    /**
     * @generated from protobuf field: string RuleID = 1 [json_name = "RuleID"];
     */
    ruleID: string;
}
/**
 * @generated from protobuf message api.GetRuleResponse
 */
export interface GetRuleResponse {
    /**
     * @generated from protobuf field: api.Rule Rule = 1 [json_name = "Rule"];
     */
    rule?: Rule;
}
/**
 * List
 *
 * @generated from protobuf message api.ListRulesRequest
 */
export interface ListRulesRequest {
    // Filters

    /**
     * @generated from protobuf field: string OrganisationID = 1 [json_name = "OrganisationID"];
     */
    organisationID: string;
    /**
     * @generated from protobuf field: api.RuleType RuleType = 2 [json_name = "RuleType"];
     */
    ruleType: RuleType;
    /**
     * @generated from protobuf field: string RuleTypeID = 3 [json_name = "RuleTypeID"];
     */
    ruleTypeID: string;
    /**
     * @generated from protobuf field: api.EntityType Entity = 4 [json_name = "Entity"];
     */
    entity: EntityType;
}
/**
 * @generated from protobuf message api.ListRulesResponse
 */
export interface ListRulesResponse {
    /**
     * @generated from protobuf field: repeated api.Rule Rules = 1 [json_name = "Rules"];
     */
    rules: Rule[];
}
/**
 * Delete
 *
 * @generated from protobuf message api.DeleteRuleRequest
 */
export interface DeleteRuleRequest {
    /**
     * @generated from protobuf field: string RuleID = 1 [json_name = "RuleID"];
     */
    ruleID: string;
    /**
     * @generated from protobuf field: string Issuer = 2 [json_name = "Issuer"];
     */
    issuer: string; // Who updated the rule, will be used as the commit's author when pushed to git
}
/**
 * @generated from protobuf message api.DeleteRuleResponse
 */
export interface DeleteRuleResponse {
}
/**
 * Enable
 *
 * @generated from protobuf message api.EnableRuleRequest
 */
export interface EnableRuleRequest {
    /**
     * @generated from protobuf field: string RuleID = 1 [json_name = "RuleID"];
     */
    ruleID: string;
}
/**
 * @generated from protobuf message api.EnableRuleResponse
 */
export interface EnableRuleResponse {
    /**
     * @generated from protobuf field: api.Rule Rule = 1 [json_name = "Rule"];
     */
    rule?: Rule;
}
/**
 * Disable
 *
 * @generated from protobuf message api.DisableRuleRequest
 */
export interface DisableRuleRequest {
    /**
     * @generated from protobuf field: string RuleID = 1 [json_name = "RuleID"];
     */
    ruleID: string;
}
/**
 * @generated from protobuf message api.DisableRuleResponse
 */
export interface DisableRuleResponse {
    /**
     * @generated from protobuf field: api.Rule Rule = 1 [json_name = "Rule"];
     */
    rule?: Rule;
}
/**
 * GetJSONTree
 *
 * @generated from protobuf message api.GetJSONTreeRequest
 */
export interface GetJSONTreeRequest {
    /**
     * @generated from protobuf field: string RuleID = 1 [json_name = "RuleID"];
     */
    ruleID: string;
}
/**
 * @generated from protobuf message api.GetJSONTreeResponse
 */
export interface GetJSONTreeResponse {
    /**
     * @generated from protobuf field: string JSONTree = 1 [json_name = "JSONTree"];
     */
    jSONTree: string;
}
/**
 * @generated from protobuf enum api.RuleType
 */
export enum RuleType {
    /**
     * @generated from protobuf enum value: RULE_TYPE_PROJECT_UNKNOWN = 0;
     */
    PROJECT_UNKNOWN = 0,
    /**
     * @generated from protobuf enum value: RULE_TYPE_PROJECT_RESTRICTION = 1;
     */
    PROJECT_RESTRICTION = 1,
    /**
     * @generated from protobuf enum value: RULE_TYPE_PROJECT_PRUNE = 2;
     */
    PROJECT_PRUNE = 2,
    /**
     * @generated from protobuf enum value: RULE_TYPE_PROJECT_ANONYMIZE = 3;
     */
    PROJECT_ANONYMIZE = 3
}
// @generated message type with reflection information, may provide speed optimized methods
class Rule$Type extends MessageType<Rule> {
    constructor() {
        super("api.Rule", [
            { no: 1, name: "ID", kind: "scalar", jsonName: "ID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "OrganisationID", kind: "scalar", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "Entity", kind: "enum", jsonName: "Entity", T: () => ["api.EntityType", EntityType, "ENTITY_TYPE_"] },
            { no: 4, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "Description", kind: "scalar", jsonName: "Description", T: 9 /*ScalarType.STRING*/ },
            { no: 6, name: "Definition", kind: "scalar", jsonName: "Definition", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "RuleType", kind: "enum", jsonName: "RuleType", T: () => ["api.RuleType", RuleType, "RULE_TYPE_"] },
            { no: 8, name: "RuleTypeID", kind: "scalar", jsonName: "RuleTypeID", T: 9 /*ScalarType.STRING*/ },
            { no: 9, name: "Status", kind: "scalar", jsonName: "Status", T: 8 /*ScalarType.BOOL*/ }
        ]);
    }
    create(value?: PartialMessage<Rule>): Rule {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.iD = "";
        message.organisationID = "";
        message.entity = 0;
        message.name = "";
        message.description = "";
        message.definition = "";
        message.ruleType = 0;
        message.ruleTypeID = "";
        message.status = false;
        if (value !== undefined)
            reflectionMergePartial<Rule>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Rule): Rule {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string ID = 1 [json_name = "ID"];*/ 1:
                    message.iD = reader.string();
                    break;
                case /* string OrganisationID = 2 [json_name = "OrganisationID"];*/ 2:
                    message.organisationID = reader.string();
                    break;
                case /* api.EntityType Entity = 3 [json_name = "Entity"];*/ 3:
                    message.entity = reader.int32();
                    break;
                case /* string Name = 4 [json_name = "Name"];*/ 4:
                    message.name = reader.string();
                    break;
                case /* string Description = 5 [json_name = "Description"];*/ 5:
                    message.description = reader.string();
                    break;
                case /* string Definition = 6 [json_name = "Definition"];*/ 6:
                    message.definition = reader.string();
                    break;
                case /* api.RuleType RuleType = 7 [json_name = "RuleType"];*/ 7:
                    message.ruleType = reader.int32();
                    break;
                case /* string RuleTypeID = 8 [json_name = "RuleTypeID"];*/ 8:
                    message.ruleTypeID = reader.string();
                    break;
                case /* bool Status = 9 [json_name = "Status"];*/ 9:
                    message.status = 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: Rule, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string ID = 1 [json_name = "ID"]; */
        if (message.iD !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.iD);
        /* string OrganisationID = 2 [json_name = "OrganisationID"]; */
        if (message.organisationID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.organisationID);
        /* api.EntityType Entity = 3 [json_name = "Entity"]; */
        if (message.entity !== 0)
            writer.tag(3, WireType.Varint).int32(message.entity);
        /* string Name = 4 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.name);
        /* string Description = 5 [json_name = "Description"]; */
        if (message.description !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.description);
        /* string Definition = 6 [json_name = "Definition"]; */
        if (message.definition !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.definition);
        /* api.RuleType RuleType = 7 [json_name = "RuleType"]; */
        if (message.ruleType !== 0)
            writer.tag(7, WireType.Varint).int32(message.ruleType);
        /* string RuleTypeID = 8 [json_name = "RuleTypeID"]; */
        if (message.ruleTypeID !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.ruleTypeID);
        /* bool Status = 9 [json_name = "Status"]; */
        if (message.status !== false)
            writer.tag(9, WireType.Varint).bool(message.status);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.Rule
 */
export const Rule = new Rule$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateRuleRequest$Type extends MessageType<CreateRuleRequest> {
    constructor() {
        super("api.CreateRuleRequest", [
            { no: 1, name: "OrganisationID", kind: "scalar", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 2, name: "Entity", kind: "enum", jsonName: "Entity", T: () => ["api.EntityType", EntityType, "ENTITY_TYPE_"], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 3, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 4, name: "RuleType", kind: "enum", jsonName: "RuleType", T: () => ["api.RuleType", RuleType, "RULE_TYPE_"], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 5, name: "RuleTypeID", kind: "scalar", jsonName: "RuleTypeID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 6, name: "Description", kind: "scalar", jsonName: "Description", T: 9 /*ScalarType.STRING*/ },
            { no: 7, name: "Definition", kind: "scalar", jsonName: "Definition", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 8, name: "Issuer", kind: "scalar", jsonName: "Issuer", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["OrganisationID", "Entity", "Name", "RuleType", "RuleTypeID", "Definition", "Issuer"] } } });
    }
    create(value?: PartialMessage<CreateRuleRequest>): CreateRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.organisationID = "";
        message.entity = 0;
        message.name = "";
        message.ruleType = 0;
        message.ruleTypeID = "";
        message.description = "";
        message.definition = "";
        message.issuer = "";
        if (value !== undefined)
            reflectionMergePartial<CreateRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateRuleRequest): CreateRuleRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string OrganisationID = 1 [json_name = "OrganisationID"];*/ 1:
                    message.organisationID = reader.string();
                    break;
                case /* api.EntityType Entity = 2 [json_name = "Entity"];*/ 2:
                    message.entity = reader.int32();
                    break;
                case /* string Name = 3 [json_name = "Name"];*/ 3:
                    message.name = reader.string();
                    break;
                case /* api.RuleType RuleType = 4 [json_name = "RuleType"];*/ 4:
                    message.ruleType = reader.int32();
                    break;
                case /* string RuleTypeID = 5 [json_name = "RuleTypeID"];*/ 5:
                    message.ruleTypeID = reader.string();
                    break;
                case /* string Description = 6 [json_name = "Description"];*/ 6:
                    message.description = reader.string();
                    break;
                case /* string Definition = 7 [json_name = "Definition"];*/ 7:
                    message.definition = reader.string();
                    break;
                case /* string Issuer = 8 [json_name = "Issuer"];*/ 8:
                    message.issuer = 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: CreateRuleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string OrganisationID = 1 [json_name = "OrganisationID"]; */
        if (message.organisationID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.organisationID);
        /* api.EntityType Entity = 2 [json_name = "Entity"]; */
        if (message.entity !== 0)
            writer.tag(2, WireType.Varint).int32(message.entity);
        /* string Name = 3 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.name);
        /* api.RuleType RuleType = 4 [json_name = "RuleType"]; */
        if (message.ruleType !== 0)
            writer.tag(4, WireType.Varint).int32(message.ruleType);
        /* string RuleTypeID = 5 [json_name = "RuleTypeID"]; */
        if (message.ruleTypeID !== "")
            writer.tag(5, WireType.LengthDelimited).string(message.ruleTypeID);
        /* string Description = 6 [json_name = "Description"]; */
        if (message.description !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.description);
        /* string Definition = 7 [json_name = "Definition"]; */
        if (message.definition !== "")
            writer.tag(7, WireType.LengthDelimited).string(message.definition);
        /* string Issuer = 8 [json_name = "Issuer"]; */
        if (message.issuer !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.issuer);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.CreateRuleRequest
 */
export const CreateRuleRequest = new CreateRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateRuleResponse$Type extends MessageType<CreateRuleResponse> {
    constructor() {
        super("api.CreateRuleResponse", [
            { no: 1, name: "Rule", kind: "message", jsonName: "Rule", T: () => Rule }
        ]);
    }
    create(value?: PartialMessage<CreateRuleResponse>): CreateRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<CreateRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateRuleResponse): CreateRuleResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Rule Rule = 1 [json_name = "Rule"];*/ 1:
                    message.rule = Rule.internalBinaryRead(reader, reader.uint32(), options, message.rule);
                    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: CreateRuleResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Rule Rule = 1 [json_name = "Rule"]; */
        if (message.rule)
            Rule.internalBinaryWrite(message.rule, 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.CreateRuleResponse
 */
export const CreateRuleResponse = new CreateRuleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateRuleRequest$Type extends MessageType<UpdateRuleRequest> {
    constructor() {
        super("api.UpdateRuleRequest", [
            { no: 1, name: "RuleID", kind: "scalar", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 2, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "Description", kind: "scalar", jsonName: "Description", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "Definition", kind: "scalar", jsonName: "Definition", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 5, name: "Entity", kind: "enum", jsonName: "Entity", T: () => ["api.EntityType", EntityType, "ENTITY_TYPE_"], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 6, name: "Issuer", kind: "scalar", jsonName: "Issuer", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["RuleID", "Name", "Definition", "Issuer", "Entity"] } } });
    }
    create(value?: PartialMessage<UpdateRuleRequest>): UpdateRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.ruleID = "";
        message.name = "";
        message.description = "";
        message.definition = "";
        message.entity = 0;
        message.issuer = "";
        if (value !== undefined)
            reflectionMergePartial<UpdateRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateRuleRequest): UpdateRuleRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string RuleID = 1 [json_name = "RuleID"];*/ 1:
                    message.ruleID = reader.string();
                    break;
                case /* string Name = 2 [json_name = "Name"];*/ 2:
                    message.name = reader.string();
                    break;
                case /* string Description = 3 [json_name = "Description"];*/ 3:
                    message.description = reader.string();
                    break;
                case /* string Definition = 4 [json_name = "Definition"];*/ 4:
                    message.definition = reader.string();
                    break;
                case /* api.EntityType Entity = 5 [json_name = "Entity"];*/ 5:
                    message.entity = reader.int32();
                    break;
                case /* string Issuer = 6 [json_name = "Issuer"];*/ 6:
                    message.issuer = 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: UpdateRuleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string RuleID = 1 [json_name = "RuleID"]; */
        if (message.ruleID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.ruleID);
        /* string Name = 2 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.name);
        /* string Description = 3 [json_name = "Description"]; */
        if (message.description !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.description);
        /* string Definition = 4 [json_name = "Definition"]; */
        if (message.definition !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.definition);
        /* api.EntityType Entity = 5 [json_name = "Entity"]; */
        if (message.entity !== 0)
            writer.tag(5, WireType.Varint).int32(message.entity);
        /* string Issuer = 6 [json_name = "Issuer"]; */
        if (message.issuer !== "")
            writer.tag(6, WireType.LengthDelimited).string(message.issuer);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.UpdateRuleRequest
 */
export const UpdateRuleRequest = new UpdateRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateRuleResponse$Type extends MessageType<UpdateRuleResponse> {
    constructor() {
        super("api.UpdateRuleResponse", [
            { no: 1, name: "Rule", kind: "message", jsonName: "Rule", T: () => Rule }
        ]);
    }
    create(value?: PartialMessage<UpdateRuleResponse>): UpdateRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<UpdateRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateRuleResponse): UpdateRuleResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Rule Rule = 1 [json_name = "Rule"];*/ 1:
                    message.rule = Rule.internalBinaryRead(reader, reader.uint32(), options, message.rule);
                    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: UpdateRuleResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Rule Rule = 1 [json_name = "Rule"]; */
        if (message.rule)
            Rule.internalBinaryWrite(message.rule, 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.UpdateRuleResponse
 */
export const UpdateRuleResponse = new UpdateRuleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRuleRequest$Type extends MessageType<GetRuleRequest> {
    constructor() {
        super("api.GetRuleRequest", [
            { no: 1, name: "RuleID", kind: "scalar", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["RuleID"] } } });
    }
    create(value?: PartialMessage<GetRuleRequest>): GetRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.ruleID = "";
        if (value !== undefined)
            reflectionMergePartial<GetRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRuleRequest): GetRuleRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string RuleID = 1 [json_name = "RuleID"];*/ 1:
                    message.ruleID = 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: GetRuleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string RuleID = 1 [json_name = "RuleID"]; */
        if (message.ruleID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.ruleID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetRuleRequest
 */
export const GetRuleRequest = new GetRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRuleResponse$Type extends MessageType<GetRuleResponse> {
    constructor() {
        super("api.GetRuleResponse", [
            { no: 1, name: "Rule", kind: "message", jsonName: "Rule", T: () => Rule }
        ]);
    }
    create(value?: PartialMessage<GetRuleResponse>): GetRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<GetRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRuleResponse): GetRuleResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Rule Rule = 1 [json_name = "Rule"];*/ 1:
                    message.rule = Rule.internalBinaryRead(reader, reader.uint32(), options, message.rule);
                    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: GetRuleResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Rule Rule = 1 [json_name = "Rule"]; */
        if (message.rule)
            Rule.internalBinaryWrite(message.rule, 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.GetRuleResponse
 */
export const GetRuleResponse = new GetRuleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListRulesRequest$Type extends MessageType<ListRulesRequest> {
    constructor() {
        super("api.ListRulesRequest", [
            { no: 1, name: "OrganisationID", kind: "scalar", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "RuleType", kind: "enum", jsonName: "RuleType", T: () => ["api.RuleType", RuleType, "RULE_TYPE_"] },
            { no: 3, name: "RuleTypeID", kind: "scalar", jsonName: "RuleTypeID", T: 9 /*ScalarType.STRING*/ },
            { no: 4, name: "Entity", kind: "enum", jsonName: "Entity", T: () => ["api.EntityType", EntityType, "ENTITY_TYPE_"] }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: {} } });
    }
    create(value?: PartialMessage<ListRulesRequest>): ListRulesRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.organisationID = "";
        message.ruleType = 0;
        message.ruleTypeID = "";
        message.entity = 0;
        if (value !== undefined)
            reflectionMergePartial<ListRulesRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListRulesRequest): ListRulesRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string OrganisationID = 1 [json_name = "OrganisationID"];*/ 1:
                    message.organisationID = reader.string();
                    break;
                case /* api.RuleType RuleType = 2 [json_name = "RuleType"];*/ 2:
                    message.ruleType = reader.int32();
                    break;
                case /* string RuleTypeID = 3 [json_name = "RuleTypeID"];*/ 3:
                    message.ruleTypeID = reader.string();
                    break;
                case /* api.EntityType Entity = 4 [json_name = "Entity"];*/ 4:
                    message.entity = 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: ListRulesRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string OrganisationID = 1 [json_name = "OrganisationID"]; */
        if (message.organisationID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.organisationID);
        /* api.RuleType RuleType = 2 [json_name = "RuleType"]; */
        if (message.ruleType !== 0)
            writer.tag(2, WireType.Varint).int32(message.ruleType);
        /* string RuleTypeID = 3 [json_name = "RuleTypeID"]; */
        if (message.ruleTypeID !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.ruleTypeID);
        /* api.EntityType Entity = 4 [json_name = "Entity"]; */
        if (message.entity !== 0)
            writer.tag(4, WireType.Varint).int32(message.entity);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ListRulesRequest
 */
export const ListRulesRequest = new ListRulesRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListRulesResponse$Type extends MessageType<ListRulesResponse> {
    constructor() {
        super("api.ListRulesResponse", [
            { no: 1, name: "Rules", kind: "message", jsonName: "Rules", repeat: 1 /*RepeatType.PACKED*/, T: () => Rule }
        ]);
    }
    create(value?: PartialMessage<ListRulesResponse>): ListRulesResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.rules = [];
        if (value !== undefined)
            reflectionMergePartial<ListRulesResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListRulesResponse): ListRulesResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.Rule Rules = 1 [json_name = "Rules"];*/ 1:
                    message.rules.push(Rule.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: ListRulesResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.Rule Rules = 1 [json_name = "Rules"]; */
        for (let i = 0; i < message.rules.length; i++)
            Rule.internalBinaryWrite(message.rules[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.ListRulesResponse
 */
export const ListRulesResponse = new ListRulesResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteRuleRequest$Type extends MessageType<DeleteRuleRequest> {
    constructor() {
        super("api.DeleteRuleRequest", [
            { no: 1, name: "RuleID", kind: "scalar", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 2, name: "Issuer", kind: "scalar", jsonName: "Issuer", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["RuleID", "Issuer"] } } });
    }
    create(value?: PartialMessage<DeleteRuleRequest>): DeleteRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.ruleID = "";
        message.issuer = "";
        if (value !== undefined)
            reflectionMergePartial<DeleteRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteRuleRequest): DeleteRuleRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string RuleID = 1 [json_name = "RuleID"];*/ 1:
                    message.ruleID = reader.string();
                    break;
                case /* string Issuer = 2 [json_name = "Issuer"];*/ 2:
                    message.issuer = 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: DeleteRuleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string RuleID = 1 [json_name = "RuleID"]; */
        if (message.ruleID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.ruleID);
        /* string Issuer = 2 [json_name = "Issuer"]; */
        if (message.issuer !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.issuer);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DeleteRuleRequest
 */
export const DeleteRuleRequest = new DeleteRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteRuleResponse$Type extends MessageType<DeleteRuleResponse> {
    constructor() {
        super("api.DeleteRuleResponse", []);
    }
    create(value?: PartialMessage<DeleteRuleResponse>): DeleteRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteRuleResponse): DeleteRuleResponse {
        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: DeleteRuleResponse, 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.DeleteRuleResponse
 */
export const DeleteRuleResponse = new DeleteRuleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EnableRuleRequest$Type extends MessageType<EnableRuleRequest> {
    constructor() {
        super("api.EnableRuleRequest", [
            { no: 1, name: "RuleID", kind: "scalar", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["RuleID"] } } });
    }
    create(value?: PartialMessage<EnableRuleRequest>): EnableRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.ruleID = "";
        if (value !== undefined)
            reflectionMergePartial<EnableRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnableRuleRequest): EnableRuleRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string RuleID = 1 [json_name = "RuleID"];*/ 1:
                    message.ruleID = 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: EnableRuleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string RuleID = 1 [json_name = "RuleID"]; */
        if (message.ruleID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.ruleID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.EnableRuleRequest
 */
export const EnableRuleRequest = new EnableRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EnableRuleResponse$Type extends MessageType<EnableRuleResponse> {
    constructor() {
        super("api.EnableRuleResponse", [
            { no: 1, name: "Rule", kind: "message", jsonName: "Rule", T: () => Rule }
        ]);
    }
    create(value?: PartialMessage<EnableRuleResponse>): EnableRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<EnableRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnableRuleResponse): EnableRuleResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Rule Rule = 1 [json_name = "Rule"];*/ 1:
                    message.rule = Rule.internalBinaryRead(reader, reader.uint32(), options, message.rule);
                    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: EnableRuleResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Rule Rule = 1 [json_name = "Rule"]; */
        if (message.rule)
            Rule.internalBinaryWrite(message.rule, 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.EnableRuleResponse
 */
export const EnableRuleResponse = new EnableRuleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DisableRuleRequest$Type extends MessageType<DisableRuleRequest> {
    constructor() {
        super("api.DisableRuleRequest", [
            { no: 1, name: "RuleID", kind: "scalar", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["RuleID"] } } });
    }
    create(value?: PartialMessage<DisableRuleRequest>): DisableRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.ruleID = "";
        if (value !== undefined)
            reflectionMergePartial<DisableRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisableRuleRequest): DisableRuleRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string RuleID = 1 [json_name = "RuleID"];*/ 1:
                    message.ruleID = 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: DisableRuleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string RuleID = 1 [json_name = "RuleID"]; */
        if (message.ruleID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.ruleID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DisableRuleRequest
 */
export const DisableRuleRequest = new DisableRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DisableRuleResponse$Type extends MessageType<DisableRuleResponse> {
    constructor() {
        super("api.DisableRuleResponse", [
            { no: 1, name: "Rule", kind: "message", jsonName: "Rule", T: () => Rule }
        ]);
    }
    create(value?: PartialMessage<DisableRuleResponse>): DisableRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DisableRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisableRuleResponse): DisableRuleResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Rule Rule = 1 [json_name = "Rule"];*/ 1:
                    message.rule = Rule.internalBinaryRead(reader, reader.uint32(), options, message.rule);
                    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: DisableRuleResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Rule Rule = 1 [json_name = "Rule"]; */
        if (message.rule)
            Rule.internalBinaryWrite(message.rule, 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.DisableRuleResponse
 */
export const DisableRuleResponse = new DisableRuleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetJSONTreeRequest$Type extends MessageType<GetJSONTreeRequest> {
    constructor() {
        super("api.GetJSONTreeRequest", [
            { no: 1, name: "RuleID", kind: "scalar", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["RuleID"] } } });
    }
    create(value?: PartialMessage<GetJSONTreeRequest>): GetJSONTreeRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.ruleID = "";
        if (value !== undefined)
            reflectionMergePartial<GetJSONTreeRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetJSONTreeRequest): GetJSONTreeRequest {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string RuleID = 1 [json_name = "RuleID"];*/ 1:
                    message.ruleID = 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: GetJSONTreeRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string RuleID = 1 [json_name = "RuleID"]; */
        if (message.ruleID !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.ruleID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetJSONTreeRequest
 */
export const GetJSONTreeRequest = new GetJSONTreeRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetJSONTreeResponse$Type extends MessageType<GetJSONTreeResponse> {
    constructor() {
        super("api.GetJSONTreeResponse", [
            { no: 1, name: "JSONTree", kind: "scalar", jsonName: "JSONTree", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<GetJSONTreeResponse>): GetJSONTreeResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.jSONTree = "";
        if (value !== undefined)
            reflectionMergePartial<GetJSONTreeResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetJSONTreeResponse): GetJSONTreeResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string JSONTree = 1 [json_name = "JSONTree"];*/ 1:
                    message.jSONTree = 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: GetJSONTreeResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string JSONTree = 1 [json_name = "JSONTree"]; */
        if (message.jSONTree !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.jSONTree);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetJSONTreeResponse
 */
export const GetJSONTreeResponse = new GetJSONTreeResponse$Type();
/**
 * @generated ServiceType for protobuf service api.RuleService
 */
export const RuleService = new ServiceType("api.RuleService", [
    { name: "Create", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "Create a rule" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: CreateRuleRequest, O: CreateRuleResponse },
    { name: "Update", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "Update a rule" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: UpdateRuleRequest, O: UpdateRuleResponse },
    { name: "Get", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "Get a rule" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: GetRuleRequest, O: GetRuleResponse },
    { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "List rules" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: ListRulesRequest, O: ListRulesResponse },
    { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "Delete a rule" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: DeleteRuleRequest, O: DeleteRuleResponse },
    { name: "Enable", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "Enable a rule" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: EnableRuleRequest, O: EnableRuleResponse },
    { name: "Disable", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "Disable a rule" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: DisableRuleRequest, O: DisableRuleResponse },
    { name: "GetJSONTree", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Rule"], description: "Get the JSON tree of a rule when compiled" }, "api.rscType": "Platform", "api.roles": "Platform.Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: GetJSONTreeRequest, O: GetJSONTreeResponse }
], { "api.k8sService": "rule-server" });
