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

/**
 * @generated from protobuf message api.Restriction
 */
export interface Restriction {
    /**
     * @generated from protobuf field: string ID = 1 [json_name = "ID"];
     */
    iD: string;
    /**
     * @generated from protobuf field: string ProjectID = 2 [json_name = "ProjectID"];
     */
    projectID: string;
    /**
     * @generated from protobuf field: api.RestrictionType TargetType = 3 [json_name = "TargetType"];
     */
    targetType: RestrictionType;
    /**
     * @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: bool Status = 6 [json_name = "Status"];
     */
    status: boolean;
    /**
     * @generated from protobuf field: repeated api.Rule Rules = 7 [json_name = "Rules"];
     */
    rules: Rule[];
    /**
     * @generated from protobuf field: string UpdatedAt = 8 [json_name = "UpdatedAt"];
     */
    updatedAt: string;
    /**
     * @generated from protobuf field: string CreatedAt = 9 [json_name = "CreatedAt"];
     */
    createdAt: string;
}
/**
 * @generated from protobuf message api.RuleComputeResult
 */
export interface RuleComputeResult {
    /**
     * @generated from protobuf field: api.RuleComputeFormat Format = 1 [json_name = "Format"];
     */
    format: RuleComputeFormat;
    /**
     * @generated from protobuf field: string Value = 2 [json_name = "Value"];
     */
    value: string;
}
/**
 * @generated from protobuf message api.RestrictionRule
 */
export interface RestrictionRule {
    /**
     * @generated from protobuf field: string Name = 1 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: api.EntityType Entity = 2 [json_name = "Entity"];
     */
    entity: EntityType;
    /**
     * @generated from protobuf field: string Description = 3 [json_name = "Description"];
     */
    description: string;
    /**
     * @generated from protobuf field: string Definition = 4 [json_name = "Definition"];
     */
    definition: string;
}
// ========== REQUESTS & RESPONSE MESSAGES ==========

/**
 * Create
 *
 * @generated from protobuf message api.CreateRestrictionRequest
 */
export interface CreateRestrictionRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.RestrictionType TargetType = 2 [json_name = "TargetType"];
     */
    targetType: RestrictionType;
    /**
     * @generated from protobuf field: string Name = 3 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: string Description = 4 [json_name = "Description"];
     */
    description: string;
    /**
     * @generated from protobuf field: repeated api.RestrictionRule Rules = 5 [json_name = "Rules"];
     */
    rules: RestrictionRule[];
}
/**
 * @generated from protobuf message api.CreateRestrictionResponse
 */
export interface CreateRestrictionResponse {
    /**
     * @generated from protobuf field: api.Restriction Restriction = 1 [json_name = "Restriction"];
     */
    restriction?: Restriction;
}
/**
 * Update
 *
 * @generated from protobuf message api.UpdateRestrictionRequest
 */
export interface UpdateRestrictionRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string RestrictionID = 2 [json_name = "RestrictionID"];
     */
    restrictionID: string;
    /**
     * @generated from protobuf field: string Name = 3 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: string Description = 4 [json_name = "Description"];
     */
    description: string;
    /**
     * @generated from protobuf field: repeated api.RestrictionRule Rules = 5 [json_name = "Rules"];
     */
    rules: RestrictionRule[];
}
/**
 * @generated from protobuf message api.UpdateRestrictionResponse
 */
export interface UpdateRestrictionResponse {
    /**
     * @generated from protobuf field: api.Restriction Restriction = 1 [json_name = "Restriction"];
     */
    restriction?: Restriction;
}
/**
 * Get
 *
 * @generated from protobuf message api.GetRestrictionRequest
 */
export interface GetRestrictionRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string RestrictionID = 2 [json_name = "RestrictionID"];
     */
    restrictionID: string;
}
/**
 * @generated from protobuf message api.GetRestrictionResponse
 */
export interface GetRestrictionResponse {
    /**
     * @generated from protobuf field: api.Restriction Restriction = 1 [json_name = "Restriction"];
     */
    restriction?: Restriction;
}
/**
 * List
 *
 * @generated from protobuf message api.ListRestrictionsRequest
 */
export interface ListRestrictionsRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.RestrictionType TargetType = 2 [json_name = "TargetType"];
     */
    targetType: RestrictionType;
}
/**
 * @generated from protobuf message api.ListRestrictionsResponse
 */
export interface ListRestrictionsResponse {
    /**
     * @generated from protobuf field: repeated api.Restriction Restrictions = 1 [json_name = "Restrictions"];
     */
    restrictions: Restriction[];
}
/**
 * Delete
 *
 * @generated from protobuf message api.DeleteRestrictionRequest
 */
export interface DeleteRestrictionRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string RestrictionID = 2 [json_name = "RestrictionID"];
     */
    restrictionID: string;
}
/**
 * @generated from protobuf message api.DeleteRestrictionResponse
 */
export interface DeleteRestrictionResponse {
}
/**
 * Enable
 *
 * @generated from protobuf message api.EnableRestrictionRequest
 */
export interface EnableRestrictionRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string RestrictionID = 2 [json_name = "RestrictionID"];
     */
    restrictionID: string;
}
/**
 * @generated from protobuf message api.EnableRestrictionResponse
 */
export interface EnableRestrictionResponse {
    /**
     * @generated from protobuf field: api.Restriction Restriction = 1 [json_name = "Restriction"];
     */
    restriction?: Restriction;
}
/**
 * Disable
 *
 * @generated from protobuf message api.DisableRestrictionRequest
 */
