Files
npm-core-sdk/restrictions.ts
2025-10-22 13:47:37 +00:00

2049 lines
102 KiB
TypeScript

// @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 ==========
/**
* @generated from protobuf message api.Restriction
*/
export interface Restriction {
/**
* @generated from protobuf field: string ID = 1
*/
ID: string;
/**
* @generated from protobuf field: string ProjectID = 2
*/
ProjectID: string;
/**
* @generated from protobuf field: api.RestrictionType TargetType = 3
*/
TargetType: RestrictionType;
/**
* @generated from protobuf field: string Name = 4
*/
Name: string;
/**
* @generated from protobuf field: string Description = 5
*/
Description: string;
/**
* @generated from protobuf field: bool Status = 6
*/
Status: boolean;
/**
* @generated from protobuf field: repeated api.Rule Rules = 7
*/
Rules: Rule[];
/**
* @generated from protobuf field: string UpdatedAt = 8
*/
UpdatedAt: string;
/**
* @generated from protobuf field: string CreatedAt = 9
*/
CreatedAt: string;
}
/**
* @generated from protobuf message api.RestrictionComputeResult
*/
export interface RestrictionComputeResult {
/**
* @generated from protobuf field: repeated api.RuleComputeResult Results = 1
*/
Results: RuleComputeResult[];
/**
* @generated from protobuf field: string RestrictionID = 2
*/
RestrictionID: string;
/**
* @generated from protobuf field: string RestrictionName = 3
*/
RestrictionName: string;
}
/**
* @generated from protobuf message api.RuleComputeResult
*/
export interface RuleComputeResult {
/**
* @generated from protobuf field: api.RuleComputeFormat Format = 1
*/
Format: RuleComputeFormat;
/**
* @generated from protobuf field: string Value = 2
*/
Value: string;
}
/**
* @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;
/**
* @generated from protobuf field: string Definition = 4
*/
Definition: string;
}
// ========== 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; // Example: "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 {
}
/**
* @generated from protobuf enum api.RestrictionType
*/
export enum RestrictionType {
/**
* @generated from protobuf enum value: RESTRICTION_TYPE_UNKNOWN = 0;
*/
RESTRICTION_TYPE_UNKNOWN = 0,
/**
* @generated from protobuf enum value: RESTRICTION_TYPE_USER = 1;
*/
RESTRICTION_TYPE_USER = 1,
/**
* @generated from protobuf enum value: RESTRICTION_TYPE_PARTNER = 2;
*/
RESTRICTION_TYPE_PARTNER = 2
}
/**
* @generated from protobuf enum api.RuleComputeFormat
*/
export enum RuleComputeFormat {
/**
* @generated from protobuf enum value: RULE_COMPUTE_FORMAT_UNKNOWN = 0;
*/
RULE_COMPUTE_FORMAT_UNKNOWN = 0,
/**
* @generated from protobuf enum value: RULE_COMPUTE_FORMAT_CH = 1;
*/
RULE_COMPUTE_FORMAT_CH = 1,
/**
* @generated from protobuf enum value: RULE_COMPUTE_FORMAT_OS = 2;
*/
RULE_COMPUTE_FORMAT_OS = 2,
/**
* @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<Restriction> {
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>): 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:
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<RestrictionComputeResult> {
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>): RestrictionComputeResult {
const message = globalThis.Object.create((this.messagePrototype!));
message.Results = [];
message.RestrictionID = "";
message.RestrictionName = "";
if (value !== undefined)
reflectionMergePartial<RestrictionComputeResult>(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<RuleComputeResult> {
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*/ }
]);
}
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:
message.Format = reader.int32();
break;
case /* string 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; */
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);
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", 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" } } } }
], { "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:
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;
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);
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", 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>): 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:
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<CreateRestrictionResponse> {
constructor() {
super("api.CreateRestrictionResponse", [
{ no: 1, name: "Restriction", kind: "message", localName: "Restriction", 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:
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<UpdateRestrictionRequest> {
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>): 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:
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<UpdateRestrictionResponse> {
constructor() {
super("api.UpdateRestrictionResponse", [
{ no: 1, name: "Restriction", kind: "message", localName: "Restriction", 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:
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<GetRestrictionRequest> {
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>): 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:
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<GetRestrictionResponse> {
constructor() {
super("api.GetRestrictionResponse", [
{ no: 1, name: "Restriction", kind: "message", localName: "Restriction", 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:
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<ListRestrictionsRequest> {
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>): 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:
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<ListRestrictionsResponse> {
constructor() {
super("api.ListRestrictionsResponse", [
{ no: 1, name: "Restrictions", kind: "message", localName: "Restrictions", jsonName: "Restrictions", repeat: 2 /*RepeatType.UNPACKED*/, 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:
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<DeleteRestrictionRequest> {
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>): 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:
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<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", 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>): 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:
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<EnableRestrictionResponse> {
constructor() {
super("api.EnableRestrictionResponse", [
{ no: 1, name: "Restriction", kind: "message", localName: "Restriction", 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:
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<DisableRestrictionRequest> {
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>): 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:
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<DisableRestrictionResponse> {
constructor() {
super("api.DisableRestrictionResponse", [
{ no: 1, name: "Restriction", kind: "message", localName: "Restriction", 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:
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<DeleteForProjectRestrictionRequest> {
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>): 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:
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<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", 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>): 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:
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<GetRulesJSONTreeResponse> {
constructor() {
super("api.GetRulesJSONTreeResponse", [
{ no: 1, name: "JSONTree", kind: "scalar", localName: "JSONTree", 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:
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<GetRuleJSONTreeRequest> {
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>): 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:
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<GetRuleJSONTreeResponse> {
constructor() {
super("api.GetRuleJSONTreeResponse", [
{ no: 1, name: "JSONTree", kind: "scalar", localName: "JSONTree", 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:
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<ComputeRuleRequest> {
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>): ComputeRuleRequest {
const message = globalThis.Object.create((this.messagePrototype!));
message.Entity = 0;
message.UserID = "";
message.OutputFormats = [];
message.RewriteFor = "";
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:
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<ComputeRuleResponse> {
constructor() {
super("api.ComputeRuleResponse", [
{ no: 1, name: "Results", kind: "message", localName: "Results", jsonName: "Results", repeat: 2 /*RepeatType.UNPACKED*/, T: () => RestrictionComputeResult }
]);
}
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.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<ValidateRestrictionRuleRequest> {
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>): 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:
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<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" });