// @generated by protobuf-ts 2.11.1 with parameter use_proto_field_name,keep_enum_prefix // @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 ========== /** * Restriction represents a named, project-scoped data-access restriction composed of one or more RPL rules. * * @generated from protobuf message api.Restriction */ export interface Restriction { /** * @generated from protobuf field: string ID = 1 */ ID: string; // Unique identifier of the restriction. /** * @generated from protobuf field: string ProjectID = 2 */ ProjectID: string; // Identifier of the project the restriction belongs to. /** * @generated from protobuf field: api.RestrictionType TargetType = 3 */ TargetType: RestrictionType; // Determines how the restriction is applied (by user or by partner). /** * @generated from protobuf field: string Name = 4 */ Name: string; // Human-readable name of the restriction. /** * @generated from protobuf field: string Description = 5 */ Description: string; // Optional description providing context for the restriction. /** * @generated from protobuf field: bool Status = 6 */ Status: boolean; // Whether the restriction is currently active (true = enabled, false = disabled). /** * @generated from protobuf field: repeated api.Rule Rules = 7 */ Rules: Rule[]; // List of RPL rules that make up this restriction. /** * @generated from protobuf field: string UpdatedAt = 8 */ UpdatedAt: string; // Timestamp of the last update (RFC 3339). /** * @generated from protobuf field: string CreatedAt = 9 */ CreatedAt: string; // Timestamp of creation (RFC 3339). } /** * RestrictionComputeResult holds the computed rule outputs for a single restriction. * * @generated from protobuf message api.RestrictionComputeResult */ export interface RestrictionComputeResult { /** * @generated from protobuf field: repeated api.RuleComputeResult Results = 1 */ Results: RuleComputeResult[]; // Computed results for each rule in the restriction, one entry per output format. /** * @generated from protobuf field: string RestrictionID = 2 */ RestrictionID: string; // Identifier of the restriction these results belong to. /** * @generated from protobuf field: string RestrictionName = 3 */ RestrictionName: string; // Name of the restriction these results belong to. } /** * RuleComputeResult holds the compiled output of a single rule in a given format. * * @generated from protobuf message api.RuleComputeResult */ export interface RuleComputeResult { /** * @generated from protobuf field: api.RuleComputeFormat Format = 1 */ Format: RuleComputeFormat; // Output format the rule was compiled into. /** * @generated from protobuf field: string Value = 2 */ Value: string; // Compiled rule expression in the target format. /** * @generated from protobuf field: string RuleID = 3 */ RuleID: string; // Identifier of the rule this result was computed from. /** * @generated from protobuf field: repeated string Attributes = 4 */ Attributes: string[]; // Key:value pairs used to scope the computation (e.g. "ActorID:" for a restriction rule). } /** * RestrictionRule is the input structure used to define a rule within a restriction, before it is persisted as a full Rule. * * @generated from protobuf message api.RestrictionRule */ export interface RestrictionRule { /** * @generated from protobuf field: string Name = 1 */ Name: string; /** * @generated from protobuf field: api.EntityType Entity = 2 */ Entity: EntityType; /** * @generated from protobuf field: string Description = 3 */ Description: string; // Optional description providing context for the rule. /** * @generated from protobuf field: string Definition = 4 */ Definition: string; /** * @generated from protobuf field: repeated string Attributes = 5 */ Attributes: string[]; // Optional contextual key:value pairs provided by the rule's consumer to scope evaluation. Usually empty. "ActorID:" may be provided to compute the rule against a specific actor's data access context. } // ========== REQUESTS & RESPONSE MESSAGES ========== /** * Create * * @generated from protobuf message api.CreateRestrictionRequest */ export interface CreateRestrictionRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: api.RestrictionType TargetType = 2 */ TargetType: RestrictionType; /** * @generated from protobuf field: string Name = 3 */ Name: string; /** * @generated from protobuf field: string Description = 4 */ Description: string; /** * @generated from protobuf field: repeated api.RestrictionRule Rules = 5 */ Rules: RestrictionRule[]; } /** * @generated from protobuf message api.CreateRestrictionResponse */ export interface CreateRestrictionResponse { /** * @generated from protobuf field: api.Restriction Restriction = 1 */ Restriction?: Restriction; } /** * Update * * @generated from protobuf message api.UpdateRestrictionRequest */ export interface UpdateRestrictionRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: string RestrictionID = 2 */ RestrictionID: string; /** * @generated from protobuf field: string Name = 3 */ Name: string; /** * @generated from protobuf field: string Description = 4 */ Description: string; /** * @generated from protobuf field: repeated api.RestrictionRule Rules = 5 */ Rules: RestrictionRule[]; } /** * @generated from protobuf message api.UpdateRestrictionResponse */ export interface UpdateRestrictionResponse { /** * @generated from protobuf field: api.Restriction Restriction = 1 */ Restriction?: Restriction; } /** * Get * * @generated from protobuf message api.GetRestrictionRequest */ export interface GetRestrictionRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: string RestrictionID = 2 */ RestrictionID: string; } /** * @generated from protobuf message api.GetRestrictionResponse */ export interface GetRestrictionResponse { /** * @generated from protobuf field: api.Restriction Restriction = 1 */ Restriction?: Restriction; } /** * List * * @generated from protobuf message api.ListRestrictionsRequest */ export interface ListRestrictionsRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: api.RestrictionType TargetType = 2 */ TargetType: RestrictionType; } /** * @generated from protobuf message api.ListRestrictionsResponse */ export interface ListRestrictionsResponse { /** * @generated from protobuf field: repeated api.Restriction Restrictions = 1 */ Restrictions: Restriction[]; } /** * Delete * * @generated from protobuf message api.DeleteRestrictionRequest */ export interface DeleteRestrictionRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: string RestrictionID = 2 */ 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 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: string RestrictionID = 2 */ RestrictionID: string; } /** * @generated from protobuf message api.EnableRestrictionResponse */ export interface EnableRestrictionResponse { /** * @generated from protobuf field: api.Restriction Restriction = 1 */ Restriction?: Restriction; } /** * Disable * * @generated from protobuf message api.DisableRestrictionRequest */ export interface DisableRestrictionRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: string RestrictionID = 2 */ RestrictionID: string; } /** * @generated from protobuf message api.DisableRestrictionResponse */ export interface DisableRestrictionResponse { /** * @generated from protobuf field: api.Restriction Restriction = 1 */ Restriction?: Restriction; } /** * DeleteForProject * * @generated from protobuf message api.DeleteForProjectRestrictionRequest */ export interface DeleteForProjectRestrictionRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ 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 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: string RestrictionID = 2 */ RestrictionID: string; } /** * @generated from protobuf message api.GetRulesJSONTreeResponse */ export interface GetRulesJSONTreeResponse { /** * @generated from protobuf field: string JSONTree = 1 */ JSONTree: string; } /** * GetRulesJSONTree * * @generated from protobuf message api.GetRuleJSONTreeRequest */ export interface GetRuleJSONTreeRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: string RestrictionID = 2 */ RestrictionID: string; /** * @generated from protobuf field: string Name = 3 */ Name: string; /** * @generated from protobuf field: api.EntityType Entity = 4 */ Entity: EntityType; } /** * @generated from protobuf message api.GetRuleJSONTreeResponse */ export interface GetRuleJSONTreeResponse { /** * @generated from protobuf field: string JSONTree = 1 */ JSONTree: string; } /** * Compute * * @generated from protobuf message api.ComputeRuleRequest */ export interface ComputeRuleRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: api.EntityType Entity = 2 */ Entity: EntityType; /** * @generated from protobuf field: string UserID = 3 */ UserID: string; /** * @generated from protobuf field: repeated api.RuleComputeFormat OutputFormats = 4 */ OutputFormats: RuleComputeFormat[]; /** * @generated from protobuf field: string RewriteFor = 5 */ RewriteFor: string; // Actor path prefix used to rewrite actor references in the computed output (e.g. "ShipFrom.Actor", "ShipTo.Actor"). } /** * @generated from protobuf message api.ComputeRuleResponse */ export interface ComputeRuleResponse { /** * @generated from protobuf field: repeated api.RestrictionComputeResult Results = 1 */ Results: RestrictionComputeResult[]; } /** * @generated from protobuf message api.ValidateRestrictionRuleRequest */ export interface ValidateRestrictionRuleRequest { /** * @generated from protobuf field: api.RequestProjectHeader Header = 1 */ Header?: RequestProjectHeader; /** * @generated from protobuf field: api.RestrictionRule Rule = 2 */ Rule?: RestrictionRule; } /** * @generated from protobuf message api.ValidateRestrictionRuleResponse */ export interface ValidateRestrictionRuleResponse { } /** * RestrictionType determines the scope of a restriction's application. * * @generated from protobuf enum api.RestrictionType */ export enum RestrictionType { /** * Default unset value. Should not be used explicitly. * * @generated from protobuf enum value: RESTRICTION_TYPE_UNKNOWN = 0; */ RESTRICTION_TYPE_UNKNOWN = 0, /** * Restriction applies to individual users directly. * * @generated from protobuf enum value: RESTRICTION_TYPE_USER = 1; */ RESTRICTION_TYPE_USER = 1, /** * Restriction applies via partner: users whose partner has this restriction will also have it applied to them. * * @generated from protobuf enum value: RESTRICTION_TYPE_PARTNER = 2; */ RESTRICTION_TYPE_PARTNER = 2 } /** * RuleComputeFormat specifies the query language into which a restriction rule is compiled. * * @generated from protobuf enum api.RuleComputeFormat */ export enum RuleComputeFormat { /** * Default unset value. Should not be used explicitly. * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_UNKNOWN = 0; */ RULE_COMPUTE_FORMAT_UNKNOWN = 0, /** * ClickHouse SQL expression. * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_CH = 1; */ RULE_COMPUTE_FORMAT_CH = 1, /** * OpenSearch query expression. * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_OS = 2; */ RULE_COMPUTE_FORMAT_OS = 2, /** * jq filter expression. * * @generated from protobuf enum value: RULE_COMPUTE_FORMAT_JQ = 3; */ RULE_COMPUTE_FORMAT_JQ = 3 } // @generated message type with reflection information, may provide speed optimized methods class Restriction$Type extends MessageType { constructor() { super("api.Restriction", [ { no: 1, name: "ID", kind: "scalar", localName: "ID", jsonName: "ID", T: 9 /*ScalarType.STRING*/ }, { no: 2, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "TargetType", kind: "enum", localName: "TargetType", jsonName: "TargetType", T: () => ["api.RestrictionType", RestrictionType] }, { no: 4, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "Description", kind: "scalar", localName: "Description", jsonName: "Description", T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "Status", kind: "scalar", localName: "Status", jsonName: "Status", T: 8 /*ScalarType.BOOL*/ }, { no: 7, name: "Rules", kind: "message", localName: "Rules", jsonName: "Rules", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Rule }, { no: 8, name: "UpdatedAt", kind: "scalar", localName: "UpdatedAt", jsonName: "UpdatedAt", T: 9 /*ScalarType.STRING*/ }, { no: 9, name: "CreatedAt", kind: "scalar", localName: "CreatedAt", jsonName: "CreatedAt", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): 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(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: message.ID = reader.string(); break; case /* string ProjectID */ 2: message.ProjectID = reader.string(); break; case /* api.RestrictionType TargetType */ 3: message.TargetType = reader.int32(); break; case /* string Name */ 4: message.Name = reader.string(); break; case /* string Description */ 5: message.Description = reader.string(); break; case /* bool Status */ 6: message.Status = reader.bool(); break; case /* repeated api.Rule Rules */ 7: message.Rules.push(Rule.internalBinaryRead(reader, reader.uint32(), options)); break; case /* string UpdatedAt */ 8: message.UpdatedAt = reader.string(); break; case /* string 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; */ if (message.ID !== "") writer.tag(1, WireType.LengthDelimited).string(message.ID); /* string ProjectID = 2; */ if (message.ProjectID !== "") writer.tag(2, WireType.LengthDelimited).string(message.ProjectID); /* api.RestrictionType TargetType = 3; */ if (message.TargetType !== 0) writer.tag(3, WireType.Varint).int32(message.TargetType); /* string Name = 4; */ if (message.Name !== "") writer.tag(4, WireType.LengthDelimited).string(message.Name); /* string Description = 5; */ if (message.Description !== "") writer.tag(5, WireType.LengthDelimited).string(message.Description); /* bool Status = 6; */ if (message.Status !== false) writer.tag(6, WireType.Varint).bool(message.Status); /* repeated api.Rule Rules = 7; */ 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; */ if (message.UpdatedAt !== "") writer.tag(8, WireType.LengthDelimited).string(message.UpdatedAt); /* string CreatedAt = 9; */ 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 RestrictionComputeResult$Type extends MessageType { constructor() { super("api.RestrictionComputeResult", [ { no: 1, name: "Results", kind: "message", localName: "Results", jsonName: "Results", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RuleComputeResult }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "RestrictionName", kind: "scalar", localName: "RestrictionName", jsonName: "RestrictionName", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): RestrictionComputeResult { const message = globalThis.Object.create((this.messagePrototype!)); message.Results = []; message.RestrictionID = ""; message.RestrictionName = ""; if (value !== undefined) reflectionMergePartial(this, message, value); return message; } internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RestrictionComputeResult): RestrictionComputeResult { 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: message.Results.push(RuleComputeResult.internalBinaryRead(reader, reader.uint32(), options)); break; case /* string RestrictionID */ 2: message.RestrictionID = reader.string(); break; case /* string RestrictionName */ 3: message.RestrictionName = 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: RestrictionComputeResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* repeated api.RuleComputeResult Results = 1; */ for (let i = 0; i < message.Results.length; i++) RuleComputeResult.internalBinaryWrite(message.Results[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ if (message.RestrictionID !== "") writer.tag(2, WireType.LengthDelimited).string(message.RestrictionID); /* string RestrictionName = 3; */ if (message.RestrictionName !== "") writer.tag(3, WireType.LengthDelimited).string(message.RestrictionName); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.RestrictionComputeResult */ export const RestrictionComputeResult = new RestrictionComputeResult$Type(); // @generated message type with reflection information, may provide speed optimized methods class RuleComputeResult$Type extends MessageType { constructor() { super("api.RuleComputeResult", [ { no: 1, name: "Format", kind: "enum", localName: "Format", jsonName: "Format", T: () => ["api.RuleComputeFormat", RuleComputeFormat] }, { no: 2, name: "Value", kind: "scalar", localName: "Value", jsonName: "Value", T: 9 /*ScalarType.STRING*/ }, { no: 3, name: "RuleID", kind: "scalar", localName: "RuleID", jsonName: "RuleID", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "Attributes", kind: "scalar", localName: "Attributes", jsonName: "Attributes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): RuleComputeResult { const message = globalThis.Object.create((this.messagePrototype!)); message.Format = 0; message.Value = ""; message.RuleID = ""; message.Attributes = []; if (value !== undefined) reflectionMergePartial(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: message.Format = reader.int32(); break; case /* string Value */ 2: message.Value = reader.string(); break; case /* string RuleID */ 3: message.RuleID = reader.string(); break; case /* repeated string Attributes */ 4: message.Attributes.push(reader.string()); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: RuleComputeResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* api.RuleComputeFormat Format = 1; */ if (message.Format !== 0) writer.tag(1, WireType.Varint).int32(message.Format); /* string Value = 2; */ if (message.Value !== "") writer.tag(2, WireType.LengthDelimited).string(message.Value); /* string RuleID = 3; */ if (message.RuleID !== "") writer.tag(3, WireType.LengthDelimited).string(message.RuleID); /* repeated string Attributes = 4; */ for (let i = 0; i < message.Attributes.length; i++) writer.tag(4, WireType.LengthDelimited).string(message.Attributes[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.RuleComputeResult */ export const RuleComputeResult = new RuleComputeResult$Type(); // @generated message type with reflection information, may provide speed optimized methods class RestrictionRule$Type extends MessageType { constructor() { super("api.RestrictionRule", [ { no: 1, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 2, name: "Entity", kind: "enum", localName: "Entity", jsonName: "Entity", T: () => ["api.EntityType", EntityType], options: { "validate.rules": { enum: { definedOnly: true } } } }, { no: 3, name: "Description", kind: "scalar", localName: "Description", jsonName: "Description", T: 9 /*ScalarType.STRING*/ }, { no: 4, name: "Definition", kind: "scalar", localName: "Definition", jsonName: "Definition", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 5, name: "Attributes", kind: "scalar", localName: "Attributes", jsonName: "Attributes", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Name", "Entity", "Definition"] } } }); } create(value?: PartialMessage): RestrictionRule { const message = globalThis.Object.create((this.messagePrototype!)); message.Name = ""; message.Entity = 0; message.Description = ""; message.Definition = ""; message.Attributes = []; if (value !== undefined) reflectionMergePartial(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: message.Name = reader.string(); break; case /* api.EntityType Entity */ 2: message.Entity = reader.int32(); break; case /* string Description */ 3: message.Description = reader.string(); break; case /* string Definition */ 4: message.Definition = reader.string(); break; case /* repeated string Attributes */ 5: message.Attributes.push(reader.string()); break; default: let u = options.readUnknownField; if (u === "throw") throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); let d = reader.skip(wireType); if (u !== false) (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } } return message; } internalBinaryWrite(message: RestrictionRule, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* string Name = 1; */ if (message.Name !== "") writer.tag(1, WireType.LengthDelimited).string(message.Name); /* api.EntityType Entity = 2; */ if (message.Entity !== 0) writer.tag(2, WireType.Varint).int32(message.Entity); /* string Description = 3; */ if (message.Description !== "") writer.tag(3, WireType.LengthDelimited).string(message.Description); /* string Definition = 4; */ if (message.Definition !== "") writer.tag(4, WireType.LengthDelimited).string(message.Definition); /* repeated string Attributes = 5; */ for (let i = 0; i < message.Attributes.length; i++) writer.tag(5, WireType.LengthDelimited).string(message.Attributes[i]); let u = options.writeUnknownFields; if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } } /** * @generated MessageType for protobuf message api.RestrictionRule */ export const RestrictionRule = new RestrictionRule$Type(); // @generated message type with reflection information, may provide speed optimized methods class CreateRestrictionRequest$Type extends MessageType { constructor() { super("api.CreateRestrictionRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "TargetType", kind: "enum", localName: "TargetType", jsonName: "TargetType", T: () => ["api.RestrictionType", RestrictionType], options: { "validate.rules": { enum: { definedOnly: true } } } }, { no: 3, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 4, name: "Description", kind: "scalar", localName: "Description", jsonName: "Description", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "Rules", kind: "message", localName: "Rules", jsonName: "Rules", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RestrictionRule } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "TargetType", "Name"] } } }); } create(value?: PartialMessage): CreateRestrictionRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.TargetType = 0; message.Name = ""; message.Description = ""; message.Rules = []; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* api.RestrictionType TargetType */ 2: message.TargetType = reader.int32(); break; case /* string Name */ 3: message.Name = reader.string(); break; case /* string Description */ 4: message.Description = reader.string(); break; case /* repeated api.RestrictionRule 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* api.RestrictionType TargetType = 2; */ if (message.TargetType !== 0) writer.tag(2, WireType.Varint).int32(message.TargetType); /* string Name = 3; */ if (message.Name !== "") writer.tag(3, WireType.LengthDelimited).string(message.Name); /* string Description = 4; */ if (message.Description !== "") writer.tag(4, WireType.LengthDelimited).string(message.Description); /* repeated api.RestrictionRule Rules = 5; */ 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 { constructor() { super("api.CreateRestrictionResponse", [ { no: 1, name: "Restriction", kind: "message", localName: "Restriction", jsonName: "Restriction", T: () => Restriction } ]); } create(value?: PartialMessage): CreateRestrictionResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.UpdateRestrictionRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 3, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 4, name: "Description", kind: "scalar", localName: "Description", jsonName: "Description", T: 9 /*ScalarType.STRING*/ }, { no: 5, name: "Rules", kind: "message", localName: "Rules", jsonName: "Rules", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RestrictionRule } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID", "Name"] } } }); } create(value?: PartialMessage): UpdateRestrictionRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.RestrictionID = ""; message.Name = ""; message.Description = ""; message.Rules = []; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* string RestrictionID */ 2: message.RestrictionID = reader.string(); break; case /* string Name */ 3: message.Name = reader.string(); break; case /* string Description */ 4: message.Description = reader.string(); break; case /* repeated api.RestrictionRule 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ if (message.RestrictionID !== "") writer.tag(2, WireType.LengthDelimited).string(message.RestrictionID); /* string Name = 3; */ if (message.Name !== "") writer.tag(3, WireType.LengthDelimited).string(message.Name); /* string Description = 4; */ if (message.Description !== "") writer.tag(4, WireType.LengthDelimited).string(message.Description); /* repeated api.RestrictionRule Rules = 5; */ 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 { constructor() { super("api.UpdateRestrictionResponse", [ { no: 1, name: "Restriction", kind: "message", localName: "Restriction", jsonName: "Restriction", T: () => Restriction } ]); } create(value?: PartialMessage): UpdateRestrictionResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.GetRestrictionRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", 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 { const message = globalThis.Object.create((this.messagePrototype!)); message.RestrictionID = ""; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* string 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ 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 { constructor() { super("api.GetRestrictionResponse", [ { no: 1, name: "Restriction", kind: "message", localName: "Restriction", jsonName: "Restriction", T: () => Restriction } ]); } create(value?: PartialMessage): GetRestrictionResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.ListRestrictionsRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "TargetType", kind: "enum", localName: "TargetType", jsonName: "TargetType", T: () => ["api.RestrictionType", RestrictionType] } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header"] } } }); } create(value?: PartialMessage): ListRestrictionsRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.TargetType = 0; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* api.RestrictionType 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* api.RestrictionType TargetType = 2; */ 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 { constructor() { super("api.ListRestrictionsResponse", [ { no: 1, name: "Restrictions", kind: "message", localName: "Restrictions", jsonName: "Restrictions", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Restriction } ]); } create(value?: PartialMessage): ListRestrictionsResponse { const message = globalThis.Object.create((this.messagePrototype!)); message.Restrictions = []; if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.DeleteRestrictionRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", 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 { const message = globalThis.Object.create((this.messagePrototype!)); message.RestrictionID = ""; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* string 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ 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 { constructor() { super("api.DeleteRestrictionResponse", []); } create(value?: PartialMessage): DeleteRestrictionResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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 { constructor() { super("api.EnableRestrictionRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", 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 { const message = globalThis.Object.create((this.messagePrototype!)); message.RestrictionID = ""; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* string 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ 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 { constructor() { super("api.EnableRestrictionResponse", [ { no: 1, name: "Restriction", kind: "message", localName: "Restriction", jsonName: "Restriction", T: () => Restriction } ]); } create(value?: PartialMessage): EnableRestrictionResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.DisableRestrictionRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", 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 { const message = globalThis.Object.create((this.messagePrototype!)); message.RestrictionID = ""; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* string 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ 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 { constructor() { super("api.DisableRestrictionResponse", [ { no: 1, name: "Restriction", kind: "message", localName: "Restriction", jsonName: "Restriction", T: () => Restriction } ]); } create(value?: PartialMessage): DisableRestrictionResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.DeleteForProjectRestrictionRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", 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 { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.DeleteForProjectRestrictionResponse", []); } create(value?: PartialMessage): DeleteForProjectRestrictionResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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 { constructor() { super("api.GetRulesJSONTreeRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", 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 { const message = globalThis.Object.create((this.messagePrototype!)); message.RestrictionID = ""; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* string 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ 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 { constructor() { super("api.GetRulesJSONTreeResponse", [ { no: 1, name: "JSONTree", kind: "scalar", localName: "JSONTree", jsonName: "JSONTree", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): GetRulesJSONTreeResponse { const message = globalThis.Object.create((this.messagePrototype!)); message.JSONTree = ""; if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.GetRuleJSONTreeRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "RestrictionID", kind: "scalar", localName: "RestrictionID", jsonName: "RestrictionID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 3, name: "Name", kind: "scalar", localName: "Name", jsonName: "Name", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 4, name: "Entity", kind: "enum", localName: "Entity", jsonName: "Entity", T: () => ["api.EntityType", EntityType], options: { "validate.rules": { enum: { definedOnly: true } } } } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "RestrictionID", "Name", "Entity"] } } }); } create(value?: PartialMessage): GetRuleJSONTreeRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.RestrictionID = ""; message.Name = ""; message.Entity = 0; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* string RestrictionID */ 2: message.RestrictionID = reader.string(); break; case /* string Name */ 3: message.Name = reader.string(); break; case /* api.EntityType 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* string RestrictionID = 2; */ if (message.RestrictionID !== "") writer.tag(2, WireType.LengthDelimited).string(message.RestrictionID); /* string Name = 3; */ if (message.Name !== "") writer.tag(3, WireType.LengthDelimited).string(message.Name); /* api.EntityType Entity = 4; */ 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 { constructor() { super("api.GetRuleJSONTreeResponse", [ { no: 1, name: "JSONTree", kind: "scalar", localName: "JSONTree", jsonName: "JSONTree", T: 9 /*ScalarType.STRING*/ } ]); } create(value?: PartialMessage): GetRuleJSONTreeResponse { const message = globalThis.Object.create((this.messagePrototype!)); message.JSONTree = ""; if (value !== undefined) reflectionMergePartial(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: 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; */ 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 { constructor() { super("api.ComputeRuleRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "Entity", kind: "enum", localName: "Entity", jsonName: "Entity", T: () => ["api.EntityType", EntityType], options: { "validate.rules": { enum: { definedOnly: true } } } }, { no: 3, name: "UserID", kind: "scalar", localName: "UserID", jsonName: "UserID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, { no: 4, name: "OutputFormats", kind: "enum", localName: "OutputFormats", jsonName: "OutputFormats", repeat: 1 /*RepeatType.PACKED*/, T: () => ["api.RuleComputeFormat", RuleComputeFormat], options: { "validate.rules": { repeated: { minItems: "1" } } } }, { no: 5, name: "RewriteFor", kind: "scalar", localName: "RewriteFor", jsonName: "RewriteFor", T: 9 /*ScalarType.STRING*/ } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Entity", "UserID", "OutputFormats"] } } }); } create(value?: PartialMessage): ComputeRuleRequest { const message = globalThis.Object.create((this.messagePrototype!)); message.Entity = 0; message.UserID = ""; message.OutputFormats = []; message.RewriteFor = ""; if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* api.EntityType Entity */ 2: message.Entity = reader.int32(); break; case /* string UserID */ 3: message.UserID = reader.string(); break; case /* repeated api.RuleComputeFormat 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; case /* string RewriteFor */ 5: message.RewriteFor = 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: ComputeRuleRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { /* api.RequestProjectHeader Header = 1; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* api.EntityType Entity = 2; */ if (message.Entity !== 0) writer.tag(2, WireType.Varint).int32(message.Entity); /* string UserID = 3; */ if (message.UserID !== "") writer.tag(3, WireType.LengthDelimited).string(message.UserID); /* repeated api.RuleComputeFormat OutputFormats = 4; */ 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(); } /* string RewriteFor = 5; */ if (message.RewriteFor !== "") writer.tag(5, WireType.LengthDelimited).string(message.RewriteFor); 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 { constructor() { super("api.ComputeRuleResponse", [ { no: 1, name: "Results", kind: "message", localName: "Results", jsonName: "Results", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RestrictionComputeResult } ]); } create(value?: PartialMessage): ComputeRuleResponse { const message = globalThis.Object.create((this.messagePrototype!)); message.Results = []; if (value !== undefined) reflectionMergePartial(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.RestrictionComputeResult Results */ 1: message.Results.push(RestrictionComputeResult.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.RestrictionComputeResult Results = 1; */ for (let i = 0; i < message.Results.length; i++) RestrictionComputeResult.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 { constructor() { super("api.ValidateRestrictionRuleRequest", [ { no: 1, name: "Header", kind: "message", localName: "Header", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, { no: 2, name: "Rule", kind: "message", localName: "Rule", jsonName: "Rule", T: () => RestrictionRule } ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Rule"] } } }); } create(value?: PartialMessage): ValidateRestrictionRuleRequest { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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: message.Header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.Header); break; case /* api.RestrictionRule 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; */ if (message.Header) RequestProjectHeader.internalBinaryWrite(message.Header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); /* api.RestrictionRule Rule = 2; */ 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 { constructor() { super("api.ValidateRestrictionRuleResponse", []); } create(value?: PartialMessage): ValidateRestrictionRuleResponse { const message = globalThis.Object.create((this.messagePrototype!)); if (value !== undefined) reflectionMergePartial(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" });