export interface DisableRestrictionRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string RestrictionID = 2 [json_name = "RestrictionID"];
     */
    restrictionID: string;
}
/**
 * @generated from protobuf message api.DisableRestrictionResponse
 */
export interface DisableRestrictionResponse {
    /**
     * @generated from protobuf field: api.Restriction Restriction = 1 [json_name = "Restriction"];
     */
    restriction?: Restriction;
}
/**
 * DeleteForProject
 *
 * @generated from protobuf message api.DeleteForProjectRestrictionRequest
 */
export interface DeleteForProjectRestrictionRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
}
/**
 * @generated from protobuf message api.DeleteForProjectRestrictionResponse
 */
export interface DeleteForProjectRestrictionResponse {
}
/**
 * GetRulesJSONTree
 *
 * @generated from protobuf message api.GetRulesJSONTreeRequest
 */
export interface GetRulesJSONTreeRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string RestrictionID = 2 [json_name = "RestrictionID"];
     */
    restrictionID: string;
}
/**
 * @generated from protobuf message api.GetRulesJSONTreeResponse
 */
export interface GetRulesJSONTreeResponse {
    /**
     * @generated from protobuf field: string JSONTree = 1 [json_name = "JSONTree"];
     */
    jSONTree: string;
}
/**
 * GetRulesJSONTree
 *
 * @generated from protobuf message api.GetRuleJSONTreeRequest
 */
export interface GetRuleJSONTreeRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: string RestrictionID = 2 [json_name = "RestrictionID"];
     */
    restrictionID: string;
    /**
     * @generated from protobuf field: string Name = 3 [json_name = "Name"];
     */
    name: string;
    /**
     * @generated from protobuf field: api.EntityType Entity = 4 [json_name = "Entity"];
     */
    entity: EntityType;
}
/**
 * @generated from protobuf message api.GetRuleJSONTreeResponse
 */
export interface GetRuleJSONTreeResponse {
    /**
     * @generated from protobuf field: string JSONTree = 1 [json_name = "JSONTree"];
     */
    jSONTree: string;
}
/**
 * Compute
 *
 * @generated from protobuf message api.ComputeRuleRequest
 */
export interface ComputeRuleRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.EntityType Entity = 2 [json_name = "Entity"];
     */
    entity: EntityType;
    /**
     * @generated from protobuf field: string UserID = 3 [json_name = "UserID"];
     */
    userID: string;
    /**
     * @generated from protobuf field: repeated api.RuleComputeFormat OutputFormats = 4 [json_name = "OutputFormats"];
     */
    outputFormats: RuleComputeFormat[];
}
/**
 * @generated from protobuf message api.ComputeRuleResponse
 */
export interface ComputeRuleResponse {
    /**
     * @generated from protobuf field: repeated api.RuleComputeResult Results = 1 [json_name = "Results"];
     */
    results: RuleComputeResult[];
}
/**
 * @generated from protobuf message api.ValidateRestrictionRuleRequest
 */
export interface ValidateRestrictionRuleRequest {
    /**
     * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"];
     */
    header?: RequestProjectHeader;
    /**
     * @generated from protobuf field: api.RestrictionRule Rule = 2 [json_name = "Rule"];
     */
    rule?: RestrictionRule;
}
/**
 * @generated from protobuf message api.ValidateRestrictionRuleResponse
 */
export interface ValidateRestrictionRuleResponse {
}
/**
 * @generated from protobuf enum api.RestrictionType
 */
export enum RestrictionType {
    /**
     * @generated from protobuf enum value: RESTRICTION_TYPE_UNKNOWN = 0;
     */
    UNKNOWN = 0,
    /**
     * @generated from protobuf enum value: RESTRICTION_TYPE_USER = 1;
     */
    USER = 1,
    /**
     * @generated from protobuf enum value: RESTRICTION_TYPE_PARTNER = 2;
     */
    PARTNER = 2
}
/**
 * @generated from protobuf enum api.RuleComputeFormat
 */
export enum RuleComputeFormat {
    /**
     * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_UNKNOWN = 0;
     */
    UNKNOWN = 0,
    /**
     * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_CH = 1;
     */
    CH = 1,
    /**
     * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_OS = 2;
     */
    OS = 2,
    /**
     * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_JQ = 3;
     */
    JQ = 3
}
// @generated message type with reflection information, may provide speed optimized methods
class Restriction$Type extends MessageType<Restriction> {
    constructor() {
        super("api.Restriction", [
            { no: 1, name: "ID", kind: "scalar", jsonName: "ID", T: 9 /*ScalarType.STRING*/ },
            { no: 2, name: "ProjectID", kind: "scalar", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/ },
            { no: 3, name: "TargetType", kind: "enum", jsonName: "TargetType", T: () => ["api.RestrictionType", RestrictionType, "RESTRICTION_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: "Status", kind: "scalar", jsonName: "Status", T: 8 /*ScalarType.BOOL*/ },
            { no: 7, name: "Rules", kind: "message", jsonName: "Rules", repeat: 1 /*RepeatType.PACKED*/, T: () => Rule },
            { no: 8, name: "UpdatedAt", kind: "scalar", jsonName: "UpdatedAt", T: 9 /*ScalarType.STRING*/ },
            { no: 9, name: "CreatedAt", kind: "scalar", jsonName: "CreatedAt", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<Restriction>): Restriction {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.iD = "";
        message.projectID = "";
        message.targetType = 0;
        message.name = "";
        message.description = "";
        message.status = false;
        message.rules = [];
        message.updatedAt = "";
        message.createdAt = "";
        if (value !== undefined)
            reflectionMergePartial<Restriction>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Restriction): Restriction {
        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 ProjectID = 2 [json_name = "ProjectID"];*/ 2:
                    message.projectID = reader.string();
                    break;
                case /* api.RestrictionType TargetType = 3 [json_name = "TargetType"];*/ 3:
                    message.targetType = 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 /* bool Status = 6 [json_name = "Status"];*/ 6:
                    message.status = reader.bool();
                    break;
                case /* repeated api.Rule Rules = 7 [json_name = "Rules"];*/ 7:
                    message.rules.push(Rule.internalBinaryRead(reader, reader.uint32(), options));
                    break;
                case /* string UpdatedAt = 8 [json_name = "UpdatedAt"];*/ 8:
                    message.updatedAt = reader.string();
                    break;
                case /* string CreatedAt = 9 [json_name = "CreatedAt"];*/ 9:
                    message.createdAt = 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: Restriction, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string ID = 1 [json_name = "ID"]; */
        if (message.iD !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.iD);
        /* string ProjectID = 2 [json_name = "ProjectID"]; */
        if (message.projectID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.projectID);
        /* api.RestrictionType TargetType = 3 [json_name = "TargetType"]; */
        if (message.targetType !== 0)
            writer.tag(3, WireType.Varint).int32(message.targetType);
        /* 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);
        /* bool Status = 6 [json_name = "Status"]; */
        if (message.status !== false)
            writer.tag(6, WireType.Varint).bool(message.status);
        /* repeated api.Rule Rules = 7 [json_name = "Rules"]; */
        for (let i = 0; i < message.rules.length; i++)
            Rule.internalBinaryWrite(message.rules[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join();
        /* string UpdatedAt = 8 [json_name = "UpdatedAt"]; */
        if (message.updatedAt !== "")
            writer.tag(8, WireType.LengthDelimited).string(message.updatedAt);
        /* string CreatedAt = 9 [json_name = "CreatedAt"]; */
        if (message.createdAt !== "")
            writer.tag(9, WireType.LengthDelimited).string(message.createdAt);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.Restriction
 */
export const Restriction = new Restriction$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RuleComputeResult$Type extends MessageType<RuleComputeResult> {
    constructor() {
        super("api.RuleComputeResult", [
            { no: 1, name: "Format", kind: "enum", jsonName: "Format", T: () => ["api.RuleComputeFormat", RuleComputeFormat, "RULE_COMPUTE_FORMAT_"] },
            { no: 2, name: "Value", kind: "scalar", jsonName: "Value", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<RuleComputeResult>): RuleComputeResult {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.format = 0;
        message.value = "";
        if (value !== undefined)
            reflectionMergePartial<RuleComputeResult>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RuleComputeResult): RuleComputeResult {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.RuleComputeFormat Format = 1 [json_name = "Format"];*/ 1:
                    message.format = reader.int32();
                    break;
                case /* string Value = 2 [json_name = "Value"];*/ 2:
                    message.value = 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: RuleComputeResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.RuleComputeFormat Format = 1 [json_name = "Format"]; */
        if (message.format !== 0)
            writer.tag(1, WireType.Varint).int32(message.format);
        /* string Value = 2 [json_name = "Value"]; */
        if (message.value !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.value);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.RuleComputeResult
 */
export const RuleComputeResult = new RuleComputeResult$Type();
// @generated message type with reflection information, may provide speed optimized methods
class RestrictionRule$Type extends MessageType<RestrictionRule> {
    constructor() {
        super("api.RestrictionRule", [
            { no: 1, name: "Name", kind: "scalar", jsonName: "Name", 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: "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" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name", "Entity", "Definition"] } } });
    }
    create(value?: PartialMessage<RestrictionRule>): RestrictionRule {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.name = "";
        message.entity = 0;
        message.description = "";
        message.definition = "";
        if (value !== undefined)
            reflectionMergePartial<RestrictionRule>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestrictionRule): RestrictionRule {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* string Name = 1 [json_name = "Name"];*/ 1:
                    message.name = reader.string();
                    break;
                case /* api.EntityType Entity = 2 [json_name = "Entity"];*/ 2:
                    message.entity = reader.int32();
                    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;
                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: RestrictionRule, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* string Name = 1 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(1, WireType.LengthDelimited).string(message.name);
        /* api.EntityType Entity = 2 [json_name = "Entity"]; */
        if (message.entity !== 0)
            writer.tag(2, WireType.Varint).int32(message.entity);
        /* 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);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.RestrictionRule
 */
export const RestrictionRule = new RestrictionRule$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateRestrictionRequest$Type extends MessageType<CreateRestrictionRequest> {
    constructor() {
        super("api.CreateRestrictionRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "TargetType", kind: "enum", jsonName: "TargetType", T: () => ["api.RestrictionType", RestrictionType, "RESTRICTION_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: "Description", kind: "scalar", jsonName: "Description", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "Rules", kind: "message", jsonName: "Rules", repeat: 1 /*RepeatType.PACKED*/, T: () => RestrictionRule }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "TargetType", "Name"] } } });
    }
    create(value?: PartialMessage<CreateRestrictionRequest>): CreateRestrictionRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.targetType = 0;
        message.name = "";
        message.description = "";
        message.rules = [];
        if (value !== undefined)
            reflectionMergePartial<CreateRestrictionRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateRestrictionRequest): CreateRestrictionRequest {
        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.RestrictionType TargetType = 2 [json_name = "TargetType"];*/ 2:
                    message.targetType = reader.int32();
                    break;
                case /* string Name = 3 [json_name = "Name"];*/ 3:
                    message.name = reader.string();
                    break;
                case /* string Description = 4 [json_name = "Description"];*/ 4:
                    message.description = reader.string();
                    break;
                case /* repeated api.RestrictionRule Rules = 5 [json_name = "Rules"];*/ 5:
                    message.rules.push(RestrictionRule.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: CreateRestrictionRequest, 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.RestrictionType TargetType = 2 [json_name = "TargetType"]; */
        if (message.targetType !== 0)
            writer.tag(2, WireType.Varint).int32(message.targetType);
        /* string Name = 3 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.name);
        /* string Description = 4 [json_name = "Description"]; */
        if (message.description !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.description);
        /* repeated api.RestrictionRule Rules = 5 [json_name = "Rules"]; */
        for (let i = 0; i < message.rules.length; i++)
            RestrictionRule.internalBinaryWrite(message.rules[i], writer.tag(5, 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.CreateRestrictionRequest
 */
export const CreateRestrictionRequest = new CreateRestrictionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class CreateRestrictionResponse$Type extends MessageType<CreateRestrictionResponse> {
    constructor() {
        super("api.CreateRestrictionResponse", [
            { no: 1, name: "Restriction", kind: "message", jsonName: "Restriction", T: () => Restriction }
        ]);
    }
    create(value?: PartialMessage<CreateRestrictionResponse>): CreateRestrictionResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<CreateRestrictionResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CreateRestrictionResponse): CreateRestrictionResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Restriction Restriction = 1 [json_name = "Restriction"];*/ 1:
                    message.restriction = Restriction.internalBinaryRead(reader, reader.uint32(), options, message.restriction);
                    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: CreateRestrictionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Restriction Restriction = 1 [json_name = "Restriction"]; */
        if (message.restriction)
            Restriction.internalBinaryWrite(message.restriction, 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.CreateRestrictionResponse
 */
export const CreateRestrictionResponse = new CreateRestrictionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateRestrictionRequest$Type extends MessageType<UpdateRestrictionRequest> {
    constructor() {
        super("api.UpdateRestrictionRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "RestrictionID", kind: "scalar", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 4, name: "Description", kind: "scalar", jsonName: "Description", T: 9 /*ScalarType.STRING*/ },
            { no: 5, name: "Rules", kind: "message", jsonName: "Rules", repeat: 1 /*RepeatType.PACKED*/, T: () => RestrictionRule }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID", "Name"] } } });
    }
    create(value?: PartialMessage<UpdateRestrictionRequest>): UpdateRestrictionRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictionID = "";
        message.name = "";
        message.description = "";
        message.rules = [];
        if (value !== undefined)
            reflectionMergePartial<UpdateRestrictionRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateRestrictionRequest): UpdateRestrictionRequest {
        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 RestrictionID = 2 [json_name = "RestrictionID"];*/ 2:
                    message.restrictionID = reader.string();
                    break;
                case /* string Name = 3 [json_name = "Name"];*/ 3:
                    message.name = reader.string();
                    break;
                case /* string Description = 4 [json_name = "Description"];*/ 4:
                    message.description = reader.string();
                    break;
                case /* repeated api.RestrictionRule Rules = 5 [json_name = "Rules"];*/ 5:
                    message.rules.push(RestrictionRule.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: UpdateRestrictionRequest, 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 RestrictionID = 2 [json_name = "RestrictionID"]; */
        if (message.restrictionID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.restrictionID);
        /* string Name = 3 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.name);
        /* string Description = 4 [json_name = "Description"]; */
        if (message.description !== "")
            writer.tag(4, WireType.LengthDelimited).string(message.description);
        /* repeated api.RestrictionRule Rules = 5 [json_name = "Rules"]; */
        for (let i = 0; i < message.rules.length; i++)
            RestrictionRule.internalBinaryWrite(message.rules[i], writer.tag(5, 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.UpdateRestrictionRequest
 */
export const UpdateRestrictionRequest = new UpdateRestrictionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class UpdateRestrictionResponse$Type extends MessageType<UpdateRestrictionResponse> {
    constructor() {
        super("api.UpdateRestrictionResponse", [
            { no: 1, name: "Restriction", kind: "message", jsonName: "Restriction", T: () => Restriction }
        ]);
    }
    create(value?: PartialMessage<UpdateRestrictionResponse>): UpdateRestrictionResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<UpdateRestrictionResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UpdateRestrictionResponse): UpdateRestrictionResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Restriction Restriction = 1 [json_name = "Restriction"];*/ 1:
                    message.restriction = Restriction.internalBinaryRead(reader, reader.uint32(), options, message.restriction);
                    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: UpdateRestrictionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Restriction Restriction = 1 [json_name = "Restriction"]; */
        if (message.restriction)
            Restriction.internalBinaryWrite(message.restriction, 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.UpdateRestrictionResponse
 */
export const UpdateRestrictionResponse = new UpdateRestrictionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRestrictionRequest$Type extends MessageType<GetRestrictionRequest> {
    constructor() {
        super("api.GetRestrictionRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "RestrictionID", kind: "scalar", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID"] } } });
    }
    create(value?: PartialMessage<GetRestrictionRequest>): GetRestrictionRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictionID = "";
        if (value !== undefined)
            reflectionMergePartial<GetRestrictionRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRestrictionRequest): GetRestrictionRequest {
        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 RestrictionID = 2 [json_name = "RestrictionID"];*/ 2:
                    message.restrictionID = 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: GetRestrictionRequest, 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 RestrictionID = 2 [json_name = "RestrictionID"]; */
        if (message.restrictionID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.restrictionID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetRestrictionRequest
 */
export const GetRestrictionRequest = new GetRestrictionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRestrictionResponse$Type extends MessageType<GetRestrictionResponse> {
    constructor() {
        super("api.GetRestrictionResponse", [
            { no: 1, name: "Restriction", kind: "message", jsonName: "Restriction", T: () => Restriction }
        ]);
    }
    create(value?: PartialMessage<GetRestrictionResponse>): GetRestrictionResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<GetRestrictionResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRestrictionResponse): GetRestrictionResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Restriction Restriction = 1 [json_name = "Restriction"];*/ 1:
                    message.restriction = Restriction.internalBinaryRead(reader, reader.uint32(), options, message.restriction);
                    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: GetRestrictionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Restriction Restriction = 1 [json_name = "Restriction"]; */
        if (message.restriction)
            Restriction.internalBinaryWrite(message.restriction, 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.GetRestrictionResponse
 */
export const GetRestrictionResponse = new GetRestrictionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListRestrictionsRequest$Type extends MessageType<ListRestrictionsRequest> {
    constructor() {
        super("api.ListRestrictionsRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "TargetType", kind: "enum", jsonName: "TargetType", T: () => ["api.RestrictionType", RestrictionType, "RESTRICTION_TYPE_"] }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
    }
    create(value?: PartialMessage<ListRestrictionsRequest>): ListRestrictionsRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.targetType = 0;
        if (value !== undefined)
            reflectionMergePartial<ListRestrictionsRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListRestrictionsRequest): ListRestrictionsRequest {
        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.RestrictionType TargetType = 2 [json_name = "TargetType"];*/ 2:
                    message.targetType = 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: ListRestrictionsRequest, 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.RestrictionType TargetType = 2 [json_name = "TargetType"]; */
        if (message.targetType !== 0)
            writer.tag(2, WireType.Varint).int32(message.targetType);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ListRestrictionsRequest
 */
export const ListRestrictionsRequest = new ListRestrictionsRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ListRestrictionsResponse$Type extends MessageType<ListRestrictionsResponse> {
    constructor() {
        super("api.ListRestrictionsResponse", [
            { no: 1, name: "Restrictions", kind: "message", jsonName: "Restrictions", repeat: 1 /*RepeatType.PACKED*/, T: () => Restriction }
        ]);
    }
    create(value?: PartialMessage<ListRestrictionsResponse>): ListRestrictionsResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictions = [];
        if (value !== undefined)
            reflectionMergePartial<ListRestrictionsResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListRestrictionsResponse): ListRestrictionsResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.Restriction Restrictions = 1 [json_name = "Restrictions"];*/ 1:
                    message.restrictions.push(Restriction.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: ListRestrictionsResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.Restriction Restrictions = 1 [json_name = "Restrictions"]; */
        for (let i = 0; i < message.restrictions.length; i++)
            Restriction.internalBinaryWrite(message.restrictions[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.ListRestrictionsResponse
 */
export const ListRestrictionsResponse = new ListRestrictionsResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteRestrictionRequest$Type extends MessageType<DeleteRestrictionRequest> {
    constructor() {
        super("api.DeleteRestrictionRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "RestrictionID", kind: "scalar", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID"] } } });
    }
    create(value?: PartialMessage<DeleteRestrictionRequest>): DeleteRestrictionRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictionID = "";
        if (value !== undefined)
            reflectionMergePartial<DeleteRestrictionRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteRestrictionRequest): DeleteRestrictionRequest {
        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 RestrictionID = 2 [json_name = "RestrictionID"];*/ 2:
                    message.restrictionID = 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: DeleteRestrictionRequest, 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 RestrictionID = 2 [json_name = "RestrictionID"]; */
        if (message.restrictionID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.restrictionID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DeleteRestrictionRequest
 */
export const DeleteRestrictionRequest = new DeleteRestrictionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteRestrictionResponse$Type extends MessageType<DeleteRestrictionResponse> {
    constructor() {
        super("api.DeleteRestrictionResponse", []);
    }
    create(value?: PartialMessage<DeleteRestrictionResponse>): DeleteRestrictionResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteRestrictionResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteRestrictionResponse): DeleteRestrictionResponse {
        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: DeleteRestrictionResponse, 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.DeleteRestrictionResponse
 */
export const DeleteRestrictionResponse = new DeleteRestrictionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EnableRestrictionRequest$Type extends MessageType<EnableRestrictionRequest> {
    constructor() {
        super("api.EnableRestrictionRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "RestrictionID", kind: "scalar", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID"] } } });
    }
    create(value?: PartialMessage<EnableRestrictionRequest>): EnableRestrictionRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictionID = "";
        if (value !== undefined)
            reflectionMergePartial<EnableRestrictionRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnableRestrictionRequest): EnableRestrictionRequest {
        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 RestrictionID = 2 [json_name = "RestrictionID"];*/ 2:
                    message.restrictionID = 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: EnableRestrictionRequest, 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 RestrictionID = 2 [json_name = "RestrictionID"]; */
        if (message.restrictionID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.restrictionID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.EnableRestrictionRequest
 */
export const EnableRestrictionRequest = new EnableRestrictionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class EnableRestrictionResponse$Type extends MessageType<EnableRestrictionResponse> {
    constructor() {
        super("api.EnableRestrictionResponse", [
            { no: 1, name: "Restriction", kind: "message", jsonName: "Restriction", T: () => Restriction }
        ]);
    }
    create(value?: PartialMessage<EnableRestrictionResponse>): EnableRestrictionResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<EnableRestrictionResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnableRestrictionResponse): EnableRestrictionResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Restriction Restriction = 1 [json_name = "Restriction"];*/ 1:
                    message.restriction = Restriction.internalBinaryRead(reader, reader.uint32(), options, message.restriction);
                    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: EnableRestrictionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Restriction Restriction = 1 [json_name = "Restriction"]; */
        if (message.restriction)
            Restriction.internalBinaryWrite(message.restriction, 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.EnableRestrictionResponse
 */
export const EnableRestrictionResponse = new EnableRestrictionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DisableRestrictionRequest$Type extends MessageType<DisableRestrictionRequest> {
    constructor() {
        super("api.DisableRestrictionRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "RestrictionID", kind: "scalar", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID"] } } });
    }
    create(value?: PartialMessage<DisableRestrictionRequest>): DisableRestrictionRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictionID = "";
        if (value !== undefined)
            reflectionMergePartial<DisableRestrictionRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisableRestrictionRequest): DisableRestrictionRequest {
        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 RestrictionID = 2 [json_name = "RestrictionID"];*/ 2:
                    message.restrictionID = 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: DisableRestrictionRequest, 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 RestrictionID = 2 [json_name = "RestrictionID"]; */
        if (message.restrictionID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.restrictionID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DisableRestrictionRequest
 */
export const DisableRestrictionRequest = new DisableRestrictionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DisableRestrictionResponse$Type extends MessageType<DisableRestrictionResponse> {
    constructor() {
        super("api.DisableRestrictionResponse", [
            { no: 1, name: "Restriction", kind: "message", jsonName: "Restriction", T: () => Restriction }
        ]);
    }
    create(value?: PartialMessage<DisableRestrictionResponse>): DisableRestrictionResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DisableRestrictionResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DisableRestrictionResponse): DisableRestrictionResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* api.Restriction Restriction = 1 [json_name = "Restriction"];*/ 1:
                    message.restriction = Restriction.internalBinaryRead(reader, reader.uint32(), options, message.restriction);
                    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: DisableRestrictionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* api.Restriction Restriction = 1 [json_name = "Restriction"]; */
        if (message.restriction)
            Restriction.internalBinaryWrite(message.restriction, 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.DisableRestrictionResponse
 */
export const DisableRestrictionResponse = new DisableRestrictionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteForProjectRestrictionRequest$Type extends MessageType<DeleteForProjectRestrictionRequest> {
    constructor() {
        super("api.DeleteForProjectRestrictionRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } });
    }
    create(value?: PartialMessage<DeleteForProjectRestrictionRequest>): DeleteForProjectRestrictionRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteForProjectRestrictionRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteForProjectRestrictionRequest): DeleteForProjectRestrictionRequest {
        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;
                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: DeleteForProjectRestrictionRequest, 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();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.DeleteForProjectRestrictionRequest
 */
export const DeleteForProjectRestrictionRequest = new DeleteForProjectRestrictionRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class DeleteForProjectRestrictionResponse$Type extends MessageType<DeleteForProjectRestrictionResponse> {
    constructor() {
        super("api.DeleteForProjectRestrictionResponse", []);
    }
    create(value?: PartialMessage<DeleteForProjectRestrictionResponse>): DeleteForProjectRestrictionResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<DeleteForProjectRestrictionResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DeleteForProjectRestrictionResponse): DeleteForProjectRestrictionResponse {
        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: DeleteForProjectRestrictionResponse, 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.DeleteForProjectRestrictionResponse
 */
export const DeleteForProjectRestrictionResponse = new DeleteForProjectRestrictionResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRulesJSONTreeRequest$Type extends MessageType<GetRulesJSONTreeRequest> {
    constructor() {
        super("api.GetRulesJSONTreeRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "RestrictionID", kind: "scalar", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID"] } } });
    }
    create(value?: PartialMessage<GetRulesJSONTreeRequest>): GetRulesJSONTreeRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictionID = "";
        if (value !== undefined)
            reflectionMergePartial<GetRulesJSONTreeRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRulesJSONTreeRequest): GetRulesJSONTreeRequest {
        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 RestrictionID = 2 [json_name = "RestrictionID"];*/ 2:
                    message.restrictionID = 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: GetRulesJSONTreeRequest, 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 RestrictionID = 2 [json_name = "RestrictionID"]; */
        if (message.restrictionID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.restrictionID);
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.GetRulesJSONTreeRequest
 */
export const GetRulesJSONTreeRequest = new GetRulesJSONTreeRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRulesJSONTreeResponse$Type extends MessageType<GetRulesJSONTreeResponse> {
    constructor() {
        super("api.GetRulesJSONTreeResponse", [
            { no: 1, name: "JSONTree", kind: "scalar", jsonName: "JSONTree", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<GetRulesJSONTreeResponse>): GetRulesJSONTreeResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.jSONTree = "";
        if (value !== undefined)
            reflectionMergePartial<GetRulesJSONTreeResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRulesJSONTreeResponse): GetRulesJSONTreeResponse {
        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: GetRulesJSONTreeResponse, 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.GetRulesJSONTreeResponse
 */
export const GetRulesJSONTreeResponse = new GetRulesJSONTreeResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRuleJSONTreeRequest$Type extends MessageType<GetRuleJSONTreeRequest> {
    constructor() {
        super("api.GetRuleJSONTreeRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "RestrictionID", kind: "scalar", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 3, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 4, name: "Entity", kind: "enum", jsonName: "Entity", T: () => ["api.EntityType", EntityType, "ENTITY_TYPE_"], options: { "validate.rules": { enum: { definedOnly: true } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID", "Name", "Entity"] } } });
    }
    create(value?: PartialMessage<GetRuleJSONTreeRequest>): GetRuleJSONTreeRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.restrictionID = "";
        message.name = "";
        message.entity = 0;
        if (value !== undefined)
            reflectionMergePartial<GetRuleJSONTreeRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRuleJSONTreeRequest): GetRuleJSONTreeRequest {
        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 RestrictionID = 2 [json_name = "RestrictionID"];*/ 2:
                    message.restrictionID = reader.string();
                    break;
                case /* string Name = 3 [json_name = "Name"];*/ 3:
                    message.name = 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: GetRuleJSONTreeRequest, 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 RestrictionID = 2 [json_name = "RestrictionID"]; */
        if (message.restrictionID !== "")
            writer.tag(2, WireType.LengthDelimited).string(message.restrictionID);
        /* string Name = 3 [json_name = "Name"]; */
        if (message.name !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.name);
        /* 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.GetRuleJSONTreeRequest
 */
export const GetRuleJSONTreeRequest = new GetRuleJSONTreeRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class GetRuleJSONTreeResponse$Type extends MessageType<GetRuleJSONTreeResponse> {
    constructor() {
        super("api.GetRuleJSONTreeResponse", [
            { no: 1, name: "JSONTree", kind: "scalar", jsonName: "JSONTree", T: 9 /*ScalarType.STRING*/ }
        ]);
    }
    create(value?: PartialMessage<GetRuleJSONTreeResponse>): GetRuleJSONTreeResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.jSONTree = "";
        if (value !== undefined)
            reflectionMergePartial<GetRuleJSONTreeResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetRuleJSONTreeResponse): GetRuleJSONTreeResponse {
        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: GetRuleJSONTreeResponse, 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.GetRuleJSONTreeResponse
 */
export const GetRuleJSONTreeResponse = new GetRuleJSONTreeResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ComputeRuleRequest$Type extends MessageType<ComputeRuleRequest> {
    constructor() {
        super("api.ComputeRuleRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "Entity", kind: "enum", jsonName: "Entity", T: () => ["api.EntityType", EntityType, "ENTITY_TYPE_"], options: { "validate.rules": { enum: { definedOnly: true } } } },
            { no: 3, name: "UserID", kind: "scalar", jsonName: "UserID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } },
            { no: 4, name: "OutputFormats", kind: "enum", jsonName: "OutputFormats", repeat: 1 /*RepeatType.PACKED*/, T: () => ["api.RuleComputeFormat", RuleComputeFormat, "RULE_COMPUTE_FORMAT_"], options: { "validate.rules": { repeated: { minItems: "1" } } } }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Entity", "UserID", "OutputFormats"] } } });
    }
    create(value?: PartialMessage<ComputeRuleRequest>): ComputeRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.entity = 0;
        message.userID = "";
        message.outputFormats = [];
        if (value !== undefined)
            reflectionMergePartial<ComputeRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ComputeRuleRequest): ComputeRuleRequest {
        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.EntityType Entity = 2 [json_name = "Entity"];*/ 2:
                    message.entity = reader.int32();
                    break;
                case /* string UserID = 3 [json_name = "UserID"];*/ 3:
                    message.userID = reader.string();
                    break;
                case /* repeated api.RuleComputeFormat OutputFormats = 4 [json_name = "OutputFormats"];*/ 4:
                    if (wireType === WireType.LengthDelimited)
                        for (let e = reader.int32() + reader.pos; reader.pos < e;)
                            message.outputFormats.push(reader.int32());
                    else
                        message.outputFormats.push(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: ComputeRuleRequest, 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.EntityType Entity = 2 [json_name = "Entity"]; */
        if (message.entity !== 0)
            writer.tag(2, WireType.Varint).int32(message.entity);
        /* string UserID = 3 [json_name = "UserID"]; */
        if (message.userID !== "")
            writer.tag(3, WireType.LengthDelimited).string(message.userID);
        /* repeated api.RuleComputeFormat OutputFormats = 4 [json_name = "OutputFormats"]; */
        if (message.outputFormats.length) {
            writer.tag(4, WireType.LengthDelimited).fork();
            for (let i = 0; i < message.outputFormats.length; i++)
                writer.int32(message.outputFormats[i]);
            writer.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.ComputeRuleRequest
 */
export const ComputeRuleRequest = new ComputeRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ComputeRuleResponse$Type extends MessageType<ComputeRuleResponse> {
    constructor() {
        super("api.ComputeRuleResponse", [
            { no: 1, name: "Results", kind: "message", jsonName: "Results", repeat: 1 /*RepeatType.PACKED*/, T: () => RuleComputeResult }
        ]);
    }
    create(value?: PartialMessage<ComputeRuleResponse>): ComputeRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        message.results = [];
        if (value !== undefined)
            reflectionMergePartial<ComputeRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ComputeRuleResponse): ComputeRuleResponse {
        let message = target ?? this.create(), end = reader.pos + length;
        while (reader.pos < end) {
            let [fieldNo, wireType] = reader.tag();
            switch (fieldNo) {
                case /* repeated api.RuleComputeResult Results = 1 [json_name = "Results"];*/ 1:
                    message.results.push(RuleComputeResult.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: ComputeRuleResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
        /* repeated api.RuleComputeResult Results = 1 [json_name = "Results"]; */
        for (let i = 0; i < message.results.length; i++)
            RuleComputeResult.internalBinaryWrite(message.results[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.ComputeRuleResponse
 */
export const ComputeRuleResponse = new ComputeRuleResponse$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ValidateRestrictionRuleRequest$Type extends MessageType<ValidateRestrictionRuleRequest> {
    constructor() {
        super("api.ValidateRestrictionRuleRequest", [
            { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } },
            { no: 2, name: "Rule", kind: "message", jsonName: "Rule", T: () => RestrictionRule }
        ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Rule"] } } });
    }
    create(value?: PartialMessage<ValidateRestrictionRuleRequest>): ValidateRestrictionRuleRequest {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<ValidateRestrictionRuleRequest>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ValidateRestrictionRuleRequest): ValidateRestrictionRuleRequest {
        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.RestrictionRule Rule = 2 [json_name = "Rule"];*/ 2:
                    message.rule = RestrictionRule.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: ValidateRestrictionRuleRequest, 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.RestrictionRule Rule = 2 [json_name = "Rule"]; */
        if (message.rule)
            RestrictionRule.internalBinaryWrite(message.rule, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
        let u = options.writeUnknownFields;
        if (u !== false)
            (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
        return writer;
    }
}
/**
 * @generated MessageType for protobuf message api.ValidateRestrictionRuleRequest
 */
export const ValidateRestrictionRuleRequest = new ValidateRestrictionRuleRequest$Type();
// @generated message type with reflection information, may provide speed optimized methods
class ValidateRestrictionRuleResponse$Type extends MessageType<ValidateRestrictionRuleResponse> {
    constructor() {
        super("api.ValidateRestrictionRuleResponse", []);
    }
    create(value?: PartialMessage<ValidateRestrictionRuleResponse>): ValidateRestrictionRuleResponse {
        const message = globalThis.Object.create((this.messagePrototype!));
        if (value !== undefined)
            reflectionMergePartial<ValidateRestrictionRuleResponse>(this, message, value);
        return message;
    }
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ValidateRestrictionRuleResponse): ValidateRestrictionRuleResponse {
        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: ValidateRestrictionRuleResponse, 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.ValidateRestrictionRuleResponse
 */
export const ValidateRestrictionRuleResponse = new ValidateRestrictionRuleResponse$Type();
/**
 * @generated ServiceType for protobuf service api.RestrictionService
 */
export const RestrictionService = new ServiceType("api.RestrictionService", [
    { name: "Create", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Create a restriction on the project" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule", "google.api.method_visibility": { restriction: "SDK" } }, I: CreateRestrictionRequest, O: CreateRestrictionResponse },
    { name: "Update", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Update a restriction" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: UpdateRestrictionRequest, O: UpdateRestrictionResponse },
    { name: "Get", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Get a restriction" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule", "google.api.method_visibility": { restriction: "SDK" } }, I: GetRestrictionRequest, O: GetRestrictionResponse },
    { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "List rules" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule", "google.api.method_visibility": { restriction: "SDK" } }, I: ListRestrictionsRequest, O: ListRestrictionsResponse },
    { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Delete a restriction" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule", "google.api.method_visibility": { restriction: "SDK" } }, I: DeleteRestrictionRequest, O: DeleteRestrictionResponse },
    { name: "Enable", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Enable a restriction" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: EnableRestrictionRequest, O: EnableRestrictionResponse },
    { name: "Disable", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Disable a restriction" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: DisableRestrictionRequest, O: DisableRestrictionResponse },
    { name: "DeleteForProject", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Delete all restriction for project" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule", "google.api.method_visibility": { restriction: "SDK" } }, I: DeleteForProjectRestrictionRequest, O: DeleteForProjectRestrictionResponse },
    { name: "GetRulesJSONTree", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Get the JSON tree of restriction rules when compiled" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetRulesJSONTreeRequest, O: GetRulesJSONTreeResponse },
    { name: "ValidateRule", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Validate a restriction rule, will return a 400 error if the rule is not a valid restriction rule" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: ValidateRestrictionRuleRequest, O: ValidateRestrictionRuleResponse },
    { name: "GetRuleJSONTree", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Get the JSON tree of a restriction rule when compiled" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "SDK" } }, I: GetRuleJSONTreeRequest, O: GetRuleJSONTreeResponse },
    { name: "Compute", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Restriction"], description: "Compute all the restrictions for a user on a given entity in a project" }, "api.rscType": "Project", "api.roles": "Platform.Project-Rule", "google.api.method_visibility": { restriction: "INTERNAL" } }, I: ComputeRuleRequest, O: ComputeRuleResponse }
], { "api.k8sService": "rule-server" });
