From 168307d4175c178481b3a6d668b99c8f28742a51 Mon Sep 17 00:00:00 2001 From: Tolga Ozen Date: Tue, 11 Nov 2025 13:59:32 +0300 Subject: [PATCH] feat(grpc): add generated files for base and google API services --- src/grpc/generated/base/v1/base.ts | 5758 +++ src/grpc/generated/base/v1/errors.ts | 566 + src/grpc/generated/base/v1/openapi.ts | 9 + src/grpc/generated/base/v1/service.ts | 35031 ++++++++++++++++ src/grpc/generated/google/api/annotations.ts | 9 + .../google/api/expr/v1alpha1/checked.ts | 1950 + .../google/api/expr/v1alpha1/syntax.ts | 2539 ++ src/grpc/generated/google/api/http.ts | 792 + src/grpc/generated/google/protobuf/any.ts | 240 + .../generated/google/protobuf/descriptor.ts | 6600 +++ .../generated/google/protobuf/duration.ts | 189 + src/grpc/generated/google/protobuf/empty.ts | 84 + src/grpc/generated/google/protobuf/struct.ts | 615 + .../generated/google/protobuf/timestamp.ts | 218 + .../options/annotations.ts | 9 + .../protoc-gen-openapiv2/options/openapiv2.ts | 5606 +++ src/grpc/generated/validate/validate.ts | 6048 +++ 17 files changed, 66263 insertions(+) create mode 100644 src/grpc/generated/base/v1/base.ts create mode 100644 src/grpc/generated/base/v1/errors.ts create mode 100644 src/grpc/generated/base/v1/openapi.ts create mode 100644 src/grpc/generated/base/v1/service.ts create mode 100644 src/grpc/generated/google/api/annotations.ts create mode 100644 src/grpc/generated/google/api/expr/v1alpha1/checked.ts create mode 100644 src/grpc/generated/google/api/expr/v1alpha1/syntax.ts create mode 100644 src/grpc/generated/google/api/http.ts create mode 100644 src/grpc/generated/google/protobuf/any.ts create mode 100644 src/grpc/generated/google/protobuf/descriptor.ts create mode 100644 src/grpc/generated/google/protobuf/duration.ts create mode 100644 src/grpc/generated/google/protobuf/empty.ts create mode 100644 src/grpc/generated/google/protobuf/struct.ts create mode 100644 src/grpc/generated/google/protobuf/timestamp.ts create mode 100644 src/grpc/generated/protoc-gen-openapiv2/options/annotations.ts create mode 100644 src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts create mode 100644 src/grpc/generated/validate/validate.ts diff --git a/src/grpc/generated/base/v1/base.ts b/src/grpc/generated/base/v1/base.ts new file mode 100644 index 0000000..1fed2c3 --- /dev/null +++ b/src/grpc/generated/base/v1/base.ts @@ -0,0 +1,5758 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: base/v1/base.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; +import { CheckedExpr } from "../../google/api/expr/v1alpha1/checked"; +import { Any } from "../../google/protobuf/any"; +import { Struct } from "../../google/protobuf/struct"; +import { Timestamp } from "../../google/protobuf/timestamp"; + +export const protobufPackage = "base.v1"; + +/** Enumerates results of a check operation. */ +export enum CheckResult { + /** CHECK_RESULT_UNSPECIFIED - Not specified check result. This is the default value. */ + CHECK_RESULT_UNSPECIFIED = 0, + /** CHECK_RESULT_ALLOWED - Represents a successful check (the check allowed the operation). */ + CHECK_RESULT_ALLOWED = 1, + /** CHECK_RESULT_DENIED - Represents a failed check (the check denied the operation). */ + CHECK_RESULT_DENIED = 2, + UNRECOGNIZED = -1, +} + +export function checkResultFromJSON(object: any): CheckResult { + switch (object) { + case 0: + case "CHECK_RESULT_UNSPECIFIED": + return CheckResult.CHECK_RESULT_UNSPECIFIED; + case 1: + case "CHECK_RESULT_ALLOWED": + return CheckResult.CHECK_RESULT_ALLOWED; + case 2: + case "CHECK_RESULT_DENIED": + return CheckResult.CHECK_RESULT_DENIED; + case -1: + case "UNRECOGNIZED": + default: + return CheckResult.UNRECOGNIZED; + } +} + +export function checkResultToJSON(object: CheckResult): string { + switch (object) { + case CheckResult.CHECK_RESULT_UNSPECIFIED: + return "CHECK_RESULT_UNSPECIFIED"; + case CheckResult.CHECK_RESULT_ALLOWED: + return "CHECK_RESULT_ALLOWED"; + case CheckResult.CHECK_RESULT_DENIED: + return "CHECK_RESULT_DENIED"; + case CheckResult.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Enumerates the types of attribute. */ +export enum AttributeType { + /** ATTRIBUTE_TYPE_UNSPECIFIED - Not specified attribute type. This is the default value. */ + ATTRIBUTE_TYPE_UNSPECIFIED = 0, + /** ATTRIBUTE_TYPE_BOOLEAN - A boolean attribute type. */ + ATTRIBUTE_TYPE_BOOLEAN = 1, + /** ATTRIBUTE_TYPE_BOOLEAN_ARRAY - A boolean array attribute type. */ + ATTRIBUTE_TYPE_BOOLEAN_ARRAY = 2, + /** ATTRIBUTE_TYPE_STRING - A string attribute type. */ + ATTRIBUTE_TYPE_STRING = 3, + /** ATTRIBUTE_TYPE_STRING_ARRAY - A string array attribute type. */ + ATTRIBUTE_TYPE_STRING_ARRAY = 4, + /** ATTRIBUTE_TYPE_INTEGER - An integer attribute type. */ + ATTRIBUTE_TYPE_INTEGER = 5, + /** ATTRIBUTE_TYPE_INTEGER_ARRAY - An integer array attribute type. */ + ATTRIBUTE_TYPE_INTEGER_ARRAY = 6, + /** ATTRIBUTE_TYPE_DOUBLE - A double attribute type. */ + ATTRIBUTE_TYPE_DOUBLE = 7, + /** ATTRIBUTE_TYPE_DOUBLE_ARRAY - A double array attribute type. */ + ATTRIBUTE_TYPE_DOUBLE_ARRAY = 8, + UNRECOGNIZED = -1, +} + +export function attributeTypeFromJSON(object: any): AttributeType { + switch (object) { + case 0: + case "ATTRIBUTE_TYPE_UNSPECIFIED": + return AttributeType.ATTRIBUTE_TYPE_UNSPECIFIED; + case 1: + case "ATTRIBUTE_TYPE_BOOLEAN": + return AttributeType.ATTRIBUTE_TYPE_BOOLEAN; + case 2: + case "ATTRIBUTE_TYPE_BOOLEAN_ARRAY": + return AttributeType.ATTRIBUTE_TYPE_BOOLEAN_ARRAY; + case 3: + case "ATTRIBUTE_TYPE_STRING": + return AttributeType.ATTRIBUTE_TYPE_STRING; + case 4: + case "ATTRIBUTE_TYPE_STRING_ARRAY": + return AttributeType.ATTRIBUTE_TYPE_STRING_ARRAY; + case 5: + case "ATTRIBUTE_TYPE_INTEGER": + return AttributeType.ATTRIBUTE_TYPE_INTEGER; + case 6: + case "ATTRIBUTE_TYPE_INTEGER_ARRAY": + return AttributeType.ATTRIBUTE_TYPE_INTEGER_ARRAY; + case 7: + case "ATTRIBUTE_TYPE_DOUBLE": + return AttributeType.ATTRIBUTE_TYPE_DOUBLE; + case 8: + case "ATTRIBUTE_TYPE_DOUBLE_ARRAY": + return AttributeType.ATTRIBUTE_TYPE_DOUBLE_ARRAY; + case -1: + case "UNRECOGNIZED": + default: + return AttributeType.UNRECOGNIZED; + } +} + +export function attributeTypeToJSON(object: AttributeType): string { + switch (object) { + case AttributeType.ATTRIBUTE_TYPE_UNSPECIFIED: + return "ATTRIBUTE_TYPE_UNSPECIFIED"; + case AttributeType.ATTRIBUTE_TYPE_BOOLEAN: + return "ATTRIBUTE_TYPE_BOOLEAN"; + case AttributeType.ATTRIBUTE_TYPE_BOOLEAN_ARRAY: + return "ATTRIBUTE_TYPE_BOOLEAN_ARRAY"; + case AttributeType.ATTRIBUTE_TYPE_STRING: + return "ATTRIBUTE_TYPE_STRING"; + case AttributeType.ATTRIBUTE_TYPE_STRING_ARRAY: + return "ATTRIBUTE_TYPE_STRING_ARRAY"; + case AttributeType.ATTRIBUTE_TYPE_INTEGER: + return "ATTRIBUTE_TYPE_INTEGER"; + case AttributeType.ATTRIBUTE_TYPE_INTEGER_ARRAY: + return "ATTRIBUTE_TYPE_INTEGER_ARRAY"; + case AttributeType.ATTRIBUTE_TYPE_DOUBLE: + return "ATTRIBUTE_TYPE_DOUBLE"; + case AttributeType.ATTRIBUTE_TYPE_DOUBLE_ARRAY: + return "ATTRIBUTE_TYPE_DOUBLE_ARRAY"; + case AttributeType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * Context encapsulates the information related to a single operation, + * including the tuples involved and the associated attributes. + */ +export interface Context { + /** A repeated field of tuples involved in the operation. */ + tuples: Tuple[]; + /** A repeated field of attributes associated with the operation. */ + attributes: Attribute[]; + /** Additional data associated with the context. */ + data: { [key: string]: any } | undefined; +} + +/** Child represents a node in the permission tree. */ +export interface Child { + /** Child node can be either a leaf or a rewrite operation. */ + type?: + | // + /** Leaf node in the permission tree. */ + { $case: "leaf"; leaf: Leaf } + | // + /** Rewrite operation in the permission tree. */ + { $case: "rewrite"; rewrite: Rewrite } + | undefined; +} + +/** Leaf represents a leaf node in the permission tree. */ +export interface Leaf { + /** Leaf node can be one of several types. */ + type?: + | // + /** A computed set of users. */ + { $case: "computedUserSet"; computedUserSet: ComputedUserSet } + | // + /** A tuple to user set conversion. */ + { $case: "tupleToUserSet"; tupleToUserSet: TupleToUserSet } + | // + /** A computed attribute. */ + { $case: "computedAttribute"; computedAttribute: ComputedAttribute } + | // + /** A call to a function or method. */ + { $case: "call"; call: Call } + | undefined; +} + +/** + * The Rewrite message represents a specific rewrite operation. + * This operation could be one of the following: union, intersection, or exclusion. + */ +export interface Rewrite { + /** The type of rewrite operation to be performed. */ + rewriteOperation: Rewrite_Operation; + /** A list of children that are operated upon by the rewrite operation. */ + children: Child[]; +} + +/** + * Operation enum includes potential rewrite operations. + * OPERATION_UNION: Represents a union operation. + * OPERATION_INTERSECTION: Represents an intersection operation. + * OPERATION_EXCLUSION: Represents an exclusion operation. + */ +export enum Rewrite_Operation { + /** OPERATION_UNSPECIFIED - Default, unspecified operation. */ + OPERATION_UNSPECIFIED = 0, + /** OPERATION_UNION - Represents a union operation. */ + OPERATION_UNION = 1, + /** OPERATION_INTERSECTION - Represents an intersection operation. */ + OPERATION_INTERSECTION = 2, + /** OPERATION_EXCLUSION - Represents an exclusion operation. */ + OPERATION_EXCLUSION = 3, + UNRECOGNIZED = -1, +} + +export function rewrite_OperationFromJSON(object: any): Rewrite_Operation { + switch (object) { + case 0: + case "OPERATION_UNSPECIFIED": + return Rewrite_Operation.OPERATION_UNSPECIFIED; + case 1: + case "OPERATION_UNION": + return Rewrite_Operation.OPERATION_UNION; + case 2: + case "OPERATION_INTERSECTION": + return Rewrite_Operation.OPERATION_INTERSECTION; + case 3: + case "OPERATION_EXCLUSION": + return Rewrite_Operation.OPERATION_EXCLUSION; + case -1: + case "UNRECOGNIZED": + default: + return Rewrite_Operation.UNRECOGNIZED; + } +} + +export function rewrite_OperationToJSON(object: Rewrite_Operation): string { + switch (object) { + case Rewrite_Operation.OPERATION_UNSPECIFIED: + return "OPERATION_UNSPECIFIED"; + case Rewrite_Operation.OPERATION_UNION: + return "OPERATION_UNION"; + case Rewrite_Operation.OPERATION_INTERSECTION: + return "OPERATION_INTERSECTION"; + case Rewrite_Operation.OPERATION_EXCLUSION: + return "OPERATION_EXCLUSION"; + case Rewrite_Operation.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * The SchemaDefinition message provides definitions for entities and rules, + * and includes references to clarify whether a name refers to an entity or a rule. + */ +export interface SchemaDefinition { + /** Map of entity definitions. The key is the entity name, and the value is the corresponding EntityDefinition. */ + entityDefinitions: { [key: string]: EntityDefinition }; + /** Map of rule definitions. The key is the rule name, and the value is the corresponding RuleDefinition. */ + ruleDefinitions: { [key: string]: RuleDefinition }; + /** Map of references to signify whether a string refers to an entity or a rule. */ + references: { [key: string]: SchemaDefinition_Reference }; +} + +/** The Reference enum helps distinguish whether a name corresponds to an entity or a rule. */ +export enum SchemaDefinition_Reference { + /** REFERENCE_UNSPECIFIED - Default, unspecified reference. */ + REFERENCE_UNSPECIFIED = 0, + /** REFERENCE_ENTITY - Indicates that the name refers to an entity. */ + REFERENCE_ENTITY = 1, + /** REFERENCE_RULE - Indicates that the name refers to a rule. */ + REFERENCE_RULE = 2, + UNRECOGNIZED = -1, +} + +export function schemaDefinition_ReferenceFromJSON(object: any): SchemaDefinition_Reference { + switch (object) { + case 0: + case "REFERENCE_UNSPECIFIED": + return SchemaDefinition_Reference.REFERENCE_UNSPECIFIED; + case 1: + case "REFERENCE_ENTITY": + return SchemaDefinition_Reference.REFERENCE_ENTITY; + case 2: + case "REFERENCE_RULE": + return SchemaDefinition_Reference.REFERENCE_RULE; + case -1: + case "UNRECOGNIZED": + default: + return SchemaDefinition_Reference.UNRECOGNIZED; + } +} + +export function schemaDefinition_ReferenceToJSON(object: SchemaDefinition_Reference): string { + switch (object) { + case SchemaDefinition_Reference.REFERENCE_UNSPECIFIED: + return "REFERENCE_UNSPECIFIED"; + case SchemaDefinition_Reference.REFERENCE_ENTITY: + return "REFERENCE_ENTITY"; + case SchemaDefinition_Reference.REFERENCE_RULE: + return "REFERENCE_RULE"; + case SchemaDefinition_Reference.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface SchemaDefinition_EntityDefinitionsEntry { + key: string; + value: EntityDefinition | undefined; +} + +export interface SchemaDefinition_RuleDefinitionsEntry { + key: string; + value: RuleDefinition | undefined; +} + +export interface SchemaDefinition_ReferencesEntry { + key: string; + value: SchemaDefinition_Reference; +} + +/** The EntityDefinition message provides detailed information about a specific entity. */ +export interface EntityDefinition { + /** The name of the entity, which follows a specific string pattern and has a maximum byte size. */ + name: string; + /** Map of relation definitions within this entity. The key is the relation name, and the value is the RelationDefinition. */ + relations: { [key: string]: RelationDefinition }; + /** Map of permission definitions within this entity. The key is the permission name, and the value is the PermissionDefinition. */ + permissions: { [key: string]: PermissionDefinition }; + /** Map of attribute definitions within this entity. The key is the attribute name, and the value is the AttributeDefinition. */ + attributes: { [key: string]: AttributeDefinition }; + /** Map of references indicating whether a string pertains to a relation, permission, or attribute. */ + references: { [key: string]: EntityDefinition_Reference }; +} + +/** The Reference enum specifies whether a name pertains to a relation, permission, or attribute. */ +export enum EntityDefinition_Reference { + /** REFERENCE_UNSPECIFIED - Default, unspecified reference. */ + REFERENCE_UNSPECIFIED = 0, + /** REFERENCE_RELATION - Indicates that the name refers to a relation. */ + REFERENCE_RELATION = 1, + /** REFERENCE_PERMISSION - Indicates that the name refers to a permission. */ + REFERENCE_PERMISSION = 2, + /** REFERENCE_ATTRIBUTE - Indicates that the name refers to an attribute. */ + REFERENCE_ATTRIBUTE = 3, + UNRECOGNIZED = -1, +} + +export function entityDefinition_ReferenceFromJSON(object: any): EntityDefinition_Reference { + switch (object) { + case 0: + case "REFERENCE_UNSPECIFIED": + return EntityDefinition_Reference.REFERENCE_UNSPECIFIED; + case 1: + case "REFERENCE_RELATION": + return EntityDefinition_Reference.REFERENCE_RELATION; + case 2: + case "REFERENCE_PERMISSION": + return EntityDefinition_Reference.REFERENCE_PERMISSION; + case 3: + case "REFERENCE_ATTRIBUTE": + return EntityDefinition_Reference.REFERENCE_ATTRIBUTE; + case -1: + case "UNRECOGNIZED": + default: + return EntityDefinition_Reference.UNRECOGNIZED; + } +} + +export function entityDefinition_ReferenceToJSON(object: EntityDefinition_Reference): string { + switch (object) { + case EntityDefinition_Reference.REFERENCE_UNSPECIFIED: + return "REFERENCE_UNSPECIFIED"; + case EntityDefinition_Reference.REFERENCE_RELATION: + return "REFERENCE_RELATION"; + case EntityDefinition_Reference.REFERENCE_PERMISSION: + return "REFERENCE_PERMISSION"; + case EntityDefinition_Reference.REFERENCE_ATTRIBUTE: + return "REFERENCE_ATTRIBUTE"; + case EntityDefinition_Reference.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface EntityDefinition_RelationsEntry { + key: string; + value: RelationDefinition | undefined; +} + +export interface EntityDefinition_PermissionsEntry { + key: string; + value: PermissionDefinition | undefined; +} + +export interface EntityDefinition_AttributesEntry { + key: string; + value: AttributeDefinition | undefined; +} + +export interface EntityDefinition_ReferencesEntry { + key: string; + value: EntityDefinition_Reference; +} + +/** The RuleDefinition message provides detailed information about a specific rule. */ +export interface RuleDefinition { + /** The name of the rule, which follows a specific string pattern and has a maximum byte size. */ + name: string; + /** Map of arguments for this rule. The key is the attribute name, and the value is the AttributeType. */ + arguments: { [key: string]: AttributeType }; + /** The expression for this rule in the form of a google.api.expr.v1alpha1.CheckedExpr. */ + expression: CheckedExpr | undefined; +} + +export interface RuleDefinition_ArgumentsEntry { + key: string; + value: AttributeType; +} + +/** The AttributeDefinition message provides detailed information about a specific attribute. */ +export interface AttributeDefinition { + /** The name of the attribute, which follows a specific string pattern and has a maximum byte size. */ + name: string; + /** The type of the attribute. */ + type: AttributeType; +} + +/** The RelationDefinition message provides detailed information about a specific relation. */ +export interface RelationDefinition { + /** The name of the relation, which follows a specific string pattern and has a maximum byte size. */ + name: string; + /** A list of references to other relations. */ + relationReferences: RelationReference[]; +} + +/** The PermissionDefinition message provides detailed information about a specific permission. */ +export interface PermissionDefinition { + /** The name of the permission, which follows a specific string pattern and has a maximum byte size. */ + name: string; + /** The child related to this permission. */ + child: Child | undefined; +} + +/** The RelationReference message provides a reference to a specific relation. */ +export interface RelationReference { + /** The type of the referenced entity, which follows a specific string pattern and has a maximum byte size. */ + type: string; + /** The name of the referenced relation, which follows a specific string pattern and has a maximum byte size. */ + relation: string; +} + +export interface Entrance { + /** The type of the entrance entity, which follows a specific string pattern and has a maximum byte size. */ + type: string; + /** The value associated with the entrance, which follows a specific string pattern and has a maximum byte size. */ + value: string; +} + +/** Argument defines the type of argument in a Call. It can be either a ComputedAttribute or a ContextAttribute. */ +export interface Argument { + type?: { $case: "computedAttribute"; computedAttribute: ComputedAttribute } | undefined; +} + +/** Call represents a call to a rule. It includes the name of the rule and the arguments passed to it. */ +export interface Call { + /** Name of the rule */ + ruleName: string; + /** Arguments passed to the rule */ + arguments: Argument[]; +} + +/** ComputedAttribute defines a computed attribute which includes its name. */ +export interface ComputedAttribute { + /** Name of the computed attribute */ + name: string; +} + +/** ComputedUserSet defines a set of computed users which includes the relation name. */ +export interface ComputedUserSet { + /** Relation name */ + relation: string; +} + +/** TupleToUserSet defines a mapping from tuple sets to computed user sets. */ +export interface TupleToUserSet { + /** The tuple set */ + tupleSet: + | TupleSet + | undefined; + /** The computed user set */ + computed: ComputedUserSet | undefined; +} + +/** TupleSet represents a set of tuples associated with a specific relation. */ +export interface TupleSet { + relation: string; +} + +/** Tuple is a structure that includes an entity, a relation, and a subject. */ +export interface Tuple { + entity: Entity | undefined; + relation: string; + subject: Subject | undefined; +} + +/** Attribute represents an attribute of an entity with a specific type and value. */ +export interface Attribute { + entity: + | Entity + | undefined; + /** Name of the attribute */ + attribute: string; + value: Any | undefined; +} + +/** Tuples is a collection of tuples. */ +export interface Tuples { + tuples: Tuple[]; +} + +/** Attributes is a collection of attributes. */ +export interface Attributes { + attributes: Attribute[]; +} + +/** Entity represents an entity with a type and an identifier. */ +export interface Entity { + type: string; + id: string; +} + +/** EntityAndRelation represents an entity along with a relation. */ +export interface EntityAndRelation { + entity: Entity | undefined; + relation: string; +} + +/** Subject represents an entity subject with a type, an identifier, and a relation. */ +export interface Subject { + type: string; + id: string; + relation: string; +} + +/** AttributeFilter is used to filter attributes based on the entity and attribute names. */ +export interface AttributeFilter { + entity: + | EntityFilter + | undefined; + /** Names of the attributes to be filtered */ + attributes: string[]; +} + +/** TupleFilter is used to filter tuples based on the entity, relation and the subject. */ +export interface TupleFilter { + entity: EntityFilter | undefined; + relation: string; + /** The subject filter */ + subject: SubjectFilter | undefined; +} + +/** EntityFilter is used to filter entities based on the type and ids. */ +export interface EntityFilter { + /** Type of the entity */ + type: string; + /** List of entity IDs */ + ids: string[]; +} + +/** SubjectFilter is used to filter subjects based on the type, ids and relation. */ +export interface SubjectFilter { + /** Type of the subject */ + type: string; + /** List of subject IDs */ + ids: string[]; + relation: string; +} + +/** ExpandTreeNode represents a node in an expansion tree with a specific operation and its children. */ +export interface ExpandTreeNode { + /** Operation to be applied on this tree node */ + operation: ExpandTreeNode_Operation; + /** The children of this tree node */ + children: Expand[]; +} + +/** Operation is an enum representing the type of operation to be applied on the tree node. */ +export enum ExpandTreeNode_Operation { + OPERATION_UNSPECIFIED = 0, + OPERATION_UNION = 1, + OPERATION_INTERSECTION = 2, + OPERATION_EXCLUSION = 3, + UNRECOGNIZED = -1, +} + +export function expandTreeNode_OperationFromJSON(object: any): ExpandTreeNode_Operation { + switch (object) { + case 0: + case "OPERATION_UNSPECIFIED": + return ExpandTreeNode_Operation.OPERATION_UNSPECIFIED; + case 1: + case "OPERATION_UNION": + return ExpandTreeNode_Operation.OPERATION_UNION; + case 2: + case "OPERATION_INTERSECTION": + return ExpandTreeNode_Operation.OPERATION_INTERSECTION; + case 3: + case "OPERATION_EXCLUSION": + return ExpandTreeNode_Operation.OPERATION_EXCLUSION; + case -1: + case "UNRECOGNIZED": + default: + return ExpandTreeNode_Operation.UNRECOGNIZED; + } +} + +export function expandTreeNode_OperationToJSON(object: ExpandTreeNode_Operation): string { + switch (object) { + case ExpandTreeNode_Operation.OPERATION_UNSPECIFIED: + return "OPERATION_UNSPECIFIED"; + case ExpandTreeNode_Operation.OPERATION_UNION: + return "OPERATION_UNION"; + case ExpandTreeNode_Operation.OPERATION_INTERSECTION: + return "OPERATION_INTERSECTION"; + case ExpandTreeNode_Operation.OPERATION_EXCLUSION: + return "OPERATION_EXCLUSION"; + case ExpandTreeNode_Operation.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * Expand is used to define a hierarchical structure for permissions. + * It has an entity, permission, and arguments. The node can be either another hierarchical structure or a set of subjects. + */ +export interface Expand { + /** entity is the entity for which the hierarchical structure is defined. */ + entity: + | Entity + | undefined; + /** permission is the permission applied to the entity. */ + permission: string; + /** arguments are the additional information or context used to evaluate permissions. */ + arguments: Argument[]; + /** The node can either be an ExpandTreeNode or a set of Subjects. */ + node?: + | // + /** expand contains another hierarchical structure. */ + { $case: "expand"; expand: ExpandTreeNode } + | // + /** leaf contains a set of subjects. */ + { $case: "leaf"; leaf: ExpandLeaf } + | undefined; +} + +/** ExpandLeaf is the leaf node of an Expand tree and can be either a set of Subjects or a set of Values. */ +export interface ExpandLeaf { + /** type can be either Subjects or Values. */ + type?: + | // + /** subjects are used when the leaf is a set of subjects. */ + { $case: "subjects"; subjects: Subjects } + | // + /** values are used when the leaf node is a set of values. */ + { $case: "values"; values: Values } + | // + /** value is used when the leaf node is a single value. */ + { $case: "value"; value: Any } + | undefined; +} + +export interface Values { + values: { [key: string]: Any }; +} + +export interface Values_ValuesEntry { + key: string; + value: Any | undefined; +} + +/** Subjects holds a repeated field of Subject type. */ +export interface Subjects { + /** A list of subjects. */ + subjects: Subject[]; +} + +/** Tenant represents a tenant with an id, a name, and a timestamp indicating when it was created. */ +export interface Tenant { + /** The ID of the tenant. */ + id: string; + /** The name of the tenant. */ + name: string; + /** The time at which the tenant was created. */ + createdAt: Date | undefined; +} + +/** DataChanges represent changes in data with a snap token and a list of data change objects. */ +export interface DataChanges { + /** The snapshot token. */ + snapToken: string; + /** The list of data changes. */ + dataChanges: DataChange[]; +} + +/** DataChange represents a single change in data, with an operation type and the actual change which could be a tuple or an attribute. */ +export interface DataChange { + /** The operation type. */ + operation: DataChange_Operation; + /** The type of the change which can be either a tuple or an attribute. */ + type?: + | // + /** If the change is a tuple. */ + { $case: "tuple"; tuple: Tuple } + | // + /** If the change is an attribute. */ + { $case: "attribute"; attribute: Attribute } + | undefined; +} + +export enum DataChange_Operation { + /** OPERATION_UNSPECIFIED - Default operation, not specified. */ + OPERATION_UNSPECIFIED = 0, + /** OPERATION_CREATE - Creation operation. */ + OPERATION_CREATE = 1, + /** OPERATION_DELETE - Deletion operation. */ + OPERATION_DELETE = 2, + UNRECOGNIZED = -1, +} + +export function dataChange_OperationFromJSON(object: any): DataChange_Operation { + switch (object) { + case 0: + case "OPERATION_UNSPECIFIED": + return DataChange_Operation.OPERATION_UNSPECIFIED; + case 1: + case "OPERATION_CREATE": + return DataChange_Operation.OPERATION_CREATE; + case 2: + case "OPERATION_DELETE": + return DataChange_Operation.OPERATION_DELETE; + case -1: + case "UNRECOGNIZED": + default: + return DataChange_Operation.UNRECOGNIZED; + } +} + +export function dataChange_OperationToJSON(object: DataChange_Operation): string { + switch (object) { + case DataChange_Operation.OPERATION_UNSPECIFIED: + return "OPERATION_UNSPECIFIED"; + case DataChange_Operation.OPERATION_CREATE: + return "OPERATION_CREATE"; + case DataChange_Operation.OPERATION_DELETE: + return "OPERATION_DELETE"; + case DataChange_Operation.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Wrapper for a single string value. */ +export interface StringValue { + /** The string value. */ + data: string; +} + +/** Wrapper for a single integer value. */ +export interface IntegerValue { + /** The integer value. */ + data: number; +} + +/** Wrapper for a single double precision floating point value. */ +export interface DoubleValue { + /** The double value. */ + data: number; +} + +/** Wrapper for a single boolean value. */ +export interface BooleanValue { + /** The boolean value. */ + data: boolean; +} + +/** Wrapper for an array of strings. */ +export interface StringArrayValue { + /** The array of strings. */ + data: string[]; +} + +/** Wrapper for an array of integers. */ +export interface IntegerArrayValue { + /** The array of integers. */ + data: number[]; +} + +/** Wrapper for an array of double precision floating point values. */ +export interface DoubleArrayValue { + /** The array of doubles. */ + data: number[]; +} + +/** Wrapper for an array of booleans. */ +export interface BooleanArrayValue { + /** The array of booleans. */ + data: boolean[]; +} + +/** + * DataBundle is a message representing a bundle of data, which includes a name, + * a list of arguments, and a series of operations. + */ +export interface DataBundle { + /** 'name' is a simple string field representing the name of the DataBundle. */ + name: string; + /** + * 'arguments' is a repeated field, which means it can contain multiple strings. + * These are used to store a list of arguments related to the DataBundle. + */ + arguments: string[]; + /** + * 'operations' is a repeated field containing multiple Operation messages. + * Each Operation represents a specific action or set of actions to be performed. + */ + operations: Operation[]; +} + +/** + * Operation is a message representing a series of operations that can be performed. + * It includes fields for writing and deleting relationships and attributes. + */ +export interface Operation { + /** + * 'relationships_write' is a repeated string field for storing relationship keys + * that are to be written or created. + */ + relationshipsWrite: string[]; + /** + * 'relationships_delete' is a repeated string field for storing relationship keys + * that are to be deleted or removed. + */ + relationshipsDelete: string[]; + /** + * 'attributes_write' is a repeated string field for storing attribute keys + * that are to be written or created. + */ + attributesWrite: string[]; + /** + * 'attributes_delete' is a repeated string field for storing attribute keys + * that are to be deleted or removed. + */ + attributesDelete: string[]; +} + +/** Partials contains the write, update and delete definitions */ +export interface Partials { + write: string[]; + delete: string[]; + update: string[]; +} + +function createBaseContext(): Context { + return { tuples: [], attributes: [], data: undefined }; +} + +export const Context: MessageFns = { + encode(message: Context, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.tuples) { + Tuple.encode(v!, writer.uint32(10).fork()).join(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.data !== undefined) { + Struct.encode(Struct.wrap(message.data), writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Context { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContext(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tuples.push(Tuple.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.data = Struct.unwrap(Struct.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Context { + return { + tuples: globalThis.Array.isArray(object?.tuples) ? object.tuples.map((e: any) => Tuple.fromJSON(e)) : [], + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + data: isObject(object.data) ? object.data : undefined, + }; + }, + + toJSON(message: Context): unknown { + const obj: any = {}; + if (message.tuples?.length) { + obj.tuples = message.tuples.map((e) => Tuple.toJSON(e)); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.data !== undefined) { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): Context { + return Context.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Context { + const message = createBaseContext(); + message.tuples = object.tuples?.map((e) => Tuple.fromPartial(e)) || []; + message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.data = object.data ?? undefined; + return message; + }, +}; + +function createBaseChild(): Child { + return { type: undefined }; +} + +export const Child: MessageFns = { + encode(message: Child, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + switch (message.type?.$case) { + case "leaf": + Leaf.encode(message.type.leaf, writer.uint32(10).fork()).join(); + break; + case "rewrite": + Rewrite.encode(message.type.rewrite, writer.uint32(18).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Child { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseChild(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = { $case: "leaf", leaf: Leaf.decode(reader, reader.uint32()) }; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.type = { $case: "rewrite", rewrite: Rewrite.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Child { + return { + type: isSet(object.leaf) + ? { $case: "leaf", leaf: Leaf.fromJSON(object.leaf) } + : isSet(object.rewrite) + ? { $case: "rewrite", rewrite: Rewrite.fromJSON(object.rewrite) } + : undefined, + }; + }, + + toJSON(message: Child): unknown { + const obj: any = {}; + if (message.type?.$case === "leaf") { + obj.leaf = Leaf.toJSON(message.type.leaf); + } else if (message.type?.$case === "rewrite") { + obj.rewrite = Rewrite.toJSON(message.type.rewrite); + } + return obj; + }, + + create(base?: DeepPartial): Child { + return Child.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Child { + const message = createBaseChild(); + switch (object.type?.$case) { + case "leaf": { + if (object.type?.leaf !== undefined && object.type?.leaf !== null) { + message.type = { $case: "leaf", leaf: Leaf.fromPartial(object.type.leaf) }; + } + break; + } + case "rewrite": { + if (object.type?.rewrite !== undefined && object.type?.rewrite !== null) { + message.type = { $case: "rewrite", rewrite: Rewrite.fromPartial(object.type.rewrite) }; + } + break; + } + } + return message; + }, +}; + +function createBaseLeaf(): Leaf { + return { type: undefined }; +} + +export const Leaf: MessageFns = { + encode(message: Leaf, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + switch (message.type?.$case) { + case "computedUserSet": + ComputedUserSet.encode(message.type.computedUserSet, writer.uint32(10).fork()).join(); + break; + case "tupleToUserSet": + TupleToUserSet.encode(message.type.tupleToUserSet, writer.uint32(18).fork()).join(); + break; + case "computedAttribute": + ComputedAttribute.encode(message.type.computedAttribute, writer.uint32(26).fork()).join(); + break; + case "call": + Call.encode(message.type.call, writer.uint32(34).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Leaf { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLeaf(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = { $case: "computedUserSet", computedUserSet: ComputedUserSet.decode(reader, reader.uint32()) }; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.type = { $case: "tupleToUserSet", tupleToUserSet: TupleToUserSet.decode(reader, reader.uint32()) }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.type = { + $case: "computedAttribute", + computedAttribute: ComputedAttribute.decode(reader, reader.uint32()), + }; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.type = { $case: "call", call: Call.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Leaf { + return { + type: isSet(object.computedUserSet) + ? { $case: "computedUserSet", computedUserSet: ComputedUserSet.fromJSON(object.computedUserSet) } + : isSet(object.tupleToUserSet) + ? { $case: "tupleToUserSet", tupleToUserSet: TupleToUserSet.fromJSON(object.tupleToUserSet) } + : isSet(object.computedAttribute) + ? { $case: "computedAttribute", computedAttribute: ComputedAttribute.fromJSON(object.computedAttribute) } + : isSet(object.call) + ? { $case: "call", call: Call.fromJSON(object.call) } + : undefined, + }; + }, + + toJSON(message: Leaf): unknown { + const obj: any = {}; + if (message.type?.$case === "computedUserSet") { + obj.computedUserSet = ComputedUserSet.toJSON(message.type.computedUserSet); + } else if (message.type?.$case === "tupleToUserSet") { + obj.tupleToUserSet = TupleToUserSet.toJSON(message.type.tupleToUserSet); + } else if (message.type?.$case === "computedAttribute") { + obj.computedAttribute = ComputedAttribute.toJSON(message.type.computedAttribute); + } else if (message.type?.$case === "call") { + obj.call = Call.toJSON(message.type.call); + } + return obj; + }, + + create(base?: DeepPartial): Leaf { + return Leaf.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Leaf { + const message = createBaseLeaf(); + switch (object.type?.$case) { + case "computedUserSet": { + if (object.type?.computedUserSet !== undefined && object.type?.computedUserSet !== null) { + message.type = { + $case: "computedUserSet", + computedUserSet: ComputedUserSet.fromPartial(object.type.computedUserSet), + }; + } + break; + } + case "tupleToUserSet": { + if (object.type?.tupleToUserSet !== undefined && object.type?.tupleToUserSet !== null) { + message.type = { + $case: "tupleToUserSet", + tupleToUserSet: TupleToUserSet.fromPartial(object.type.tupleToUserSet), + }; + } + break; + } + case "computedAttribute": { + if (object.type?.computedAttribute !== undefined && object.type?.computedAttribute !== null) { + message.type = { + $case: "computedAttribute", + computedAttribute: ComputedAttribute.fromPartial(object.type.computedAttribute), + }; + } + break; + } + case "call": { + if (object.type?.call !== undefined && object.type?.call !== null) { + message.type = { $case: "call", call: Call.fromPartial(object.type.call) }; + } + break; + } + } + return message; + }, +}; + +function createBaseRewrite(): Rewrite { + return { rewriteOperation: 0, children: [] }; +} + +export const Rewrite: MessageFns = { + encode(message: Rewrite, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.rewriteOperation !== 0) { + writer.uint32(8).int32(message.rewriteOperation); + } + for (const v of message.children) { + Child.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Rewrite { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRewrite(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.rewriteOperation = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.children.push(Child.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Rewrite { + return { + rewriteOperation: isSet(object.rewriteOperation) ? rewrite_OperationFromJSON(object.rewriteOperation) : 0, + children: globalThis.Array.isArray(object?.children) ? object.children.map((e: any) => Child.fromJSON(e)) : [], + }; + }, + + toJSON(message: Rewrite): unknown { + const obj: any = {}; + if (message.rewriteOperation !== 0) { + obj.rewriteOperation = rewrite_OperationToJSON(message.rewriteOperation); + } + if (message.children?.length) { + obj.children = message.children.map((e) => Child.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Rewrite { + return Rewrite.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Rewrite { + const message = createBaseRewrite(); + message.rewriteOperation = object.rewriteOperation ?? 0; + message.children = object.children?.map((e) => Child.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseSchemaDefinition(): SchemaDefinition { + return { entityDefinitions: {}, ruleDefinitions: {}, references: {} }; +} + +export const SchemaDefinition: MessageFns = { + encode(message: SchemaDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.entityDefinitions).forEach(([key, value]) => { + SchemaDefinition_EntityDefinitionsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + }); + Object.entries(message.ruleDefinitions).forEach(([key, value]) => { + SchemaDefinition_RuleDefinitionsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + Object.entries(message.references).forEach(([key, value]) => { + SchemaDefinition_ReferencesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaDefinition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaDefinition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = SchemaDefinition_EntityDefinitionsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.entityDefinitions[entry1.key] = entry1.value; + } + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = SchemaDefinition_RuleDefinitionsEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.ruleDefinitions[entry2.key] = entry2.value; + } + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + const entry3 = SchemaDefinition_ReferencesEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.references[entry3.key] = entry3.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaDefinition { + return { + entityDefinitions: isObject(object.entityDefinitions) + ? Object.entries(object.entityDefinitions).reduce<{ [key: string]: EntityDefinition }>((acc, [key, value]) => { + acc[key] = EntityDefinition.fromJSON(value); + return acc; + }, {}) + : {}, + ruleDefinitions: isObject(object.ruleDefinitions) + ? Object.entries(object.ruleDefinitions).reduce<{ [key: string]: RuleDefinition }>((acc, [key, value]) => { + acc[key] = RuleDefinition.fromJSON(value); + return acc; + }, {}) + : {}, + references: isObject(object.references) + ? Object.entries(object.references).reduce<{ [key: string]: SchemaDefinition_Reference }>( + (acc, [key, value]) => { + acc[key] = schemaDefinition_ReferenceFromJSON(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: SchemaDefinition): unknown { + const obj: any = {}; + if (message.entityDefinitions) { + const entries = Object.entries(message.entityDefinitions); + if (entries.length > 0) { + obj.entityDefinitions = {}; + entries.forEach(([k, v]) => { + obj.entityDefinitions[k] = EntityDefinition.toJSON(v); + }); + } + } + if (message.ruleDefinitions) { + const entries = Object.entries(message.ruleDefinitions); + if (entries.length > 0) { + obj.ruleDefinitions = {}; + entries.forEach(([k, v]) => { + obj.ruleDefinitions[k] = RuleDefinition.toJSON(v); + }); + } + } + if (message.references) { + const entries = Object.entries(message.references); + if (entries.length > 0) { + obj.references = {}; + entries.forEach(([k, v]) => { + obj.references[k] = schemaDefinition_ReferenceToJSON(v); + }); + } + } + return obj; + }, + + create(base?: DeepPartial): SchemaDefinition { + return SchemaDefinition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaDefinition { + const message = createBaseSchemaDefinition(); + message.entityDefinitions = Object.entries(object.entityDefinitions ?? {}).reduce< + { [key: string]: EntityDefinition } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = EntityDefinition.fromPartial(value); + } + return acc; + }, {}); + message.ruleDefinitions = Object.entries(object.ruleDefinitions ?? {}).reduce<{ [key: string]: RuleDefinition }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = RuleDefinition.fromPartial(value); + } + return acc; + }, + {}, + ); + message.references = Object.entries(object.references ?? {}).reduce<{ [key: string]: SchemaDefinition_Reference }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value as SchemaDefinition_Reference; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseSchemaDefinition_EntityDefinitionsEntry(): SchemaDefinition_EntityDefinitionsEntry { + return { key: "", value: undefined }; +} + +export const SchemaDefinition_EntityDefinitionsEntry: MessageFns = { + encode(message: SchemaDefinition_EntityDefinitionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + EntityDefinition.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaDefinition_EntityDefinitionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaDefinition_EntityDefinitionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = EntityDefinition.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaDefinition_EntityDefinitionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? EntityDefinition.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: SchemaDefinition_EntityDefinitionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = EntityDefinition.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): SchemaDefinition_EntityDefinitionsEntry { + return SchemaDefinition_EntityDefinitionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaDefinition_EntityDefinitionsEntry { + const message = createBaseSchemaDefinition_EntityDefinitionsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? EntityDefinition.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseSchemaDefinition_RuleDefinitionsEntry(): SchemaDefinition_RuleDefinitionsEntry { + return { key: "", value: undefined }; +} + +export const SchemaDefinition_RuleDefinitionsEntry: MessageFns = { + encode(message: SchemaDefinition_RuleDefinitionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + RuleDefinition.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaDefinition_RuleDefinitionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaDefinition_RuleDefinitionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = RuleDefinition.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaDefinition_RuleDefinitionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? RuleDefinition.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: SchemaDefinition_RuleDefinitionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = RuleDefinition.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): SchemaDefinition_RuleDefinitionsEntry { + return SchemaDefinition_RuleDefinitionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaDefinition_RuleDefinitionsEntry { + const message = createBaseSchemaDefinition_RuleDefinitionsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? RuleDefinition.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseSchemaDefinition_ReferencesEntry(): SchemaDefinition_ReferencesEntry { + return { key: "", value: 0 }; +} + +export const SchemaDefinition_ReferencesEntry: MessageFns = { + encode(message: SchemaDefinition_ReferencesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== 0) { + writer.uint32(16).int32(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaDefinition_ReferencesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaDefinition_ReferencesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.value = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaDefinition_ReferencesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? schemaDefinition_ReferenceFromJSON(object.value) : 0, + }; + }, + + toJSON(message: SchemaDefinition_ReferencesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== 0) { + obj.value = schemaDefinition_ReferenceToJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): SchemaDefinition_ReferencesEntry { + return SchemaDefinition_ReferencesEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaDefinition_ReferencesEntry { + const message = createBaseSchemaDefinition_ReferencesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseEntityDefinition(): EntityDefinition { + return { name: "", relations: {}, permissions: {}, attributes: {}, references: {} }; +} + +export const EntityDefinition: MessageFns = { + encode(message: EntityDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + Object.entries(message.relations).forEach(([key, value]) => { + EntityDefinition_RelationsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + Object.entries(message.permissions).forEach(([key, value]) => { + EntityDefinition_PermissionsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + Object.entries(message.attributes).forEach(([key, value]) => { + EntityDefinition_AttributesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + }); + Object.entries(message.references).forEach(([key, value]) => { + EntityDefinition_ReferencesEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EntityDefinition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntityDefinition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = EntityDefinition_RelationsEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.relations[entry2.key] = entry2.value; + } + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + const entry3 = EntityDefinition_PermissionsEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.permissions[entry3.key] = entry3.value; + } + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = EntityDefinition_AttributesEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.attributes[entry4.key] = entry4.value; + } + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + const entry5 = EntityDefinition_ReferencesEntry.decode(reader, reader.uint32()); + if (entry5.value !== undefined) { + message.references[entry5.key] = entry5.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EntityDefinition { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + relations: isObject(object.relations) + ? Object.entries(object.relations).reduce<{ [key: string]: RelationDefinition }>((acc, [key, value]) => { + acc[key] = RelationDefinition.fromJSON(value); + return acc; + }, {}) + : {}, + permissions: isObject(object.permissions) + ? Object.entries(object.permissions).reduce<{ [key: string]: PermissionDefinition }>((acc, [key, value]) => { + acc[key] = PermissionDefinition.fromJSON(value); + return acc; + }, {}) + : {}, + attributes: isObject(object.attributes) + ? Object.entries(object.attributes).reduce<{ [key: string]: AttributeDefinition }>((acc, [key, value]) => { + acc[key] = AttributeDefinition.fromJSON(value); + return acc; + }, {}) + : {}, + references: isObject(object.references) + ? Object.entries(object.references).reduce<{ [key: string]: EntityDefinition_Reference }>( + (acc, [key, value]) => { + acc[key] = entityDefinition_ReferenceFromJSON(value); + return acc; + }, + {}, + ) + : {}, + }; + }, + + toJSON(message: EntityDefinition): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.relations) { + const entries = Object.entries(message.relations); + if (entries.length > 0) { + obj.relations = {}; + entries.forEach(([k, v]) => { + obj.relations[k] = RelationDefinition.toJSON(v); + }); + } + } + if (message.permissions) { + const entries = Object.entries(message.permissions); + if (entries.length > 0) { + obj.permissions = {}; + entries.forEach(([k, v]) => { + obj.permissions[k] = PermissionDefinition.toJSON(v); + }); + } + } + if (message.attributes) { + const entries = Object.entries(message.attributes); + if (entries.length > 0) { + obj.attributes = {}; + entries.forEach(([k, v]) => { + obj.attributes[k] = AttributeDefinition.toJSON(v); + }); + } + } + if (message.references) { + const entries = Object.entries(message.references); + if (entries.length > 0) { + obj.references = {}; + entries.forEach(([k, v]) => { + obj.references[k] = entityDefinition_ReferenceToJSON(v); + }); + } + } + return obj; + }, + + create(base?: DeepPartial): EntityDefinition { + return EntityDefinition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EntityDefinition { + const message = createBaseEntityDefinition(); + message.name = object.name ?? ""; + message.relations = Object.entries(object.relations ?? {}).reduce<{ [key: string]: RelationDefinition }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = RelationDefinition.fromPartial(value); + } + return acc; + }, + {}, + ); + message.permissions = Object.entries(object.permissions ?? {}).reduce<{ [key: string]: PermissionDefinition }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = PermissionDefinition.fromPartial(value); + } + return acc; + }, + {}, + ); + message.attributes = Object.entries(object.attributes ?? {}).reduce<{ [key: string]: AttributeDefinition }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = AttributeDefinition.fromPartial(value); + } + return acc; + }, + {}, + ); + message.references = Object.entries(object.references ?? {}).reduce<{ [key: string]: EntityDefinition_Reference }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value as EntityDefinition_Reference; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseEntityDefinition_RelationsEntry(): EntityDefinition_RelationsEntry { + return { key: "", value: undefined }; +} + +export const EntityDefinition_RelationsEntry: MessageFns = { + encode(message: EntityDefinition_RelationsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + RelationDefinition.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EntityDefinition_RelationsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntityDefinition_RelationsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = RelationDefinition.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EntityDefinition_RelationsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? RelationDefinition.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: EntityDefinition_RelationsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = RelationDefinition.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): EntityDefinition_RelationsEntry { + return EntityDefinition_RelationsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EntityDefinition_RelationsEntry { + const message = createBaseEntityDefinition_RelationsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? RelationDefinition.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseEntityDefinition_PermissionsEntry(): EntityDefinition_PermissionsEntry { + return { key: "", value: undefined }; +} + +export const EntityDefinition_PermissionsEntry: MessageFns = { + encode(message: EntityDefinition_PermissionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + PermissionDefinition.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EntityDefinition_PermissionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntityDefinition_PermissionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = PermissionDefinition.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EntityDefinition_PermissionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? PermissionDefinition.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: EntityDefinition_PermissionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = PermissionDefinition.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): EntityDefinition_PermissionsEntry { + return EntityDefinition_PermissionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EntityDefinition_PermissionsEntry { + const message = createBaseEntityDefinition_PermissionsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? PermissionDefinition.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseEntityDefinition_AttributesEntry(): EntityDefinition_AttributesEntry { + return { key: "", value: undefined }; +} + +export const EntityDefinition_AttributesEntry: MessageFns = { + encode(message: EntityDefinition_AttributesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + AttributeDefinition.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EntityDefinition_AttributesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntityDefinition_AttributesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = AttributeDefinition.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EntityDefinition_AttributesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? AttributeDefinition.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: EntityDefinition_AttributesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = AttributeDefinition.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): EntityDefinition_AttributesEntry { + return EntityDefinition_AttributesEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EntityDefinition_AttributesEntry { + const message = createBaseEntityDefinition_AttributesEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? AttributeDefinition.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseEntityDefinition_ReferencesEntry(): EntityDefinition_ReferencesEntry { + return { key: "", value: 0 }; +} + +export const EntityDefinition_ReferencesEntry: MessageFns = { + encode(message: EntityDefinition_ReferencesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== 0) { + writer.uint32(16).int32(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EntityDefinition_ReferencesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntityDefinition_ReferencesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.value = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EntityDefinition_ReferencesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? entityDefinition_ReferenceFromJSON(object.value) : 0, + }; + }, + + toJSON(message: EntityDefinition_ReferencesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== 0) { + obj.value = entityDefinition_ReferenceToJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): EntityDefinition_ReferencesEntry { + return EntityDefinition_ReferencesEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EntityDefinition_ReferencesEntry { + const message = createBaseEntityDefinition_ReferencesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseRuleDefinition(): RuleDefinition { + return { name: "", arguments: {}, expression: undefined }; +} + +export const RuleDefinition: MessageFns = { + encode(message: RuleDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + Object.entries(message.arguments).forEach(([key, value]) => { + RuleDefinition_ArgumentsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + if (message.expression !== undefined) { + CheckedExpr.encode(message.expression, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RuleDefinition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRuleDefinition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = RuleDefinition_ArgumentsEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.arguments[entry2.key] = entry2.value; + } + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.expression = CheckedExpr.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RuleDefinition { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + arguments: isObject(object.arguments) + ? Object.entries(object.arguments).reduce<{ [key: string]: AttributeType }>((acc, [key, value]) => { + acc[key] = attributeTypeFromJSON(value); + return acc; + }, {}) + : {}, + expression: isSet(object.expression) ? CheckedExpr.fromJSON(object.expression) : undefined, + }; + }, + + toJSON(message: RuleDefinition): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.arguments) { + const entries = Object.entries(message.arguments); + if (entries.length > 0) { + obj.arguments = {}; + entries.forEach(([k, v]) => { + obj.arguments[k] = attributeTypeToJSON(v); + }); + } + } + if (message.expression !== undefined) { + obj.expression = CheckedExpr.toJSON(message.expression); + } + return obj; + }, + + create(base?: DeepPartial): RuleDefinition { + return RuleDefinition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RuleDefinition { + const message = createBaseRuleDefinition(); + message.name = object.name ?? ""; + message.arguments = Object.entries(object.arguments ?? {}).reduce<{ [key: string]: AttributeType }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value as AttributeType; + } + return acc; + }, + {}, + ); + message.expression = (object.expression !== undefined && object.expression !== null) + ? CheckedExpr.fromPartial(object.expression) + : undefined; + return message; + }, +}; + +function createBaseRuleDefinition_ArgumentsEntry(): RuleDefinition_ArgumentsEntry { + return { key: "", value: 0 }; +} + +export const RuleDefinition_ArgumentsEntry: MessageFns = { + encode(message: RuleDefinition_ArgumentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== 0) { + writer.uint32(16).int32(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RuleDefinition_ArgumentsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRuleDefinition_ArgumentsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.value = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RuleDefinition_ArgumentsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? attributeTypeFromJSON(object.value) : 0, + }; + }, + + toJSON(message: RuleDefinition_ArgumentsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== 0) { + obj.value = attributeTypeToJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): RuleDefinition_ArgumentsEntry { + return RuleDefinition_ArgumentsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RuleDefinition_ArgumentsEntry { + const message = createBaseRuleDefinition_ArgumentsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseAttributeDefinition(): AttributeDefinition { + return { name: "", type: 0 }; +} + +export const AttributeDefinition: MessageFns = { + encode(message: AttributeDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.type !== 0) { + writer.uint32(16).int32(message.type); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AttributeDefinition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributeDefinition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.type = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributeDefinition { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + type: isSet(object.type) ? attributeTypeFromJSON(object.type) : 0, + }; + }, + + toJSON(message: AttributeDefinition): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.type !== 0) { + obj.type = attributeTypeToJSON(message.type); + } + return obj; + }, + + create(base?: DeepPartial): AttributeDefinition { + return AttributeDefinition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AttributeDefinition { + const message = createBaseAttributeDefinition(); + message.name = object.name ?? ""; + message.type = object.type ?? 0; + return message; + }, +}; + +function createBaseRelationDefinition(): RelationDefinition { + return { name: "", relationReferences: [] }; +} + +export const RelationDefinition: MessageFns = { + encode(message: RelationDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.relationReferences) { + RelationReference.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationDefinition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationDefinition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.relationReferences.push(RelationReference.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationDefinition { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + relationReferences: globalThis.Array.isArray(object?.relationReferences) + ? object.relationReferences.map((e: any) => RelationReference.fromJSON(e)) + : [], + }; + }, + + toJSON(message: RelationDefinition): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.relationReferences?.length) { + obj.relationReferences = message.relationReferences.map((e) => RelationReference.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): RelationDefinition { + return RelationDefinition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationDefinition { + const message = createBaseRelationDefinition(); + message.name = object.name ?? ""; + message.relationReferences = object.relationReferences?.map((e) => RelationReference.fromPartial(e)) || []; + return message; + }, +}; + +function createBasePermissionDefinition(): PermissionDefinition { + return { name: "", child: undefined }; +} + +export const PermissionDefinition: MessageFns = { + encode(message: PermissionDefinition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.child !== undefined) { + Child.encode(message.child, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionDefinition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionDefinition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.child = Child.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionDefinition { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + child: isSet(object.child) ? Child.fromJSON(object.child) : undefined, + }; + }, + + toJSON(message: PermissionDefinition): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.child !== undefined) { + obj.child = Child.toJSON(message.child); + } + return obj; + }, + + create(base?: DeepPartial): PermissionDefinition { + return PermissionDefinition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionDefinition { + const message = createBasePermissionDefinition(); + message.name = object.name ?? ""; + message.child = (object.child !== undefined && object.child !== null) ? Child.fromPartial(object.child) : undefined; + return message; + }, +}; + +function createBaseRelationReference(): RelationReference { + return { type: "", relation: "" }; +} + +export const RelationReference: MessageFns = { + encode(message: RelationReference, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.relation !== "") { + writer.uint32(18).string(message.relation); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationReference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationReference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.relation = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationReference { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + relation: isSet(object.relation) ? globalThis.String(object.relation) : "", + }; + }, + + toJSON(message: RelationReference): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.relation !== "") { + obj.relation = message.relation; + } + return obj; + }, + + create(base?: DeepPartial): RelationReference { + return RelationReference.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationReference { + const message = createBaseRelationReference(); + message.type = object.type ?? ""; + message.relation = object.relation ?? ""; + return message; + }, +}; + +function createBaseEntrance(): Entrance { + return { type: "", value: "" }; +} + +export const Entrance: MessageFns = { + encode(message: Entrance, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Entrance { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntrance(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Entrance { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Entrance): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Entrance { + return Entrance.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Entrance { + const message = createBaseEntrance(); + message.type = object.type ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseArgument(): Argument { + return { type: undefined }; +} + +export const Argument: MessageFns = { + encode(message: Argument, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + switch (message.type?.$case) { + case "computedAttribute": + ComputedAttribute.encode(message.type.computedAttribute, writer.uint32(10).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Argument { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseArgument(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = { + $case: "computedAttribute", + computedAttribute: ComputedAttribute.decode(reader, reader.uint32()), + }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Argument { + return { + type: isSet(object.computedAttribute) + ? { $case: "computedAttribute", computedAttribute: ComputedAttribute.fromJSON(object.computedAttribute) } + : undefined, + }; + }, + + toJSON(message: Argument): unknown { + const obj: any = {}; + if (message.type?.$case === "computedAttribute") { + obj.computedAttribute = ComputedAttribute.toJSON(message.type.computedAttribute); + } + return obj; + }, + + create(base?: DeepPartial): Argument { + return Argument.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Argument { + const message = createBaseArgument(); + switch (object.type?.$case) { + case "computedAttribute": { + if (object.type?.computedAttribute !== undefined && object.type?.computedAttribute !== null) { + message.type = { + $case: "computedAttribute", + computedAttribute: ComputedAttribute.fromPartial(object.type.computedAttribute), + }; + } + break; + } + } + return message; + }, +}; + +function createBaseCall(): Call { + return { ruleName: "", arguments: [] }; +} + +export const Call: MessageFns = { + encode(message: Call, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.ruleName !== "") { + writer.uint32(10).string(message.ruleName); + } + for (const v of message.arguments) { + Argument.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Call { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCall(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.ruleName = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.arguments.push(Argument.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Call { + return { + ruleName: isSet(object.ruleName) ? globalThis.String(object.ruleName) : "", + arguments: globalThis.Array.isArray(object?.arguments) + ? object.arguments.map((e: any) => Argument.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Call): unknown { + const obj: any = {}; + if (message.ruleName !== "") { + obj.ruleName = message.ruleName; + } + if (message.arguments?.length) { + obj.arguments = message.arguments.map((e) => Argument.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Call { + return Call.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Call { + const message = createBaseCall(); + message.ruleName = object.ruleName ?? ""; + message.arguments = object.arguments?.map((e) => Argument.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseComputedAttribute(): ComputedAttribute { + return { name: "" }; +} + +export const ComputedAttribute: MessageFns = { + encode(message: ComputedAttribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ComputedAttribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseComputedAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ComputedAttribute { + return { name: isSet(object.name) ? globalThis.String(object.name) : "" }; + }, + + toJSON(message: ComputedAttribute): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + return obj; + }, + + create(base?: DeepPartial): ComputedAttribute { + return ComputedAttribute.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ComputedAttribute { + const message = createBaseComputedAttribute(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseComputedUserSet(): ComputedUserSet { + return { relation: "" }; +} + +export const ComputedUserSet: MessageFns = { + encode(message: ComputedUserSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.relation !== "") { + writer.uint32(10).string(message.relation); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ComputedUserSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseComputedUserSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.relation = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ComputedUserSet { + return { relation: isSet(object.relation) ? globalThis.String(object.relation) : "" }; + }, + + toJSON(message: ComputedUserSet): unknown { + const obj: any = {}; + if (message.relation !== "") { + obj.relation = message.relation; + } + return obj; + }, + + create(base?: DeepPartial): ComputedUserSet { + return ComputedUserSet.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ComputedUserSet { + const message = createBaseComputedUserSet(); + message.relation = object.relation ?? ""; + return message; + }, +}; + +function createBaseTupleToUserSet(): TupleToUserSet { + return { tupleSet: undefined, computed: undefined }; +} + +export const TupleToUserSet: MessageFns = { + encode(message: TupleToUserSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tupleSet !== undefined) { + TupleSet.encode(message.tupleSet, writer.uint32(10).fork()).join(); + } + if (message.computed !== undefined) { + ComputedUserSet.encode(message.computed, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TupleToUserSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTupleToUserSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tupleSet = TupleSet.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.computed = ComputedUserSet.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TupleToUserSet { + return { + tupleSet: isSet(object.tupleSet) ? TupleSet.fromJSON(object.tupleSet) : undefined, + computed: isSet(object.computed) ? ComputedUserSet.fromJSON(object.computed) : undefined, + }; + }, + + toJSON(message: TupleToUserSet): unknown { + const obj: any = {}; + if (message.tupleSet !== undefined) { + obj.tupleSet = TupleSet.toJSON(message.tupleSet); + } + if (message.computed !== undefined) { + obj.computed = ComputedUserSet.toJSON(message.computed); + } + return obj; + }, + + create(base?: DeepPartial): TupleToUserSet { + return TupleToUserSet.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TupleToUserSet { + const message = createBaseTupleToUserSet(); + message.tupleSet = (object.tupleSet !== undefined && object.tupleSet !== null) + ? TupleSet.fromPartial(object.tupleSet) + : undefined; + message.computed = (object.computed !== undefined && object.computed !== null) + ? ComputedUserSet.fromPartial(object.computed) + : undefined; + return message; + }, +}; + +function createBaseTupleSet(): TupleSet { + return { relation: "" }; +} + +export const TupleSet: MessageFns = { + encode(message: TupleSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.relation !== "") { + writer.uint32(10).string(message.relation); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TupleSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTupleSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.relation = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TupleSet { + return { relation: isSet(object.relation) ? globalThis.String(object.relation) : "" }; + }, + + toJSON(message: TupleSet): unknown { + const obj: any = {}; + if (message.relation !== "") { + obj.relation = message.relation; + } + return obj; + }, + + create(base?: DeepPartial): TupleSet { + return TupleSet.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TupleSet { + const message = createBaseTupleSet(); + message.relation = object.relation ?? ""; + return message; + }, +}; + +function createBaseTuple(): Tuple { + return { entity: undefined, relation: "", subject: undefined }; +} + +export const Tuple: MessageFns = { + encode(message: Tuple, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(10).fork()).join(); + } + if (message.relation !== "") { + writer.uint32(18).string(message.relation); + } + if (message.subject !== undefined) { + Subject.encode(message.subject, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Tuple { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTuple(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.relation = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.subject = Subject.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Tuple { + return { + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + relation: isSet(object.relation) ? globalThis.String(object.relation) : "", + subject: isSet(object.subject) ? Subject.fromJSON(object.subject) : undefined, + }; + }, + + toJSON(message: Tuple): unknown { + const obj: any = {}; + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.relation !== "") { + obj.relation = message.relation; + } + if (message.subject !== undefined) { + obj.subject = Subject.toJSON(message.subject); + } + return obj; + }, + + create(base?: DeepPartial): Tuple { + return Tuple.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Tuple { + const message = createBaseTuple(); + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.relation = object.relation ?? ""; + message.subject = (object.subject !== undefined && object.subject !== null) + ? Subject.fromPartial(object.subject) + : undefined; + return message; + }, +}; + +function createBaseAttribute(): Attribute { + return { entity: undefined, attribute: "", value: undefined }; +} + +export const Attribute: MessageFns = { + encode(message: Attribute, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(10).fork()).join(); + } + if (message.attribute !== "") { + writer.uint32(18).string(message.attribute); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Attribute { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttribute(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.attribute = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Attribute { + return { + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + attribute: isSet(object.attribute) ? globalThis.String(object.attribute) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Attribute): unknown { + const obj: any = {}; + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.attribute !== "") { + obj.attribute = message.attribute; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): Attribute { + return Attribute.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Attribute { + const message = createBaseAttribute(); + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.attribute = object.attribute ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseTuples(): Tuples { + return { tuples: [] }; +} + +export const Tuples: MessageFns = { + encode(message: Tuples, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.tuples) { + Tuple.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Tuples { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTuples(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tuples.push(Tuple.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Tuples { + return { tuples: globalThis.Array.isArray(object?.tuples) ? object.tuples.map((e: any) => Tuple.fromJSON(e)) : [] }; + }, + + toJSON(message: Tuples): unknown { + const obj: any = {}; + if (message.tuples?.length) { + obj.tuples = message.tuples.map((e) => Tuple.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Tuples { + return Tuples.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Tuples { + const message = createBaseTuples(); + message.tuples = object.tuples?.map((e) => Tuple.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseAttributes(): Attributes { + return { attributes: [] }; +} + +export const Attributes: MessageFns = { + encode(message: Attributes, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Attributes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Attributes { + return { + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Attributes): unknown { + const obj: any = {}; + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Attributes { + return Attributes.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Attributes { + const message = createBaseAttributes(); + message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEntity(): Entity { + return { type: "", id: "" }; +} + +export const Entity: MessageFns = { + encode(message: Entity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Entity { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntity(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.id = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Entity { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + id: isSet(object.id) ? globalThis.String(object.id) : "", + }; + }, + + toJSON(message: Entity): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + + create(base?: DeepPartial): Entity { + return Entity.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Entity { + const message = createBaseEntity(); + message.type = object.type ?? ""; + message.id = object.id ?? ""; + return message; + }, +}; + +function createBaseEntityAndRelation(): EntityAndRelation { + return { entity: undefined, relation: "" }; +} + +export const EntityAndRelation: MessageFns = { + encode(message: EntityAndRelation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(10).fork()).join(); + } + if (message.relation !== "") { + writer.uint32(18).string(message.relation); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EntityAndRelation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntityAndRelation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.relation = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EntityAndRelation { + return { + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + relation: isSet(object.relation) ? globalThis.String(object.relation) : "", + }; + }, + + toJSON(message: EntityAndRelation): unknown { + const obj: any = {}; + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.relation !== "") { + obj.relation = message.relation; + } + return obj; + }, + + create(base?: DeepPartial): EntityAndRelation { + return EntityAndRelation.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EntityAndRelation { + const message = createBaseEntityAndRelation(); + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.relation = object.relation ?? ""; + return message; + }, +}; + +function createBaseSubject(): Subject { + return { type: "", id: "", relation: "" }; +} + +export const Subject: MessageFns = { + encode(message: Subject, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + if (message.id !== "") { + writer.uint32(18).string(message.id); + } + if (message.relation !== "") { + writer.uint32(26).string(message.relation); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Subject { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubject(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.id = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.relation = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Subject { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + id: isSet(object.id) ? globalThis.String(object.id) : "", + relation: isSet(object.relation) ? globalThis.String(object.relation) : "", + }; + }, + + toJSON(message: Subject): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.id !== "") { + obj.id = message.id; + } + if (message.relation !== "") { + obj.relation = message.relation; + } + return obj; + }, + + create(base?: DeepPartial): Subject { + return Subject.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Subject { + const message = createBaseSubject(); + message.type = object.type ?? ""; + message.id = object.id ?? ""; + message.relation = object.relation ?? ""; + return message; + }, +}; + +function createBaseAttributeFilter(): AttributeFilter { + return { entity: undefined, attributes: [] }; +} + +export const AttributeFilter: MessageFns = { + encode(message: AttributeFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.entity !== undefined) { + EntityFilter.encode(message.entity, writer.uint32(10).fork()).join(); + } + for (const v of message.attributes) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AttributeFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributeFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entity = EntityFilter.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.attributes.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributeFilter { + return { + entity: isSet(object.entity) ? EntityFilter.fromJSON(object.entity) : undefined, + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: AttributeFilter): unknown { + const obj: any = {}; + if (message.entity !== undefined) { + obj.entity = EntityFilter.toJSON(message.entity); + } + if (message.attributes?.length) { + obj.attributes = message.attributes; + } + return obj; + }, + + create(base?: DeepPartial): AttributeFilter { + return AttributeFilter.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AttributeFilter { + const message = createBaseAttributeFilter(); + message.entity = (object.entity !== undefined && object.entity !== null) + ? EntityFilter.fromPartial(object.entity) + : undefined; + message.attributes = object.attributes?.map((e) => e) || []; + return message; + }, +}; + +function createBaseTupleFilter(): TupleFilter { + return { entity: undefined, relation: "", subject: undefined }; +} + +export const TupleFilter: MessageFns = { + encode(message: TupleFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.entity !== undefined) { + EntityFilter.encode(message.entity, writer.uint32(10).fork()).join(); + } + if (message.relation !== "") { + writer.uint32(18).string(message.relation); + } + if (message.subject !== undefined) { + SubjectFilter.encode(message.subject, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TupleFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTupleFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entity = EntityFilter.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.relation = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.subject = SubjectFilter.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TupleFilter { + return { + entity: isSet(object.entity) ? EntityFilter.fromJSON(object.entity) : undefined, + relation: isSet(object.relation) ? globalThis.String(object.relation) : "", + subject: isSet(object.subject) ? SubjectFilter.fromJSON(object.subject) : undefined, + }; + }, + + toJSON(message: TupleFilter): unknown { + const obj: any = {}; + if (message.entity !== undefined) { + obj.entity = EntityFilter.toJSON(message.entity); + } + if (message.relation !== "") { + obj.relation = message.relation; + } + if (message.subject !== undefined) { + obj.subject = SubjectFilter.toJSON(message.subject); + } + return obj; + }, + + create(base?: DeepPartial): TupleFilter { + return TupleFilter.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TupleFilter { + const message = createBaseTupleFilter(); + message.entity = (object.entity !== undefined && object.entity !== null) + ? EntityFilter.fromPartial(object.entity) + : undefined; + message.relation = object.relation ?? ""; + message.subject = (object.subject !== undefined && object.subject !== null) + ? SubjectFilter.fromPartial(object.subject) + : undefined; + return message; + }, +}; + +function createBaseEntityFilter(): EntityFilter { + return { type: "", ids: [] }; +} + +export const EntityFilter: MessageFns = { + encode(message: EntityFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.ids) { + writer.uint32(18).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EntityFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEntityFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.ids.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EntityFilter { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: EntityFilter): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.ids?.length) { + obj.ids = message.ids; + } + return obj; + }, + + create(base?: DeepPartial): EntityFilter { + return EntityFilter.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EntityFilter { + const message = createBaseEntityFilter(); + message.type = object.type ?? ""; + message.ids = object.ids?.map((e) => e) || []; + return message; + }, +}; + +function createBaseSubjectFilter(): SubjectFilter { + return { type: "", ids: [], relation: "" }; +} + +export const SubjectFilter: MessageFns = { + encode(message: SubjectFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== "") { + writer.uint32(10).string(message.type); + } + for (const v of message.ids) { + writer.uint32(18).string(v!); + } + if (message.relation !== "") { + writer.uint32(26).string(message.relation); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SubjectFilter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubjectFilter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.ids.push(reader.string()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.relation = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SubjectFilter { + return { + type: isSet(object.type) ? globalThis.String(object.type) : "", + ids: globalThis.Array.isArray(object?.ids) ? object.ids.map((e: any) => globalThis.String(e)) : [], + relation: isSet(object.relation) ? globalThis.String(object.relation) : "", + }; + }, + + toJSON(message: SubjectFilter): unknown { + const obj: any = {}; + if (message.type !== "") { + obj.type = message.type; + } + if (message.ids?.length) { + obj.ids = message.ids; + } + if (message.relation !== "") { + obj.relation = message.relation; + } + return obj; + }, + + create(base?: DeepPartial): SubjectFilter { + return SubjectFilter.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SubjectFilter { + const message = createBaseSubjectFilter(); + message.type = object.type ?? ""; + message.ids = object.ids?.map((e) => e) || []; + message.relation = object.relation ?? ""; + return message; + }, +}; + +function createBaseExpandTreeNode(): ExpandTreeNode { + return { operation: 0, children: [] }; +} + +export const ExpandTreeNode: MessageFns = { + encode(message: ExpandTreeNode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.operation !== 0) { + writer.uint32(8).int32(message.operation); + } + for (const v of message.children) { + Expand.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExpandTreeNode { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpandTreeNode(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.operation = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.children.push(Expand.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExpandTreeNode { + return { + operation: isSet(object.operation) ? expandTreeNode_OperationFromJSON(object.operation) : 0, + children: globalThis.Array.isArray(object?.children) ? object.children.map((e: any) => Expand.fromJSON(e)) : [], + }; + }, + + toJSON(message: ExpandTreeNode): unknown { + const obj: any = {}; + if (message.operation !== 0) { + obj.operation = expandTreeNode_OperationToJSON(message.operation); + } + if (message.children?.length) { + obj.children = message.children.map((e) => Expand.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ExpandTreeNode { + return ExpandTreeNode.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExpandTreeNode { + const message = createBaseExpandTreeNode(); + message.operation = object.operation ?? 0; + message.children = object.children?.map((e) => Expand.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseExpand(): Expand { + return { entity: undefined, permission: "", arguments: [], node: undefined }; +} + +export const Expand: MessageFns = { + encode(message: Expand, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(10).fork()).join(); + } + if (message.permission !== "") { + writer.uint32(18).string(message.permission); + } + for (const v of message.arguments) { + Argument.encode(v!, writer.uint32(26).fork()).join(); + } + switch (message.node?.$case) { + case "expand": + ExpandTreeNode.encode(message.node.expand, writer.uint32(34).fork()).join(); + break; + case "leaf": + ExpandLeaf.encode(message.node.leaf, writer.uint32(42).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expand { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpand(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.permission = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.arguments.push(Argument.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.node = { $case: "expand", expand: ExpandTreeNode.decode(reader, reader.uint32()) }; + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.node = { $case: "leaf", leaf: ExpandLeaf.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expand { + return { + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + permission: isSet(object.permission) ? globalThis.String(object.permission) : "", + arguments: globalThis.Array.isArray(object?.arguments) + ? object.arguments.map((e: any) => Argument.fromJSON(e)) + : [], + node: isSet(object.expand) + ? { $case: "expand", expand: ExpandTreeNode.fromJSON(object.expand) } + : isSet(object.leaf) + ? { $case: "leaf", leaf: ExpandLeaf.fromJSON(object.leaf) } + : undefined, + }; + }, + + toJSON(message: Expand): unknown { + const obj: any = {}; + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.permission !== "") { + obj.permission = message.permission; + } + if (message.arguments?.length) { + obj.arguments = message.arguments.map((e) => Argument.toJSON(e)); + } + if (message.node?.$case === "expand") { + obj.expand = ExpandTreeNode.toJSON(message.node.expand); + } else if (message.node?.$case === "leaf") { + obj.leaf = ExpandLeaf.toJSON(message.node.leaf); + } + return obj; + }, + + create(base?: DeepPartial): Expand { + return Expand.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expand { + const message = createBaseExpand(); + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.permission = object.permission ?? ""; + message.arguments = object.arguments?.map((e) => Argument.fromPartial(e)) || []; + switch (object.node?.$case) { + case "expand": { + if (object.node?.expand !== undefined && object.node?.expand !== null) { + message.node = { $case: "expand", expand: ExpandTreeNode.fromPartial(object.node.expand) }; + } + break; + } + case "leaf": { + if (object.node?.leaf !== undefined && object.node?.leaf !== null) { + message.node = { $case: "leaf", leaf: ExpandLeaf.fromPartial(object.node.leaf) }; + } + break; + } + } + return message; + }, +}; + +function createBaseExpandLeaf(): ExpandLeaf { + return { type: undefined }; +} + +export const ExpandLeaf: MessageFns = { + encode(message: ExpandLeaf, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + switch (message.type?.$case) { + case "subjects": + Subjects.encode(message.type.subjects, writer.uint32(10).fork()).join(); + break; + case "values": + Values.encode(message.type.values, writer.uint32(18).fork()).join(); + break; + case "value": + Any.encode(message.type.value, writer.uint32(26).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExpandLeaf { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpandLeaf(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = { $case: "subjects", subjects: Subjects.decode(reader, reader.uint32()) }; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.type = { $case: "values", values: Values.decode(reader, reader.uint32()) }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.type = { $case: "value", value: Any.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExpandLeaf { + return { + type: isSet(object.subjects) + ? { $case: "subjects", subjects: Subjects.fromJSON(object.subjects) } + : isSet(object.values) + ? { $case: "values", values: Values.fromJSON(object.values) } + : isSet(object.value) + ? { $case: "value", value: Any.fromJSON(object.value) } + : undefined, + }; + }, + + toJSON(message: ExpandLeaf): unknown { + const obj: any = {}; + if (message.type?.$case === "subjects") { + obj.subjects = Subjects.toJSON(message.type.subjects); + } else if (message.type?.$case === "values") { + obj.values = Values.toJSON(message.type.values); + } else if (message.type?.$case === "value") { + obj.value = Any.toJSON(message.type.value); + } + return obj; + }, + + create(base?: DeepPartial): ExpandLeaf { + return ExpandLeaf.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExpandLeaf { + const message = createBaseExpandLeaf(); + switch (object.type?.$case) { + case "subjects": { + if (object.type?.subjects !== undefined && object.type?.subjects !== null) { + message.type = { $case: "subjects", subjects: Subjects.fromPartial(object.type.subjects) }; + } + break; + } + case "values": { + if (object.type?.values !== undefined && object.type?.values !== null) { + message.type = { $case: "values", values: Values.fromPartial(object.type.values) }; + } + break; + } + case "value": { + if (object.type?.value !== undefined && object.type?.value !== null) { + message.type = { $case: "value", value: Any.fromPartial(object.type.value) }; + } + break; + } + } + return message; + }, +}; + +function createBaseValues(): Values { + return { values: {} }; +} + +export const Values: MessageFns = { + encode(message: Values, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.values).forEach(([key, value]) => { + Values_ValuesEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Values { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValues(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = Values_ValuesEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.values[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Values { + return { + values: isObject(object.values) + ? Object.entries(object.values).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + acc[key] = Any.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Values): unknown { + const obj: any = {}; + if (message.values) { + const entries = Object.entries(message.values); + if (entries.length > 0) { + obj.values = {}; + entries.forEach(([k, v]) => { + obj.values[k] = Any.toJSON(v); + }); + } + } + return obj; + }, + + create(base?: DeepPartial): Values { + return Values.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Values { + const message = createBaseValues(); + message.values = Object.entries(object.values ?? {}).reduce<{ [key: string]: Any }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Any.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseValues_ValuesEntry(): Values_ValuesEntry { + return { key: "", value: undefined }; +} + +export const Values_ValuesEntry: MessageFns = { + encode(message: Values_ValuesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Any.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Values_ValuesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValues_ValuesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Any.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Values_ValuesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Any.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Values_ValuesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Any.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): Values_ValuesEntry { + return Values_ValuesEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Values_ValuesEntry { + const message = createBaseValues_ValuesEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) ? Any.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseSubjects(): Subjects { + return { subjects: [] }; +} + +export const Subjects: MessageFns = { + encode(message: Subjects, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.subjects) { + Subject.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Subjects { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubjects(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.subjects.push(Subject.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Subjects { + return { + subjects: globalThis.Array.isArray(object?.subjects) ? object.subjects.map((e: any) => Subject.fromJSON(e)) : [], + }; + }, + + toJSON(message: Subjects): unknown { + const obj: any = {}; + if (message.subjects?.length) { + obj.subjects = message.subjects.map((e) => Subject.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Subjects { + return Subjects.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Subjects { + const message = createBaseSubjects(); + message.subjects = object.subjects?.map((e) => Subject.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseTenant(): Tenant { + return { id: "", name: "", createdAt: undefined }; +} + +export const Tenant: MessageFns = { + encode(message: Tenant, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.createdAt !== undefined) { + Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Tenant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTenant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.name = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Tenant { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined, + }; + }, + + toJSON(message: Tenant): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.createdAt !== undefined) { + obj.created_at = message.createdAt.toISOString(); + } + return obj; + }, + + create(base?: DeepPartial): Tenant { + return Tenant.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Tenant { + const message = createBaseTenant(); + message.id = object.id ?? ""; + message.name = object.name ?? ""; + message.createdAt = object.createdAt ?? undefined; + return message; + }, +}; + +function createBaseDataChanges(): DataChanges { + return { snapToken: "", dataChanges: [] }; +} + +export const DataChanges: MessageFns = { + encode(message: DataChanges, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + for (const v of message.dataChanges) { + DataChange.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataChanges { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataChanges(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.dataChanges.push(DataChange.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataChanges { + return { + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + dataChanges: globalThis.Array.isArray(object?.data_changes) + ? object.data_changes.map((e: any) => DataChange.fromJSON(e)) + : [], + }; + }, + + toJSON(message: DataChanges): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + if (message.dataChanges?.length) { + obj.data_changes = message.dataChanges.map((e) => DataChange.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): DataChanges { + return DataChanges.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataChanges { + const message = createBaseDataChanges(); + message.snapToken = object.snapToken ?? ""; + message.dataChanges = object.dataChanges?.map((e) => DataChange.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDataChange(): DataChange { + return { operation: 0, type: undefined }; +} + +export const DataChange: MessageFns = { + encode(message: DataChange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.operation !== 0) { + writer.uint32(8).int32(message.operation); + } + switch (message.type?.$case) { + case "tuple": + Tuple.encode(message.type.tuple, writer.uint32(18).fork()).join(); + break; + case "attribute": + Attribute.encode(message.type.attribute, writer.uint32(26).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataChange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataChange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.operation = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.type = { $case: "tuple", tuple: Tuple.decode(reader, reader.uint32()) }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.type = { $case: "attribute", attribute: Attribute.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataChange { + return { + operation: isSet(object.operation) ? dataChange_OperationFromJSON(object.operation) : 0, + type: isSet(object.tuple) + ? { $case: "tuple", tuple: Tuple.fromJSON(object.tuple) } + : isSet(object.attribute) + ? { $case: "attribute", attribute: Attribute.fromJSON(object.attribute) } + : undefined, + }; + }, + + toJSON(message: DataChange): unknown { + const obj: any = {}; + if (message.operation !== 0) { + obj.operation = dataChange_OperationToJSON(message.operation); + } + if (message.type?.$case === "tuple") { + obj.tuple = Tuple.toJSON(message.type.tuple); + } else if (message.type?.$case === "attribute") { + obj.attribute = Attribute.toJSON(message.type.attribute); + } + return obj; + }, + + create(base?: DeepPartial): DataChange { + return DataChange.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataChange { + const message = createBaseDataChange(); + message.operation = object.operation ?? 0; + switch (object.type?.$case) { + case "tuple": { + if (object.type?.tuple !== undefined && object.type?.tuple !== null) { + message.type = { $case: "tuple", tuple: Tuple.fromPartial(object.type.tuple) }; + } + break; + } + case "attribute": { + if (object.type?.attribute !== undefined && object.type?.attribute !== null) { + message.type = { $case: "attribute", attribute: Attribute.fromPartial(object.type.attribute) }; + } + break; + } + } + return message; + }, +}; + +function createBaseStringValue(): StringValue { + return { data: "" }; +} + +export const StringValue: MessageFns = { + encode(message: StringValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.data !== "") { + writer.uint32(10).string(message.data); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StringValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.data = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StringValue { + return { data: isSet(object.data) ? globalThis.String(object.data) : "" }; + }, + + toJSON(message: StringValue): unknown { + const obj: any = {}; + if (message.data !== "") { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): StringValue { + return StringValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): StringValue { + const message = createBaseStringValue(); + message.data = object.data ?? ""; + return message; + }, +}; + +function createBaseIntegerValue(): IntegerValue { + return { data: 0 }; +} + +export const IntegerValue: MessageFns = { + encode(message: IntegerValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.data !== 0) { + writer.uint32(8).int32(message.data); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): IntegerValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntegerValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.data = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): IntegerValue { + return { data: isSet(object.data) ? globalThis.Number(object.data) : 0 }; + }, + + toJSON(message: IntegerValue): unknown { + const obj: any = {}; + if (message.data !== 0) { + obj.data = Math.round(message.data); + } + return obj; + }, + + create(base?: DeepPartial): IntegerValue { + return IntegerValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): IntegerValue { + const message = createBaseIntegerValue(); + message.data = object.data ?? 0; + return message; + }, +}; + +function createBaseDoubleValue(): DoubleValue { + return { data: 0 }; +} + +export const DoubleValue: MessageFns = { + encode(message: DoubleValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.data !== 0) { + writer.uint32(9).double(message.data); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DoubleValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDoubleValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.data = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DoubleValue { + return { data: isSet(object.data) ? globalThis.Number(object.data) : 0 }; + }, + + toJSON(message: DoubleValue): unknown { + const obj: any = {}; + if (message.data !== 0) { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): DoubleValue { + return DoubleValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DoubleValue { + const message = createBaseDoubleValue(); + message.data = object.data ?? 0; + return message; + }, +}; + +function createBaseBooleanValue(): BooleanValue { + return { data: false }; +} + +export const BooleanValue: MessageFns = { + encode(message: BooleanValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.data !== false) { + writer.uint32(8).bool(message.data); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BooleanValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBooleanValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.data = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BooleanValue { + return { data: isSet(object.data) ? globalThis.Boolean(object.data) : false }; + }, + + toJSON(message: BooleanValue): unknown { + const obj: any = {}; + if (message.data !== false) { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): BooleanValue { + return BooleanValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BooleanValue { + const message = createBaseBooleanValue(); + message.data = object.data ?? false; + return message; + }, +}; + +function createBaseStringArrayValue(): StringArrayValue { + return { data: [] }; +} + +export const StringArrayValue: MessageFns = { + encode(message: StringArrayValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.data) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StringArrayValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringArrayValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.data.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StringArrayValue { + return { data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => globalThis.String(e)) : [] }; + }, + + toJSON(message: StringArrayValue): unknown { + const obj: any = {}; + if (message.data?.length) { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): StringArrayValue { + return StringArrayValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): StringArrayValue { + const message = createBaseStringArrayValue(); + message.data = object.data?.map((e) => e) || []; + return message; + }, +}; + +function createBaseIntegerArrayValue(): IntegerArrayValue { + return { data: [] }; +} + +export const IntegerArrayValue: MessageFns = { + encode(message: IntegerArrayValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.data) { + writer.int32(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): IntegerArrayValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntegerArrayValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.data.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.data.push(reader.int32()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): IntegerArrayValue { + return { data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => globalThis.Number(e)) : [] }; + }, + + toJSON(message: IntegerArrayValue): unknown { + const obj: any = {}; + if (message.data?.length) { + obj.data = message.data.map((e) => Math.round(e)); + } + return obj; + }, + + create(base?: DeepPartial): IntegerArrayValue { + return IntegerArrayValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): IntegerArrayValue { + const message = createBaseIntegerArrayValue(); + message.data = object.data?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDoubleArrayValue(): DoubleArrayValue { + return { data: [] }; +} + +export const DoubleArrayValue: MessageFns = { + encode(message: DoubleArrayValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.data) { + writer.double(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DoubleArrayValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDoubleArrayValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 9) { + message.data.push(reader.double()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.data.push(reader.double()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DoubleArrayValue { + return { data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => globalThis.Number(e)) : [] }; + }, + + toJSON(message: DoubleArrayValue): unknown { + const obj: any = {}; + if (message.data?.length) { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): DoubleArrayValue { + return DoubleArrayValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DoubleArrayValue { + const message = createBaseDoubleArrayValue(); + message.data = object.data?.map((e) => e) || []; + return message; + }, +}; + +function createBaseBooleanArrayValue(): BooleanArrayValue { + return { data: [] }; +} + +export const BooleanArrayValue: MessageFns = { + encode(message: BooleanArrayValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.data) { + writer.bool(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BooleanArrayValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBooleanArrayValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.data.push(reader.bool()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.data.push(reader.bool()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BooleanArrayValue { + return { data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => globalThis.Boolean(e)) : [] }; + }, + + toJSON(message: BooleanArrayValue): unknown { + const obj: any = {}; + if (message.data?.length) { + obj.data = message.data; + } + return obj; + }, + + create(base?: DeepPartial): BooleanArrayValue { + return BooleanArrayValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BooleanArrayValue { + const message = createBaseBooleanArrayValue(); + message.data = object.data?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDataBundle(): DataBundle { + return { name: "", arguments: [], operations: [] }; +} + +export const DataBundle: MessageFns = { + encode(message: DataBundle, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.arguments) { + writer.uint32(18).string(v!); + } + for (const v of message.operations) { + Operation.encode(v!, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataBundle { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataBundle(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.arguments.push(reader.string()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.operations.push(Operation.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataBundle { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + arguments: globalThis.Array.isArray(object?.arguments) + ? object.arguments.map((e: any) => globalThis.String(e)) + : [], + operations: globalThis.Array.isArray(object?.operations) + ? object.operations.map((e: any) => Operation.fromJSON(e)) + : [], + }; + }, + + toJSON(message: DataBundle): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.arguments?.length) { + obj.arguments = message.arguments; + } + if (message.operations?.length) { + obj.operations = message.operations.map((e) => Operation.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): DataBundle { + return DataBundle.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataBundle { + const message = createBaseDataBundle(); + message.name = object.name ?? ""; + message.arguments = object.arguments?.map((e) => e) || []; + message.operations = object.operations?.map((e) => Operation.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseOperation(): Operation { + return { relationshipsWrite: [], relationshipsDelete: [], attributesWrite: [], attributesDelete: [] }; +} + +export const Operation: MessageFns = { + encode(message: Operation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.relationshipsWrite) { + writer.uint32(10).string(v!); + } + for (const v of message.relationshipsDelete) { + writer.uint32(18).string(v!); + } + for (const v of message.attributesWrite) { + writer.uint32(26).string(v!); + } + for (const v of message.attributesDelete) { + writer.uint32(34).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Operation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOperation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.relationshipsWrite.push(reader.string()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.relationshipsDelete.push(reader.string()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.attributesWrite.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.attributesDelete.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Operation { + return { + relationshipsWrite: globalThis.Array.isArray(object?.relationships_write) + ? object.relationships_write.map((e: any) => globalThis.String(e)) + : [], + relationshipsDelete: globalThis.Array.isArray(object?.relationships_delete) + ? object.relationships_delete.map((e: any) => globalThis.String(e)) + : [], + attributesWrite: globalThis.Array.isArray(object?.attributes_write) + ? object.attributes_write.map((e: any) => globalThis.String(e)) + : [], + attributesDelete: globalThis.Array.isArray(object?.attributes_delete) + ? object.attributes_delete.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: Operation): unknown { + const obj: any = {}; + if (message.relationshipsWrite?.length) { + obj.relationships_write = message.relationshipsWrite; + } + if (message.relationshipsDelete?.length) { + obj.relationships_delete = message.relationshipsDelete; + } + if (message.attributesWrite?.length) { + obj.attributes_write = message.attributesWrite; + } + if (message.attributesDelete?.length) { + obj.attributes_delete = message.attributesDelete; + } + return obj; + }, + + create(base?: DeepPartial): Operation { + return Operation.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Operation { + const message = createBaseOperation(); + message.relationshipsWrite = object.relationshipsWrite?.map((e) => e) || []; + message.relationshipsDelete = object.relationshipsDelete?.map((e) => e) || []; + message.attributesWrite = object.attributesWrite?.map((e) => e) || []; + message.attributesDelete = object.attributesDelete?.map((e) => e) || []; + return message; + }, +}; + +function createBasePartials(): Partials { + return { write: [], delete: [], update: [] }; +} + +export const Partials: MessageFns = { + encode(message: Partials, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.write) { + writer.uint32(10).string(v!); + } + for (const v of message.delete) { + writer.uint32(18).string(v!); + } + for (const v of message.update) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Partials { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePartials(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.write.push(reader.string()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.delete.push(reader.string()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.update.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Partials { + return { + write: globalThis.Array.isArray(object?.write) ? object.write.map((e: any) => globalThis.String(e)) : [], + delete: globalThis.Array.isArray(object?.delete) ? object.delete.map((e: any) => globalThis.String(e)) : [], + update: globalThis.Array.isArray(object?.update) ? object.update.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: Partials): unknown { + const obj: any = {}; + if (message.write?.length) { + obj.write = message.write; + } + if (message.delete?.length) { + obj.delete = message.delete; + } + if (message.update?.length) { + obj.update = message.update; + } + return obj; + }, + + create(base?: DeepPartial): Partials { + return Partials.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Partials { + const message = createBasePartials(); + message.write = object.write?.map((e) => e) || []; + message.delete = object.delete?.map((e) => e) || []; + message.update = object.update?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(Math.trunc(date.getTime() / 1_000)); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds.toNumber() || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new globalThis.Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof globalThis.Date) { + return o; + } else if (typeof o === "string") { + return new globalThis.Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/base/v1/errors.ts b/src/grpc/generated/base/v1/errors.ts new file mode 100644 index 0000000..4c5e3b9 --- /dev/null +++ b/src/grpc/generated/base/v1/errors.ts @@ -0,0 +1,566 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: base/v1/errors.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "base.v1"; + +export enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0, + /** ERROR_CODE_MISSING_BEARER_TOKEN - authn */ + ERROR_CODE_MISSING_BEARER_TOKEN = 1001, + ERROR_CODE_UNAUTHENTICATED = 1002, + ERROR_CODE_MISSING_TENANT_ID = 1003, + ERROR_CODE_INVALID_AUDIENCE = 1004, + ERROR_CODE_INVALID_CLAIMS = 1005, + ERROR_CODE_INVALID_ISSUER = 1006, + ERROR_CODE_INVALID_BEARER_TOKEN = 1007, + /** ERROR_CODE_VALIDATION - validation */ + ERROR_CODE_VALIDATION = 2000, + ERROR_CODE_UNDEFINED_CHILD_TYPE = 2002, + ERROR_CODE_UNDEFINED_CHILD_KIND = 2003, + ERROR_CODE_UNDEFINED_RELATION_REFERENCE = 2006, + ERROR_CODE_NOT_SUPPORTED_RELATION_WALK = 2007, + ERROR_CODE_ENTITY_AND_SUBJECT_CANNOT_BE_EQUAL = 2008, + ERROR_CODE_DEPTH_NOT_ENOUGH = 2009, + ERROR_CODE_RELATION_REFERENCE_NOT_FOUND_IN_ENTITY_REFERENCES = 2010, + ERROR_CODE_RELATION_REFERENCE_MUST_HAVE_ONE_ENTITY_REFERENCE = 2011, + ERROR_CODE_DUPLICATED_ENTITY_REFERENCE = 2012, + ERROR_CODE_DUPLICATED_RELATION_REFERENCE = 2013, + ERROR_CODE_DUPLICATED_PERMISSION_REFERENCE = 2014, + ERROR_CODE_SCHEMA_PARSE = 2015, + ERROR_CODE_SCHEMA_COMPILE = 2016, + ERROR_CODE_SUBJECT_RELATION_MUST_BE_EMPTY = 2017, + ERROR_CODE_SUBJECT_RELATION_CANNOT_BE_EMPTY = 2018, + ERROR_CODE_SCHEMA_MUST_HAVE_USER_ENTITY_DEFINITION = 2019, + ERROR_CODE_UNIQUE_CONSTRAINT = 2020, + ERROR_CODE_INVALID_CONTINUOUS_TOKEN = 2021, + ERROR_CODE_INVALID_KEY = 2022, + ERROR_CODE_ENTITY_TYPE_REQUIRED = 2023, + ERROR_CODE_NO_ENTITY_REFERENCES_FOUND_IN_SCHEMA = 2024, + ERROR_CODE_INVALID_ARGUMENT = 2025, + ERROR_CODE_INVALID_RULE_REFERENCE = 2026, + ERROR_CODE_NOT_SUPPORTED_WALK = 2027, + ERROR_CODE_MISSING_ARGUMENT = 2028, + ERROR_CODE_ALREADY_EXIST = 2029, + ERROR_CODE_MAX_DATA_PER_WRITE_EXCEEDED = 2030, + /** ERROR_CODE_NOT_FOUND - not found */ + ERROR_CODE_NOT_FOUND = 4000, + ERROR_CODE_ENTITY_TYPE_NOT_FOUND = 4001, + ERROR_CODE_PERMISSION_NOT_FOUND = 4002, + ERROR_CODE_SCHEMA_NOT_FOUND = 4003, + ERROR_CODE_SUBJECT_TYPE_NOT_FOUND = 4004, + ERROR_CODE_ENTITY_DEFINITION_NOT_FOUND = 4005, + ERROR_CODE_PERMISSION_DEFINITION_NOT_FOUND = 4006, + ERROR_CODE_RELATION_DEFINITION_NOT_FOUND = 4007, + ERROR_CODE_RECORD_NOT_FOUND = 4008, + ERROR_CODE_TENANT_NOT_FOUND = 4009, + ERROR_CODE_ATTRIBUTE_DEFINITION_NOT_FOUND = 4010, + ERROR_CODE_ATTRIBUTE_TYPE_MISMATCH = 4011, + ERROR_CODE_BUNDLE_NOT_FOUND = 4012, + ERROR_CODE_RULE_DEFINITION_NOT_FOUND = 4013, + ERROR_CODE_ENTITY_STATEMENT_NOT_FOUND = 4014, + ERROR_CODE_REFERENCE_NOT_FOUND = 4015, + /** ERROR_CODE_INTERNAL - internal */ + ERROR_CODE_INTERNAL = 5000, + ERROR_CODE_CANCELLED = 5001, + ERROR_CODE_SQL_BUILDER = 5002, + ERROR_CODE_CIRCUIT_BREAKER = 5003, + ERROR_CODE_EXECUTION = 5005, + ERROR_CODE_SCAN = 5006, + ERROR_CODE_MIGRATION = 5007, + ERROR_CODE_TYPE_CONVERSATION = 5008, + ERROR_CODE_ERROR_MAX_RETRIES = 5009, + ERROR_CODE_ROLLBACK = 5010, + ERROR_CODE_EXCLUSION_REQUIRES_MORE_THAN_ONE_FUNCTION = 5011, + ERROR_CODE_NOT_IMPLEMENTED = 5012, + ERROR_CODE_DATASTORE = 5013, + ERROR_CODE_UNKNOWN_STATEMENT_TYPE = 5014, + ERROR_CODE_UNKNOWN_REFERENCE_TYPE = 5015, + ERROR_CODE_CANNOT_CONVERT_TO_ENTITY_STATEMENT = 5016, + ERROR_CODE_CANNOT_CONVERT_TO_RELATION_STATEMENT = 5017, + ERROR_CODE_CANNOT_CONVERT_TO_ATTRIBUTE_STATEMENT = 5018, + ERROR_CODE_SERIALIZATION = 5019, + UNRECOGNIZED = -1, +} + +export function errorCodeFromJSON(object: any): ErrorCode { + switch (object) { + case 0: + case "ERROR_CODE_UNSPECIFIED": + return ErrorCode.ERROR_CODE_UNSPECIFIED; + case 1001: + case "ERROR_CODE_MISSING_BEARER_TOKEN": + return ErrorCode.ERROR_CODE_MISSING_BEARER_TOKEN; + case 1002: + case "ERROR_CODE_UNAUTHENTICATED": + return ErrorCode.ERROR_CODE_UNAUTHENTICATED; + case 1003: + case "ERROR_CODE_MISSING_TENANT_ID": + return ErrorCode.ERROR_CODE_MISSING_TENANT_ID; + case 1004: + case "ERROR_CODE_INVALID_AUDIENCE": + return ErrorCode.ERROR_CODE_INVALID_AUDIENCE; + case 1005: + case "ERROR_CODE_INVALID_CLAIMS": + return ErrorCode.ERROR_CODE_INVALID_CLAIMS; + case 1006: + case "ERROR_CODE_INVALID_ISSUER": + return ErrorCode.ERROR_CODE_INVALID_ISSUER; + case 1007: + case "ERROR_CODE_INVALID_BEARER_TOKEN": + return ErrorCode.ERROR_CODE_INVALID_BEARER_TOKEN; + case 2000: + case "ERROR_CODE_VALIDATION": + return ErrorCode.ERROR_CODE_VALIDATION; + case 2002: + case "ERROR_CODE_UNDEFINED_CHILD_TYPE": + return ErrorCode.ERROR_CODE_UNDEFINED_CHILD_TYPE; + case 2003: + case "ERROR_CODE_UNDEFINED_CHILD_KIND": + return ErrorCode.ERROR_CODE_UNDEFINED_CHILD_KIND; + case 2006: + case "ERROR_CODE_UNDEFINED_RELATION_REFERENCE": + return ErrorCode.ERROR_CODE_UNDEFINED_RELATION_REFERENCE; + case 2007: + case "ERROR_CODE_NOT_SUPPORTED_RELATION_WALK": + return ErrorCode.ERROR_CODE_NOT_SUPPORTED_RELATION_WALK; + case 2008: + case "ERROR_CODE_ENTITY_AND_SUBJECT_CANNOT_BE_EQUAL": + return ErrorCode.ERROR_CODE_ENTITY_AND_SUBJECT_CANNOT_BE_EQUAL; + case 2009: + case "ERROR_CODE_DEPTH_NOT_ENOUGH": + return ErrorCode.ERROR_CODE_DEPTH_NOT_ENOUGH; + case 2010: + case "ERROR_CODE_RELATION_REFERENCE_NOT_FOUND_IN_ENTITY_REFERENCES": + return ErrorCode.ERROR_CODE_RELATION_REFERENCE_NOT_FOUND_IN_ENTITY_REFERENCES; + case 2011: + case "ERROR_CODE_RELATION_REFERENCE_MUST_HAVE_ONE_ENTITY_REFERENCE": + return ErrorCode.ERROR_CODE_RELATION_REFERENCE_MUST_HAVE_ONE_ENTITY_REFERENCE; + case 2012: + case "ERROR_CODE_DUPLICATED_ENTITY_REFERENCE": + return ErrorCode.ERROR_CODE_DUPLICATED_ENTITY_REFERENCE; + case 2013: + case "ERROR_CODE_DUPLICATED_RELATION_REFERENCE": + return ErrorCode.ERROR_CODE_DUPLICATED_RELATION_REFERENCE; + case 2014: + case "ERROR_CODE_DUPLICATED_PERMISSION_REFERENCE": + return ErrorCode.ERROR_CODE_DUPLICATED_PERMISSION_REFERENCE; + case 2015: + case "ERROR_CODE_SCHEMA_PARSE": + return ErrorCode.ERROR_CODE_SCHEMA_PARSE; + case 2016: + case "ERROR_CODE_SCHEMA_COMPILE": + return ErrorCode.ERROR_CODE_SCHEMA_COMPILE; + case 2017: + case "ERROR_CODE_SUBJECT_RELATION_MUST_BE_EMPTY": + return ErrorCode.ERROR_CODE_SUBJECT_RELATION_MUST_BE_EMPTY; + case 2018: + case "ERROR_CODE_SUBJECT_RELATION_CANNOT_BE_EMPTY": + return ErrorCode.ERROR_CODE_SUBJECT_RELATION_CANNOT_BE_EMPTY; + case 2019: + case "ERROR_CODE_SCHEMA_MUST_HAVE_USER_ENTITY_DEFINITION": + return ErrorCode.ERROR_CODE_SCHEMA_MUST_HAVE_USER_ENTITY_DEFINITION; + case 2020: + case "ERROR_CODE_UNIQUE_CONSTRAINT": + return ErrorCode.ERROR_CODE_UNIQUE_CONSTRAINT; + case 2021: + case "ERROR_CODE_INVALID_CONTINUOUS_TOKEN": + return ErrorCode.ERROR_CODE_INVALID_CONTINUOUS_TOKEN; + case 2022: + case "ERROR_CODE_INVALID_KEY": + return ErrorCode.ERROR_CODE_INVALID_KEY; + case 2023: + case "ERROR_CODE_ENTITY_TYPE_REQUIRED": + return ErrorCode.ERROR_CODE_ENTITY_TYPE_REQUIRED; + case 2024: + case "ERROR_CODE_NO_ENTITY_REFERENCES_FOUND_IN_SCHEMA": + return ErrorCode.ERROR_CODE_NO_ENTITY_REFERENCES_FOUND_IN_SCHEMA; + case 2025: + case "ERROR_CODE_INVALID_ARGUMENT": + return ErrorCode.ERROR_CODE_INVALID_ARGUMENT; + case 2026: + case "ERROR_CODE_INVALID_RULE_REFERENCE": + return ErrorCode.ERROR_CODE_INVALID_RULE_REFERENCE; + case 2027: + case "ERROR_CODE_NOT_SUPPORTED_WALK": + return ErrorCode.ERROR_CODE_NOT_SUPPORTED_WALK; + case 2028: + case "ERROR_CODE_MISSING_ARGUMENT": + return ErrorCode.ERROR_CODE_MISSING_ARGUMENT; + case 2029: + case "ERROR_CODE_ALREADY_EXIST": + return ErrorCode.ERROR_CODE_ALREADY_EXIST; + case 2030: + case "ERROR_CODE_MAX_DATA_PER_WRITE_EXCEEDED": + return ErrorCode.ERROR_CODE_MAX_DATA_PER_WRITE_EXCEEDED; + case 4000: + case "ERROR_CODE_NOT_FOUND": + return ErrorCode.ERROR_CODE_NOT_FOUND; + case 4001: + case "ERROR_CODE_ENTITY_TYPE_NOT_FOUND": + return ErrorCode.ERROR_CODE_ENTITY_TYPE_NOT_FOUND; + case 4002: + case "ERROR_CODE_PERMISSION_NOT_FOUND": + return ErrorCode.ERROR_CODE_PERMISSION_NOT_FOUND; + case 4003: + case "ERROR_CODE_SCHEMA_NOT_FOUND": + return ErrorCode.ERROR_CODE_SCHEMA_NOT_FOUND; + case 4004: + case "ERROR_CODE_SUBJECT_TYPE_NOT_FOUND": + return ErrorCode.ERROR_CODE_SUBJECT_TYPE_NOT_FOUND; + case 4005: + case "ERROR_CODE_ENTITY_DEFINITION_NOT_FOUND": + return ErrorCode.ERROR_CODE_ENTITY_DEFINITION_NOT_FOUND; + case 4006: + case "ERROR_CODE_PERMISSION_DEFINITION_NOT_FOUND": + return ErrorCode.ERROR_CODE_PERMISSION_DEFINITION_NOT_FOUND; + case 4007: + case "ERROR_CODE_RELATION_DEFINITION_NOT_FOUND": + return ErrorCode.ERROR_CODE_RELATION_DEFINITION_NOT_FOUND; + case 4008: + case "ERROR_CODE_RECORD_NOT_FOUND": + return ErrorCode.ERROR_CODE_RECORD_NOT_FOUND; + case 4009: + case "ERROR_CODE_TENANT_NOT_FOUND": + return ErrorCode.ERROR_CODE_TENANT_NOT_FOUND; + case 4010: + case "ERROR_CODE_ATTRIBUTE_DEFINITION_NOT_FOUND": + return ErrorCode.ERROR_CODE_ATTRIBUTE_DEFINITION_NOT_FOUND; + case 4011: + case "ERROR_CODE_ATTRIBUTE_TYPE_MISMATCH": + return ErrorCode.ERROR_CODE_ATTRIBUTE_TYPE_MISMATCH; + case 4012: + case "ERROR_CODE_BUNDLE_NOT_FOUND": + return ErrorCode.ERROR_CODE_BUNDLE_NOT_FOUND; + case 4013: + case "ERROR_CODE_RULE_DEFINITION_NOT_FOUND": + return ErrorCode.ERROR_CODE_RULE_DEFINITION_NOT_FOUND; + case 4014: + case "ERROR_CODE_ENTITY_STATEMENT_NOT_FOUND": + return ErrorCode.ERROR_CODE_ENTITY_STATEMENT_NOT_FOUND; + case 4015: + case "ERROR_CODE_REFERENCE_NOT_FOUND": + return ErrorCode.ERROR_CODE_REFERENCE_NOT_FOUND; + case 5000: + case "ERROR_CODE_INTERNAL": + return ErrorCode.ERROR_CODE_INTERNAL; + case 5001: + case "ERROR_CODE_CANCELLED": + return ErrorCode.ERROR_CODE_CANCELLED; + case 5002: + case "ERROR_CODE_SQL_BUILDER": + return ErrorCode.ERROR_CODE_SQL_BUILDER; + case 5003: + case "ERROR_CODE_CIRCUIT_BREAKER": + return ErrorCode.ERROR_CODE_CIRCUIT_BREAKER; + case 5005: + case "ERROR_CODE_EXECUTION": + return ErrorCode.ERROR_CODE_EXECUTION; + case 5006: + case "ERROR_CODE_SCAN": + return ErrorCode.ERROR_CODE_SCAN; + case 5007: + case "ERROR_CODE_MIGRATION": + return ErrorCode.ERROR_CODE_MIGRATION; + case 5008: + case "ERROR_CODE_TYPE_CONVERSATION": + return ErrorCode.ERROR_CODE_TYPE_CONVERSATION; + case 5009: + case "ERROR_CODE_ERROR_MAX_RETRIES": + return ErrorCode.ERROR_CODE_ERROR_MAX_RETRIES; + case 5010: + case "ERROR_CODE_ROLLBACK": + return ErrorCode.ERROR_CODE_ROLLBACK; + case 5011: + case "ERROR_CODE_EXCLUSION_REQUIRES_MORE_THAN_ONE_FUNCTION": + return ErrorCode.ERROR_CODE_EXCLUSION_REQUIRES_MORE_THAN_ONE_FUNCTION; + case 5012: + case "ERROR_CODE_NOT_IMPLEMENTED": + return ErrorCode.ERROR_CODE_NOT_IMPLEMENTED; + case 5013: + case "ERROR_CODE_DATASTORE": + return ErrorCode.ERROR_CODE_DATASTORE; + case 5014: + case "ERROR_CODE_UNKNOWN_STATEMENT_TYPE": + return ErrorCode.ERROR_CODE_UNKNOWN_STATEMENT_TYPE; + case 5015: + case "ERROR_CODE_UNKNOWN_REFERENCE_TYPE": + return ErrorCode.ERROR_CODE_UNKNOWN_REFERENCE_TYPE; + case 5016: + case "ERROR_CODE_CANNOT_CONVERT_TO_ENTITY_STATEMENT": + return ErrorCode.ERROR_CODE_CANNOT_CONVERT_TO_ENTITY_STATEMENT; + case 5017: + case "ERROR_CODE_CANNOT_CONVERT_TO_RELATION_STATEMENT": + return ErrorCode.ERROR_CODE_CANNOT_CONVERT_TO_RELATION_STATEMENT; + case 5018: + case "ERROR_CODE_CANNOT_CONVERT_TO_ATTRIBUTE_STATEMENT": + return ErrorCode.ERROR_CODE_CANNOT_CONVERT_TO_ATTRIBUTE_STATEMENT; + case 5019: + case "ERROR_CODE_SERIALIZATION": + return ErrorCode.ERROR_CODE_SERIALIZATION; + case -1: + case "UNRECOGNIZED": + default: + return ErrorCode.UNRECOGNIZED; + } +} + +export function errorCodeToJSON(object: ErrorCode): string { + switch (object) { + case ErrorCode.ERROR_CODE_UNSPECIFIED: + return "ERROR_CODE_UNSPECIFIED"; + case ErrorCode.ERROR_CODE_MISSING_BEARER_TOKEN: + return "ERROR_CODE_MISSING_BEARER_TOKEN"; + case ErrorCode.ERROR_CODE_UNAUTHENTICATED: + return "ERROR_CODE_UNAUTHENTICATED"; + case ErrorCode.ERROR_CODE_MISSING_TENANT_ID: + return "ERROR_CODE_MISSING_TENANT_ID"; + case ErrorCode.ERROR_CODE_INVALID_AUDIENCE: + return "ERROR_CODE_INVALID_AUDIENCE"; + case ErrorCode.ERROR_CODE_INVALID_CLAIMS: + return "ERROR_CODE_INVALID_CLAIMS"; + case ErrorCode.ERROR_CODE_INVALID_ISSUER: + return "ERROR_CODE_INVALID_ISSUER"; + case ErrorCode.ERROR_CODE_INVALID_BEARER_TOKEN: + return "ERROR_CODE_INVALID_BEARER_TOKEN"; + case ErrorCode.ERROR_CODE_VALIDATION: + return "ERROR_CODE_VALIDATION"; + case ErrorCode.ERROR_CODE_UNDEFINED_CHILD_TYPE: + return "ERROR_CODE_UNDEFINED_CHILD_TYPE"; + case ErrorCode.ERROR_CODE_UNDEFINED_CHILD_KIND: + return "ERROR_CODE_UNDEFINED_CHILD_KIND"; + case ErrorCode.ERROR_CODE_UNDEFINED_RELATION_REFERENCE: + return "ERROR_CODE_UNDEFINED_RELATION_REFERENCE"; + case ErrorCode.ERROR_CODE_NOT_SUPPORTED_RELATION_WALK: + return "ERROR_CODE_NOT_SUPPORTED_RELATION_WALK"; + case ErrorCode.ERROR_CODE_ENTITY_AND_SUBJECT_CANNOT_BE_EQUAL: + return "ERROR_CODE_ENTITY_AND_SUBJECT_CANNOT_BE_EQUAL"; + case ErrorCode.ERROR_CODE_DEPTH_NOT_ENOUGH: + return "ERROR_CODE_DEPTH_NOT_ENOUGH"; + case ErrorCode.ERROR_CODE_RELATION_REFERENCE_NOT_FOUND_IN_ENTITY_REFERENCES: + return "ERROR_CODE_RELATION_REFERENCE_NOT_FOUND_IN_ENTITY_REFERENCES"; + case ErrorCode.ERROR_CODE_RELATION_REFERENCE_MUST_HAVE_ONE_ENTITY_REFERENCE: + return "ERROR_CODE_RELATION_REFERENCE_MUST_HAVE_ONE_ENTITY_REFERENCE"; + case ErrorCode.ERROR_CODE_DUPLICATED_ENTITY_REFERENCE: + return "ERROR_CODE_DUPLICATED_ENTITY_REFERENCE"; + case ErrorCode.ERROR_CODE_DUPLICATED_RELATION_REFERENCE: + return "ERROR_CODE_DUPLICATED_RELATION_REFERENCE"; + case ErrorCode.ERROR_CODE_DUPLICATED_PERMISSION_REFERENCE: + return "ERROR_CODE_DUPLICATED_PERMISSION_REFERENCE"; + case ErrorCode.ERROR_CODE_SCHEMA_PARSE: + return "ERROR_CODE_SCHEMA_PARSE"; + case ErrorCode.ERROR_CODE_SCHEMA_COMPILE: + return "ERROR_CODE_SCHEMA_COMPILE"; + case ErrorCode.ERROR_CODE_SUBJECT_RELATION_MUST_BE_EMPTY: + return "ERROR_CODE_SUBJECT_RELATION_MUST_BE_EMPTY"; + case ErrorCode.ERROR_CODE_SUBJECT_RELATION_CANNOT_BE_EMPTY: + return "ERROR_CODE_SUBJECT_RELATION_CANNOT_BE_EMPTY"; + case ErrorCode.ERROR_CODE_SCHEMA_MUST_HAVE_USER_ENTITY_DEFINITION: + return "ERROR_CODE_SCHEMA_MUST_HAVE_USER_ENTITY_DEFINITION"; + case ErrorCode.ERROR_CODE_UNIQUE_CONSTRAINT: + return "ERROR_CODE_UNIQUE_CONSTRAINT"; + case ErrorCode.ERROR_CODE_INVALID_CONTINUOUS_TOKEN: + return "ERROR_CODE_INVALID_CONTINUOUS_TOKEN"; + case ErrorCode.ERROR_CODE_INVALID_KEY: + return "ERROR_CODE_INVALID_KEY"; + case ErrorCode.ERROR_CODE_ENTITY_TYPE_REQUIRED: + return "ERROR_CODE_ENTITY_TYPE_REQUIRED"; + case ErrorCode.ERROR_CODE_NO_ENTITY_REFERENCES_FOUND_IN_SCHEMA: + return "ERROR_CODE_NO_ENTITY_REFERENCES_FOUND_IN_SCHEMA"; + case ErrorCode.ERROR_CODE_INVALID_ARGUMENT: + return "ERROR_CODE_INVALID_ARGUMENT"; + case ErrorCode.ERROR_CODE_INVALID_RULE_REFERENCE: + return "ERROR_CODE_INVALID_RULE_REFERENCE"; + case ErrorCode.ERROR_CODE_NOT_SUPPORTED_WALK: + return "ERROR_CODE_NOT_SUPPORTED_WALK"; + case ErrorCode.ERROR_CODE_MISSING_ARGUMENT: + return "ERROR_CODE_MISSING_ARGUMENT"; + case ErrorCode.ERROR_CODE_ALREADY_EXIST: + return "ERROR_CODE_ALREADY_EXIST"; + case ErrorCode.ERROR_CODE_MAX_DATA_PER_WRITE_EXCEEDED: + return "ERROR_CODE_MAX_DATA_PER_WRITE_EXCEEDED"; + case ErrorCode.ERROR_CODE_NOT_FOUND: + return "ERROR_CODE_NOT_FOUND"; + case ErrorCode.ERROR_CODE_ENTITY_TYPE_NOT_FOUND: + return "ERROR_CODE_ENTITY_TYPE_NOT_FOUND"; + case ErrorCode.ERROR_CODE_PERMISSION_NOT_FOUND: + return "ERROR_CODE_PERMISSION_NOT_FOUND"; + case ErrorCode.ERROR_CODE_SCHEMA_NOT_FOUND: + return "ERROR_CODE_SCHEMA_NOT_FOUND"; + case ErrorCode.ERROR_CODE_SUBJECT_TYPE_NOT_FOUND: + return "ERROR_CODE_SUBJECT_TYPE_NOT_FOUND"; + case ErrorCode.ERROR_CODE_ENTITY_DEFINITION_NOT_FOUND: + return "ERROR_CODE_ENTITY_DEFINITION_NOT_FOUND"; + case ErrorCode.ERROR_CODE_PERMISSION_DEFINITION_NOT_FOUND: + return "ERROR_CODE_PERMISSION_DEFINITION_NOT_FOUND"; + case ErrorCode.ERROR_CODE_RELATION_DEFINITION_NOT_FOUND: + return "ERROR_CODE_RELATION_DEFINITION_NOT_FOUND"; + case ErrorCode.ERROR_CODE_RECORD_NOT_FOUND: + return "ERROR_CODE_RECORD_NOT_FOUND"; + case ErrorCode.ERROR_CODE_TENANT_NOT_FOUND: + return "ERROR_CODE_TENANT_NOT_FOUND"; + case ErrorCode.ERROR_CODE_ATTRIBUTE_DEFINITION_NOT_FOUND: + return "ERROR_CODE_ATTRIBUTE_DEFINITION_NOT_FOUND"; + case ErrorCode.ERROR_CODE_ATTRIBUTE_TYPE_MISMATCH: + return "ERROR_CODE_ATTRIBUTE_TYPE_MISMATCH"; + case ErrorCode.ERROR_CODE_BUNDLE_NOT_FOUND: + return "ERROR_CODE_BUNDLE_NOT_FOUND"; + case ErrorCode.ERROR_CODE_RULE_DEFINITION_NOT_FOUND: + return "ERROR_CODE_RULE_DEFINITION_NOT_FOUND"; + case ErrorCode.ERROR_CODE_ENTITY_STATEMENT_NOT_FOUND: + return "ERROR_CODE_ENTITY_STATEMENT_NOT_FOUND"; + case ErrorCode.ERROR_CODE_REFERENCE_NOT_FOUND: + return "ERROR_CODE_REFERENCE_NOT_FOUND"; + case ErrorCode.ERROR_CODE_INTERNAL: + return "ERROR_CODE_INTERNAL"; + case ErrorCode.ERROR_CODE_CANCELLED: + return "ERROR_CODE_CANCELLED"; + case ErrorCode.ERROR_CODE_SQL_BUILDER: + return "ERROR_CODE_SQL_BUILDER"; + case ErrorCode.ERROR_CODE_CIRCUIT_BREAKER: + return "ERROR_CODE_CIRCUIT_BREAKER"; + case ErrorCode.ERROR_CODE_EXECUTION: + return "ERROR_CODE_EXECUTION"; + case ErrorCode.ERROR_CODE_SCAN: + return "ERROR_CODE_SCAN"; + case ErrorCode.ERROR_CODE_MIGRATION: + return "ERROR_CODE_MIGRATION"; + case ErrorCode.ERROR_CODE_TYPE_CONVERSATION: + return "ERROR_CODE_TYPE_CONVERSATION"; + case ErrorCode.ERROR_CODE_ERROR_MAX_RETRIES: + return "ERROR_CODE_ERROR_MAX_RETRIES"; + case ErrorCode.ERROR_CODE_ROLLBACK: + return "ERROR_CODE_ROLLBACK"; + case ErrorCode.ERROR_CODE_EXCLUSION_REQUIRES_MORE_THAN_ONE_FUNCTION: + return "ERROR_CODE_EXCLUSION_REQUIRES_MORE_THAN_ONE_FUNCTION"; + case ErrorCode.ERROR_CODE_NOT_IMPLEMENTED: + return "ERROR_CODE_NOT_IMPLEMENTED"; + case ErrorCode.ERROR_CODE_DATASTORE: + return "ERROR_CODE_DATASTORE"; + case ErrorCode.ERROR_CODE_UNKNOWN_STATEMENT_TYPE: + return "ERROR_CODE_UNKNOWN_STATEMENT_TYPE"; + case ErrorCode.ERROR_CODE_UNKNOWN_REFERENCE_TYPE: + return "ERROR_CODE_UNKNOWN_REFERENCE_TYPE"; + case ErrorCode.ERROR_CODE_CANNOT_CONVERT_TO_ENTITY_STATEMENT: + return "ERROR_CODE_CANNOT_CONVERT_TO_ENTITY_STATEMENT"; + case ErrorCode.ERROR_CODE_CANNOT_CONVERT_TO_RELATION_STATEMENT: + return "ERROR_CODE_CANNOT_CONVERT_TO_RELATION_STATEMENT"; + case ErrorCode.ERROR_CODE_CANNOT_CONVERT_TO_ATTRIBUTE_STATEMENT: + return "ERROR_CODE_CANNOT_CONVERT_TO_ATTRIBUTE_STATEMENT"; + case ErrorCode.ERROR_CODE_SERIALIZATION: + return "ERROR_CODE_SERIALIZATION"; + case ErrorCode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** ErrorResponse */ +export interface ErrorResponse { + code: ErrorCode; + message: string; +} + +function createBaseErrorResponse(): ErrorResponse { + return { code: 0, message: "" }; +} + +export const ErrorResponse: MessageFns = { + encode(message: ErrorResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.code !== 0) { + writer.uint32(8).int32(message.code); + } + if (message.message !== "") { + writer.uint32(18).string(message.message); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ErrorResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseErrorResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.code = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.message = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ErrorResponse { + return { + code: isSet(object.code) ? errorCodeFromJSON(object.code) : 0, + message: isSet(object.message) ? globalThis.String(object.message) : "", + }; + }, + + toJSON(message: ErrorResponse): unknown { + const obj: any = {}; + if (message.code !== 0) { + obj.code = errorCodeToJSON(message.code); + } + if (message.message !== "") { + obj.message = message.message; + } + return obj; + }, + + create(base?: DeepPartial): ErrorResponse { + return ErrorResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ErrorResponse { + const message = createBaseErrorResponse(); + message.code = object.code ?? 0; + message.message = object.message ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/base/v1/openapi.ts b/src/grpc/generated/base/v1/openapi.ts new file mode 100644 index 0000000..41144fc --- /dev/null +++ b/src/grpc/generated/base/v1/openapi.ts @@ -0,0 +1,9 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: base/v1/openapi.proto + +/* eslint-disable */ + +export const protobufPackage = "base.v1"; diff --git a/src/grpc/generated/base/v1/service.ts b/src/grpc/generated/base/v1/service.ts new file mode 100644 index 0000000..c399c51 --- /dev/null +++ b/src/grpc/generated/base/v1/service.ts @@ -0,0 +1,35031 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: base/v1/service.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; +import type { CallContext, CallOptions } from "nice-grpc-common"; +import { + Argument, + Attribute, + AttributeFilter, + CheckResult, + checkResultFromJSON, + checkResultToJSON, + Context, + DataBundle, + DataChanges, + Entity, + Entrance, + Expand, + Partials, + RelationReference, + SchemaDefinition as SchemaDefinition1, + StringArrayValue, + Subject, + Tenant, + Tuple, + TupleFilter, +} from "./base"; + +export const protobufPackage = "base.v1"; + +/** PermissionCheckRequest is the request message for the Check method in the Permission service. */ +export interface PermissionCheckRequest { + /** Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. */ + tenantId: string; + /** Metadata associated with this request, required. */ + metadata: + | PermissionCheckRequestMetadata + | undefined; + /** Entity on which the permission needs to be checked, required. */ + entity: + | Entity + | undefined; + /** Name of the permission or relation, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. */ + permission: string; + /** Subject for which the permission needs to be checked, required. */ + subject: + | Subject + | undefined; + /** Context associated with this request. */ + context: + | Context + | undefined; + /** Additional arguments associated with this request. */ + arguments: Argument[]; +} + +/** PermissionCheckRequestMetadata metadata for the PermissionCheckRequest. */ +export interface PermissionCheckRequestMetadata { + /** Version of the schema. */ + schemaVersion: string; + /** Token associated with the snap. */ + snapToken: string; + /** Depth of the check, must be greater than or equal to 3. */ + depth: number; +} + +/** PermissionCheckResponse is the response message for the Check method in the Permission service. */ +export interface PermissionCheckResponse { + /** Result of the permission check. */ + can: CheckResult; + /** Metadata associated with this response. */ + metadata: PermissionCheckResponseMetadata | undefined; +} + +/** PermissionCheckResponseMetadata metadata for the PermissionCheckResponse. */ +export interface PermissionCheckResponseMetadata { + /** The count of the checks performed. */ + checkCount: number; +} + +/** PermissionExpandRequest is the request message for the Expand method in the Permission service. */ +export interface PermissionExpandRequest { + /** Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. */ + tenantId: string; + /** Metadata associated with this request, required. */ + metadata: + | PermissionExpandRequestMetadata + | undefined; + /** Entity on which the permission needs to be expanded, required. */ + entity: + | Entity + | undefined; + /** Name of the permission to be expanded, not required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. */ + permission: string; + /** Context associated with this request. */ + context: + | Context + | undefined; + /** Additional arguments associated with this request. */ + arguments: Argument[]; +} + +/** PermissionExpandRequestMetadata metadata for the PermissionExpandRequest. */ +export interface PermissionExpandRequestMetadata { + /** Version of the schema. */ + schemaVersion: string; + /** Token associated with the snap. */ + snapToken: string; +} + +/** PermissionExpandResponse is the response message for the Expand method in the Permission service. */ +export interface PermissionExpandResponse { + /** Expansion tree. */ + tree: Expand | undefined; +} + +/** PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service. */ +export interface PermissionLookupEntityRequest { + /** Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. */ + tenantId: string; + /** Metadata associated with this request, required. */ + metadata: + | PermissionLookupEntityRequestMetadata + | undefined; + /** Type of the entity to lookup, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. */ + entityType: string; + /** Name of the permission to check, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. */ + permission: string; + /** Subject for which to check the permission, required. */ + subject: + | Subject + | undefined; + /** Context associated with this request. */ + context: + | Context + | undefined; + /** + * Scope: A map that associates entity types with lists of identifiers. Each entry + * helps filter requests by specifying which entities are relevant to the operation. + */ + scope: { [key: string]: StringArrayValue }; + /** + * page_size is the number of entities to be returned in the response. + * The value should be between 1 and 100. + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + */ + continuousToken: string; +} + +export interface PermissionLookupEntityRequest_ScopeEntry { + key: string; + value: StringArrayValue | undefined; +} + +/** PermissionLookupEntityRequestMetadata metadata for the PermissionLookupEntityRequest. */ +export interface PermissionLookupEntityRequestMetadata { + /** Version of the schema. */ + schemaVersion: string; + /** Token associated with the snap. */ + snapToken: string; + /** Depth of lookup, required, must be greater or equal to 3. */ + depth: number; +} + +/** PermissionLookupEntityResponse is the response message for the LookupEntity method in the Permission service. */ +export interface PermissionLookupEntityResponse { + /** List of identifiers for entities that match the lookup. */ + entityIds: string[]; + /** continuous_token is a string that can be used to paginate and retrieve the next set of results. */ + continuousToken: string; +} + +/** PermissionLookupEntityStreamResponse is the response message for the LookupEntityStream method in the Permission service. */ +export interface PermissionLookupEntityStreamResponse { + /** Identifier for an entity that matches the lookup. */ + entityId: string; + /** continuous_token is a string that can be used to paginate and retrieve the next set of results. */ + continuousToken: string; +} + +/** PermissionEntityFilterRequest is the request message for the LookupEntityStream method in the Permission service. */ +export interface PermissionEntityFilterRequest { + /** Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. */ + tenantId: string; + /** Metadata associated with this request, required. */ + metadata: + | PermissionEntityFilterRequestMetadata + | undefined; + /** Reference to the entity to filter. */ + entrance: + | Entrance + | undefined; + /** Subject for which to check the permission. */ + subject: + | Subject + | undefined; + /** Context associated with this request. */ + context: + | Context + | undefined; + /** + * Scope: A map that associates entity types with lists of identifiers. Each entry + * helps filter requests by specifying which entities are relevant to the operation. + */ + scope: { [key: string]: StringArrayValue }; + /** + * cursor is an optional parameter used for pagination. + * It should be the value received in the previous response. + */ + cursor: string; +} + +export interface PermissionEntityFilterRequest_ScopeEntry { + key: string; + value: StringArrayValue | undefined; +} + +/** PermissionEntityFilterRequestMetadata metadata for the PermissionEntityFilterRequest. */ +export interface PermissionEntityFilterRequestMetadata { + /** Version of the schema. */ + schemaVersion: string; + /** Token associated with the snap. */ + snapToken: string; + /** Depth of lookup, required, must be greater or equal to 3. */ + depth: number; +} + +/** PermissionLookupSubjectRequest is the request message for the LookupSubject method in the Permission service. */ +export interface PermissionLookupSubjectRequest { + /** Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. */ + tenantId: string; + /** Metadata associated with this request, required. */ + metadata: + | PermissionLookupSubjectRequestMetadata + | undefined; + /** Entity for which to check the permission, required. */ + entity: + | Entity + | undefined; + /** Permission to be checked, can be a permission or relation. Required, and must match the pattern "^([a-zA-Z][a-zA-Z0-9_]{1,62}[a-zA-Z0-9])$", max 64 bytes. */ + permission: string; + /** Reference to the subject to lookup. */ + subjectReference: + | RelationReference + | undefined; + /** Context associated with this request. */ + context: + | Context + | undefined; + /** Additional arguments associated with this request. */ + arguments: Argument[]; + /** + * page_size is the number of subjects to be returned in the response. + * The value should be between 1 and 100. + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + */ + continuousToken: string; +} + +/** PermissionLookupSubjectRequestMetadata metadata for the PermissionLookupSubjectRequest. */ +export interface PermissionLookupSubjectRequestMetadata { + /** Version of the schema. */ + schemaVersion: string; + /** Token associated with the snap. */ + snapToken: string; + /** Depth of the check, must be greater than or equal to 3. */ + depth: number; +} + +/** PermissionLookupSubjectResponse is the response message for the LookupSubject method in the Permission service. */ +export interface PermissionLookupSubjectResponse { + /** List of identifiers for subjects that match the lookup. */ + subjectIds: string[]; + /** continuous_token is a string that can be used to paginate and retrieve the next set of results. */ + continuousToken: string; +} + +/** PermissionSubjectPermissionRequest is the request message for the SubjectPermission method in the Permission service. */ +export interface PermissionSubjectPermissionRequest { + /** Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. */ + tenantId: string; + /** Metadata associated with this request, required. */ + metadata: + | PermissionSubjectPermissionRequestMetadata + | undefined; + /** Entity for which to check the permission, required. */ + entity: + | Entity + | undefined; + /** Subject for which to check the permission, required. */ + subject: + | Subject + | undefined; + /** Context associated with this request. */ + context: Context | undefined; +} + +/** PermissionSubjectPermissionRequestMetadata metadata for the PermissionSubjectPermissionRequest. */ +export interface PermissionSubjectPermissionRequestMetadata { + /** Version of the schema. */ + schemaVersion: string; + /** Token associated with the snap. */ + snapToken: string; + /** Whether to only check permissions. */ + onlyPermission: boolean; + /** Depth of the check, must be greater than or equal to 3. */ + depth: number; +} + +/** PermissionSubjectPermissionResponse is the response message for the SubjectPermission method in the Permission service. */ +export interface PermissionSubjectPermissionResponse { + /** Map of results for each permission check. */ + results: { [key: string]: CheckResult }; +} + +export interface PermissionSubjectPermissionResponse_ResultsEntry { + key: string; + value: CheckResult; +} + +/** + * WatchRequest is the request message for the Watch RPC. It contains the + * details needed to establish a watch stream. + */ +export interface WatchRequest { + /** Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. */ + tenantId: string; + /** Snap token to be used for watching. */ + snapToken: string; +} + +/** + * WatchResponse is the response message for the Watch RPC. It contains the + * changes in the data that are being watched. + */ +export interface WatchResponse { + /** Changes in the data. */ + changes: DataChanges | undefined; +} + +/** + * SchemaWriteRequest is the request message for the Write method in the Schema service. + * It contains tenant_id and the schema to be written. + */ +export interface SchemaWriteRequest { + /** + * tenant_id is a string that identifies the tenant. It must match the pattern "[a-zA-Z0-9-,]+", + * be a maximum of 64 bytes, and must not be empty. + */ + tenantId: string; + /** schema is the string representation of the schema to be written. */ + schema: string; +} + +/** + * SchemaWriteResponse is the response message for the Write method in the Schema service. + * It returns the version of the written schema. + */ +export interface SchemaWriteResponse { + /** schema_version is the string that identifies the version of the written schema. */ + schemaVersion: string; +} + +/** + * It contains the tenant_id to identify the tenant and metadata of the schema to be edited, + * with the corresponding edits to various entities + */ +export interface SchemaPartialWriteRequest { + /** + * tenant_id is a string that identifies the tenant. It must match the pattern "[a-zA-Z0-9-,]+", + * be a maximum of 64 bytes, and must not be empty. + */ + tenantId: string; + /** metadata is the additional information needed for the Partial Write request. */ + metadata: + | SchemaPartialWriteRequestMetadata + | undefined; + /** Map of entity name with the values needed to be updated */ + partials: { [key: string]: Partials }; +} + +export interface SchemaPartialWriteRequest_PartialsEntry { + key: string; + value: Partials | undefined; +} + +/** + * SchemaPartialWriteRequestMetadata provides additional information for the Schema Partial Write request. + * It contains schema_version to specify which version of the schema should be read. + */ +export interface SchemaPartialWriteRequestMetadata { + /** schema_version is the string that identifies the version of the schema to be read. */ + schemaVersion: string; +} + +/** + * SchemaPartialWriteResponse is the response message for the Parietal Write method in the Schema service. + * It returns the requested schema. + */ +export interface SchemaPartialWriteResponse { + /** schema_version is the string that identifies the version of the written schema. */ + schemaVersion: string; +} + +/** + * SchemaReadRequest is the request message for the Read method in the Schema service. + * It contains tenant_id and metadata about the schema to be read. + */ +export interface SchemaReadRequest { + /** + * tenant_id is a string that identifies the tenant. It must match the pattern "[a-zA-Z0-9-,]+", + * be a maximum of 64 bytes, and must not be empty. + */ + tenantId: string; + /** metadata is the additional information needed for the Read request. */ + metadata: SchemaReadRequestMetadata | undefined; +} + +/** + * SchemaReadRequestMetadata provides additional information for the Schema Read request. + * It contains schema_version to specify which version of the schema should be read. + */ +export interface SchemaReadRequestMetadata { + /** schema_version is the string that identifies the version of the schema to be read. */ + schemaVersion: string; +} + +/** + * SchemaReadResponse is the response message for the Read method in the Schema service. + * It returns the requested schema. + */ +export interface SchemaReadResponse { + /** schema is the SchemaDefinition that represents the read schema. */ + schema: SchemaDefinition1 | undefined; +} + +/** + * SchemaListRequest is the request message for the List method in the Schema service. + * It contains tenant_id for which the schemas are to be listed. + */ +export interface SchemaListRequest { + /** + * tenant_id is a string that identifies the tenant. It must match the pattern "[a-zA-Z0-9-,]+", + * be a maximum of 64 bytes, and must not be empty. + */ + tenantId: string; + /** + * page_size is the number of schemas to be returned in the response. + * The value should be between 1 and 100. + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + */ + continuousToken: string; +} + +/** + * SchemaListResponse is the response message for the List method in the Schema service. + * It returns a paginated list of schemas + */ +export interface SchemaListResponse { + /** head of the schemas is the latest version available for the tenant */ + head: string; + /** list of schema versions with creation timestamps */ + schemas: SchemaList[]; + /** continuous_token is a string that can be used to paginate and retrieve the next set of results. */ + continuousToken: string; +} + +/** SchemaList provides a list of schema versions with their corresponding creation timestamps */ +export interface SchemaList { + version: string; + createdAt: string; +} + +/** + * DataWriteRequest defines the structure of a request for writing data. + * It contains the necessary information such as tenant_id, metadata, + * tuples and attributes for the write operation. + */ +export interface DataWriteRequest { + /** tenant_id represents the unique identifier of the tenant for which data is written. */ + tenantId: string; + /** metadata holds additional data related to the request. */ + metadata: + | DataWriteRequestMetadata + | undefined; + /** tuples contains the list of tuples (entity-relation-entity triples) that need to be written. */ + tuples: Tuple[]; + /** attributes contains the list of attributes (entity-attribute-value triples) that need to be written. */ + attributes: Attribute[]; +} + +/** + * DataWriteRequestMetadata defines the structure of metadata for a write request. + * It includes the schema version of the data to be written. + */ +export interface DataWriteRequestMetadata { + /** schema_version represents the version of the schema for the data being written. */ + schemaVersion: string; +} + +/** + * DataWriteResponse defines the structure of the response after writing data. + * It contains the snap_token generated after the write operation. + */ +export interface DataWriteResponse { + /** snap_token is the token generated after the data write operation, representing a snapshot of the data. */ + snapToken: string; +} + +/** Represents a request to write relationship data. */ +export interface RelationshipWriteRequest { + /** Unique identifier for the tenant with specific constraints. */ + tenantId: string; + /** Metadata for the request. It's required. */ + metadata: + | RelationshipWriteRequestMetadata + | undefined; + /** List of tuples for the request. Must have between 1 and 100 items. */ + tuples: Tuple[]; +} + +/** RelationshipWriteRequestMetadata */ +export interface RelationshipWriteRequestMetadata { + schemaVersion: string; +} + +/** RelationshipWriteResponse */ +export interface RelationshipWriteResponse { + snapToken: string; +} + +/** + * RelationshipReadRequest defines the structure of a request for reading relationships. + * It contains the necessary information such as tenant_id, metadata, and filter for the read operation. + */ +export interface RelationshipReadRequest { + /** tenant_id represents the unique identifier of the tenant for which relationships are read. */ + tenantId: string; + /** metadata holds additional data related to the request. */ + metadata: + | RelationshipReadRequestMetadata + | undefined; + /** filter is used to specify criteria for the data that needs to be read. */ + filter: + | TupleFilter + | undefined; + /** + * page_size specifies the number of results to return in a single page. + * If more results are available, a continuous_token is included in the response. + */ + pageSize: number; + /** continuous_token is used in case of paginated reads to get the next page of results. */ + continuousToken: string; +} + +/** + * RelationshipReadRequestMetadata defines the structure of the metadata for a read request focused on relationships. + * It includes the snap_token associated with a particular state of the database. + */ +export interface RelationshipReadRequestMetadata { + /** snap_token represents a specific state or "snapshot" of the database. */ + snapToken: string; +} + +/** + * RelationshipReadResponse defines the structure of the response after reading relationships. + * It includes the tuples representing the relationships and a continuous token for handling result pagination. + */ +export interface RelationshipReadResponse { + /** tuples is a list of the relationships retrieved in the read operation, represented as entity-relation-entity triples. */ + tuples: Tuple[]; + /** continuous_token is used in the case of paginated reads to retrieve the next page of results. */ + continuousToken: string; +} + +/** + * AttributeReadRequest defines the structure of a request for reading attributes. + * It includes the tenant_id, metadata, attribute filter, page size for pagination, and a continuous token for multi-page results. + */ +export interface AttributeReadRequest { + /** tenant_id represents the unique identifier of the tenant from which the attributes are being read. */ + tenantId: string; + /** metadata holds additional information related to the request. */ + metadata: + | AttributeReadRequestMetadata + | undefined; + /** filter specifies the criteria used to select the attributes that should be returned. */ + filter: + | AttributeFilter + | undefined; + /** + * page_size specifies the number of results to return in a single page. + * If more results are available, a continuous_token is included in the response. + */ + pageSize: number; + /** continuous_token is used in case of paginated reads to get the next page of results. */ + continuousToken: string; +} + +/** + * AttributeReadRequestMetadata defines the structure for the metadata of an attribute read request. + * It includes the snap_token associated with a particular state of the database. + */ +export interface AttributeReadRequestMetadata { + /** snap_token represents a specific state or "snapshot" of the database. */ + snapToken: string; +} + +/** + * AttributeReadResponse defines the structure of the response to an attribute read request. + * It includes the attributes retrieved and a continuous token for handling result pagination. + */ +export interface AttributeReadResponse { + /** attributes is a list of the attributes retrieved in the read operation. */ + attributes: Attribute[]; + /** continuous_token is used in the case of paginated reads to retrieve the next page of results. */ + continuousToken: string; +} + +/** + * DataDeleteRequest defines the structure of a request to delete data. + * It includes the tenant_id and filters for selecting tuples and attributes to be deleted. + */ +export interface DataDeleteRequest { + /** tenant_id represents the unique identifier of the tenant from which the data will be deleted. */ + tenantId: string; + /** tuple_filter specifies the criteria used to select the tuples that should be deleted. */ + tupleFilter: + | TupleFilter + | undefined; + /** attribute_filter specifies the criteria used to select the attributes that should be deleted. */ + attributeFilter: AttributeFilter | undefined; +} + +/** + * DataDeleteResponse defines the structure of the response to a data delete request. + * It includes a snap_token representing the state of the database after the deletion. + */ +export interface DataDeleteResponse { + /** snap_token represents the state of the database after the requested deletions. */ + snapToken: string; +} + +/** RelationshipDeleteRequest */ +export interface RelationshipDeleteRequest { + tenantId: string; + filter: TupleFilter | undefined; +} + +/** RelationshipDeleteResponse */ +export interface RelationshipDeleteResponse { + snapToken: string; +} + +/** + * BundleRunRequest is used to request the execution of a bundle. + * It includes tenant_id, the name of the bundle, and additional arguments for execution. + */ +export interface BundleRunRequest { + tenantId: string; + /** Name of the bundle to be executed. */ + name: string; + /** Additional key-value pairs for execution arguments. */ + arguments: { [key: string]: string }; +} + +export interface BundleRunRequest_ArgumentsEntry { + key: string; + value: string; +} + +/** + * BundleRunResponse is the response for a BundleRunRequest. + * It includes a snap_token, which may be used for tracking the execution or its results. + */ +export interface BundleRunResponse { + snapToken: string; +} + +/** + * BundleWriteRequest is used to request the writing of a bundle. + * It contains the tenant_id to identify the tenant and the Bundles object. + */ +export interface BundleWriteRequest { + tenantId: string; + /** Contains the bundle data to be written. */ + bundles: DataBundle[]; +} + +/** + * BundleWriteResponse is the response for a BundleWriteRequest. + * It includes a name which could be used as an identifier or acknowledgment. + */ +export interface BundleWriteResponse { + /** Identifier or acknowledgment of the written bundle. */ + names: string[]; +} + +export interface BundleReadRequest { + tenantId: string; + name: string; +} + +export interface BundleReadResponse { + bundle: DataBundle | undefined; +} + +/** + * BundleDeleteRequest is used to request the deletion of a bundle. + * It contains the tenant_id to specify the tenant and the name of the bundle to be deleted. + */ +export interface BundleDeleteRequest { + tenantId: string; + /** Name of the bundle to be deleted. */ + name: string; +} + +export interface BundleDeleteResponse { + name: string; +} + +/** TenantCreateRequest is the message used for the request to create a tenant. */ +export interface TenantCreateRequest { + /** id is a unique identifier for the tenant. */ + id: string; + /** name is the name of the tenant. */ + name: string; +} + +/** TenantCreateResponse is the message returned from the request to create a tenant. */ +export interface TenantCreateResponse { + /** tenant is the created tenant information. */ + tenant: Tenant | undefined; +} + +/** TenantDeleteRequest is the message used for the request to delete a tenant. */ +export interface TenantDeleteRequest { + /** id is the unique identifier of the tenant to be deleted. */ + id: string; +} + +/** TenantDeleteResponse is the message returned from the request to delete a tenant. */ +export interface TenantDeleteResponse { + /** tenant_id is the tenant id that was deleted. */ + tenantId: string; +} + +/** TenantListRequest is the message used for the request to list all tenants. */ +export interface TenantListRequest { + /** + * page_size is the number of tenants to be returned in the response. + * The value should be between 1 and 100. + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + */ + continuousToken: string; +} + +/** TenantListResponse is the message returned from the request to list all tenants. */ +export interface TenantListResponse { + /** tenants is a list of tenants. */ + tenants: Tenant[]; + /** continuous_token is a string that can be used to paginate and retrieve the next set of results. */ + continuousToken: string; +} + +function createBasePermissionCheckRequest(): PermissionCheckRequest { + return { + tenantId: "", + metadata: undefined, + entity: undefined, + permission: "", + subject: undefined, + context: undefined, + arguments: [], + }; +} + +export const PermissionCheckRequest: MessageFns = { + encode(message: PermissionCheckRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + PermissionCheckRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(26).fork()).join(); + } + if (message.permission !== "") { + writer.uint32(34).string(message.permission); + } + if (message.subject !== undefined) { + Subject.encode(message.subject, writer.uint32(42).fork()).join(); + } + if (message.context !== undefined) { + Context.encode(message.context, writer.uint32(50).fork()).join(); + } + for (const v of message.arguments) { + Argument.encode(v!, writer.uint32(58).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionCheckRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionCheckRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = PermissionCheckRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.permission = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.subject = Subject.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.context = Context.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.arguments.push(Argument.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionCheckRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? PermissionCheckRequestMetadata.fromJSON(object.metadata) : undefined, + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + permission: isSet(object.permission) ? globalThis.String(object.permission) : "", + subject: isSet(object.subject) ? Subject.fromJSON(object.subject) : undefined, + context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, + arguments: globalThis.Array.isArray(object?.arguments) + ? object.arguments.map((e: any) => Argument.fromJSON(e)) + : [], + }; + }, + + toJSON(message: PermissionCheckRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = PermissionCheckRequestMetadata.toJSON(message.metadata); + } + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.permission !== "") { + obj.permission = message.permission; + } + if (message.subject !== undefined) { + obj.subject = Subject.toJSON(message.subject); + } + if (message.context !== undefined) { + obj.context = Context.toJSON(message.context); + } + if (message.arguments?.length) { + obj.arguments = message.arguments.map((e) => Argument.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): PermissionCheckRequest { + return PermissionCheckRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionCheckRequest { + const message = createBasePermissionCheckRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? PermissionCheckRequestMetadata.fromPartial(object.metadata) + : undefined; + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.permission = object.permission ?? ""; + message.subject = (object.subject !== undefined && object.subject !== null) + ? Subject.fromPartial(object.subject) + : undefined; + message.context = (object.context !== undefined && object.context !== null) + ? Context.fromPartial(object.context) + : undefined; + message.arguments = object.arguments?.map((e) => Argument.fromPartial(e)) || []; + return message; + }, +}; + +function createBasePermissionCheckRequestMetadata(): PermissionCheckRequestMetadata { + return { schemaVersion: "", snapToken: "", depth: 0 }; +} + +export const PermissionCheckRequestMetadata: MessageFns = { + encode(message: PermissionCheckRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + if (message.snapToken !== "") { + writer.uint32(18).string(message.snapToken); + } + if (message.depth !== 0) { + writer.uint32(24).int32(message.depth); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionCheckRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionCheckRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.snapToken = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.depth = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionCheckRequestMetadata { + return { + schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "", + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + depth: isSet(object.depth) ? globalThis.Number(object.depth) : 0, + }; + }, + + toJSON(message: PermissionCheckRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + if (message.depth !== 0) { + obj.depth = Math.round(message.depth); + } + return obj; + }, + + create(base?: DeepPartial): PermissionCheckRequestMetadata { + return PermissionCheckRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionCheckRequestMetadata { + const message = createBasePermissionCheckRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + message.snapToken = object.snapToken ?? ""; + message.depth = object.depth ?? 0; + return message; + }, +}; + +function createBasePermissionCheckResponse(): PermissionCheckResponse { + return { can: 0, metadata: undefined }; +} + +export const PermissionCheckResponse: MessageFns = { + encode(message: PermissionCheckResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.can !== 0) { + writer.uint32(8).int32(message.can); + } + if (message.metadata !== undefined) { + PermissionCheckResponseMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionCheckResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionCheckResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.can = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = PermissionCheckResponseMetadata.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionCheckResponse { + return { + can: isSet(object.can) ? checkResultFromJSON(object.can) : 0, + metadata: isSet(object.metadata) ? PermissionCheckResponseMetadata.fromJSON(object.metadata) : undefined, + }; + }, + + toJSON(message: PermissionCheckResponse): unknown { + const obj: any = {}; + if (message.can !== 0) { + obj.can = checkResultToJSON(message.can); + } + if (message.metadata !== undefined) { + obj.metadata = PermissionCheckResponseMetadata.toJSON(message.metadata); + } + return obj; + }, + + create(base?: DeepPartial): PermissionCheckResponse { + return PermissionCheckResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionCheckResponse { + const message = createBasePermissionCheckResponse(); + message.can = object.can ?? 0; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? PermissionCheckResponseMetadata.fromPartial(object.metadata) + : undefined; + return message; + }, +}; + +function createBasePermissionCheckResponseMetadata(): PermissionCheckResponseMetadata { + return { checkCount: 0 }; +} + +export const PermissionCheckResponseMetadata: MessageFns = { + encode(message: PermissionCheckResponseMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.checkCount !== 0) { + writer.uint32(8).int32(message.checkCount); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionCheckResponseMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionCheckResponseMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.checkCount = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionCheckResponseMetadata { + return { checkCount: isSet(object.check_count) ? globalThis.Number(object.check_count) : 0 }; + }, + + toJSON(message: PermissionCheckResponseMetadata): unknown { + const obj: any = {}; + if (message.checkCount !== 0) { + obj.check_count = Math.round(message.checkCount); + } + return obj; + }, + + create(base?: DeepPartial): PermissionCheckResponseMetadata { + return PermissionCheckResponseMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionCheckResponseMetadata { + const message = createBasePermissionCheckResponseMetadata(); + message.checkCount = object.checkCount ?? 0; + return message; + }, +}; + +function createBasePermissionExpandRequest(): PermissionExpandRequest { + return { tenantId: "", metadata: undefined, entity: undefined, permission: "", context: undefined, arguments: [] }; +} + +export const PermissionExpandRequest: MessageFns = { + encode(message: PermissionExpandRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + PermissionExpandRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(26).fork()).join(); + } + if (message.permission !== "") { + writer.uint32(34).string(message.permission); + } + if (message.context !== undefined) { + Context.encode(message.context, writer.uint32(42).fork()).join(); + } + for (const v of message.arguments) { + Argument.encode(v!, writer.uint32(50).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionExpandRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionExpandRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = PermissionExpandRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.permission = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.context = Context.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.arguments.push(Argument.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionExpandRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? PermissionExpandRequestMetadata.fromJSON(object.metadata) : undefined, + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + permission: isSet(object.permission) ? globalThis.String(object.permission) : "", + context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, + arguments: globalThis.Array.isArray(object?.arguments) + ? object.arguments.map((e: any) => Argument.fromJSON(e)) + : [], + }; + }, + + toJSON(message: PermissionExpandRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = PermissionExpandRequestMetadata.toJSON(message.metadata); + } + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.permission !== "") { + obj.permission = message.permission; + } + if (message.context !== undefined) { + obj.context = Context.toJSON(message.context); + } + if (message.arguments?.length) { + obj.arguments = message.arguments.map((e) => Argument.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): PermissionExpandRequest { + return PermissionExpandRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionExpandRequest { + const message = createBasePermissionExpandRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? PermissionExpandRequestMetadata.fromPartial(object.metadata) + : undefined; + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.permission = object.permission ?? ""; + message.context = (object.context !== undefined && object.context !== null) + ? Context.fromPartial(object.context) + : undefined; + message.arguments = object.arguments?.map((e) => Argument.fromPartial(e)) || []; + return message; + }, +}; + +function createBasePermissionExpandRequestMetadata(): PermissionExpandRequestMetadata { + return { schemaVersion: "", snapToken: "" }; +} + +export const PermissionExpandRequestMetadata: MessageFns = { + encode(message: PermissionExpandRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + if (message.snapToken !== "") { + writer.uint32(18).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionExpandRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionExpandRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionExpandRequestMetadata { + return { + schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "", + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + }; + }, + + toJSON(message: PermissionExpandRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): PermissionExpandRequestMetadata { + return PermissionExpandRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionExpandRequestMetadata { + const message = createBasePermissionExpandRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBasePermissionExpandResponse(): PermissionExpandResponse { + return { tree: undefined }; +} + +export const PermissionExpandResponse: MessageFns = { + encode(message: PermissionExpandResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tree !== undefined) { + Expand.encode(message.tree, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionExpandResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionExpandResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tree = Expand.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionExpandResponse { + return { tree: isSet(object.tree) ? Expand.fromJSON(object.tree) : undefined }; + }, + + toJSON(message: PermissionExpandResponse): unknown { + const obj: any = {}; + if (message.tree !== undefined) { + obj.tree = Expand.toJSON(message.tree); + } + return obj; + }, + + create(base?: DeepPartial): PermissionExpandResponse { + return PermissionExpandResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionExpandResponse { + const message = createBasePermissionExpandResponse(); + message.tree = (object.tree !== undefined && object.tree !== null) ? Expand.fromPartial(object.tree) : undefined; + return message; + }, +}; + +function createBasePermissionLookupEntityRequest(): PermissionLookupEntityRequest { + return { + tenantId: "", + metadata: undefined, + entityType: "", + permission: "", + subject: undefined, + context: undefined, + scope: {}, + pageSize: 0, + continuousToken: "", + }; +} + +export const PermissionLookupEntityRequest: MessageFns = { + encode(message: PermissionLookupEntityRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + PermissionLookupEntityRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.entityType !== "") { + writer.uint32(26).string(message.entityType); + } + if (message.permission !== "") { + writer.uint32(34).string(message.permission); + } + if (message.subject !== undefined) { + Subject.encode(message.subject, writer.uint32(42).fork()).join(); + } + if (message.context !== undefined) { + Context.encode(message.context, writer.uint32(50).fork()).join(); + } + Object.entries(message.scope).forEach(([key, value]) => { + PermissionLookupEntityRequest_ScopeEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).join(); + }); + if (message.pageSize !== 0) { + writer.uint32(64).uint32(message.pageSize); + } + if (message.continuousToken !== "") { + writer.uint32(74).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupEntityRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupEntityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = PermissionLookupEntityRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.entityType = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.permission = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.subject = Subject.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.context = Context.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + const entry7 = PermissionLookupEntityRequest_ScopeEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.scope[entry7.key] = entry7.value; + } + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.pageSize = reader.uint32(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupEntityRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? PermissionLookupEntityRequestMetadata.fromJSON(object.metadata) : undefined, + entityType: isSet(object.entity_type) ? globalThis.String(object.entity_type) : "", + permission: isSet(object.permission) ? globalThis.String(object.permission) : "", + subject: isSet(object.subject) ? Subject.fromJSON(object.subject) : undefined, + context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, + scope: isObject(object.scope) + ? Object.entries(object.scope).reduce<{ [key: string]: StringArrayValue }>((acc, [key, value]) => { + acc[key] = StringArrayValue.fromJSON(value); + return acc; + }, {}) + : {}, + pageSize: isSet(object.page_size) ? globalThis.Number(object.page_size) : 0, + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: PermissionLookupEntityRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = PermissionLookupEntityRequestMetadata.toJSON(message.metadata); + } + if (message.entityType !== "") { + obj.entity_type = message.entityType; + } + if (message.permission !== "") { + obj.permission = message.permission; + } + if (message.subject !== undefined) { + obj.subject = Subject.toJSON(message.subject); + } + if (message.context !== undefined) { + obj.context = Context.toJSON(message.context); + } + if (message.scope) { + const entries = Object.entries(message.scope); + if (entries.length > 0) { + obj.scope = {}; + entries.forEach(([k, v]) => { + obj.scope[k] = StringArrayValue.toJSON(v); + }); + } + } + if (message.pageSize !== 0) { + obj.page_size = Math.round(message.pageSize); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupEntityRequest { + return PermissionLookupEntityRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupEntityRequest { + const message = createBasePermissionLookupEntityRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? PermissionLookupEntityRequestMetadata.fromPartial(object.metadata) + : undefined; + message.entityType = object.entityType ?? ""; + message.permission = object.permission ?? ""; + message.subject = (object.subject !== undefined && object.subject !== null) + ? Subject.fromPartial(object.subject) + : undefined; + message.context = (object.context !== undefined && object.context !== null) + ? Context.fromPartial(object.context) + : undefined; + message.scope = Object.entries(object.scope ?? {}).reduce<{ [key: string]: StringArrayValue }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = StringArrayValue.fromPartial(value); + } + return acc; + }, + {}, + ); + message.pageSize = object.pageSize ?? 0; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBasePermissionLookupEntityRequest_ScopeEntry(): PermissionLookupEntityRequest_ScopeEntry { + return { key: "", value: undefined }; +} + +export const PermissionLookupEntityRequest_ScopeEntry: MessageFns = { + encode(message: PermissionLookupEntityRequest_ScopeEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + StringArrayValue.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupEntityRequest_ScopeEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupEntityRequest_ScopeEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = StringArrayValue.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupEntityRequest_ScopeEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? StringArrayValue.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: PermissionLookupEntityRequest_ScopeEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = StringArrayValue.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupEntityRequest_ScopeEntry { + return PermissionLookupEntityRequest_ScopeEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupEntityRequest_ScopeEntry { + const message = createBasePermissionLookupEntityRequest_ScopeEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? StringArrayValue.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBasePermissionLookupEntityRequestMetadata(): PermissionLookupEntityRequestMetadata { + return { schemaVersion: "", snapToken: "", depth: 0 }; +} + +export const PermissionLookupEntityRequestMetadata: MessageFns = { + encode(message: PermissionLookupEntityRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + if (message.snapToken !== "") { + writer.uint32(18).string(message.snapToken); + } + if (message.depth !== 0) { + writer.uint32(24).int32(message.depth); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupEntityRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupEntityRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.snapToken = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.depth = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupEntityRequestMetadata { + return { + schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "", + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + depth: isSet(object.depth) ? globalThis.Number(object.depth) : 0, + }; + }, + + toJSON(message: PermissionLookupEntityRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + if (message.depth !== 0) { + obj.depth = Math.round(message.depth); + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupEntityRequestMetadata { + return PermissionLookupEntityRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupEntityRequestMetadata { + const message = createBasePermissionLookupEntityRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + message.snapToken = object.snapToken ?? ""; + message.depth = object.depth ?? 0; + return message; + }, +}; + +function createBasePermissionLookupEntityResponse(): PermissionLookupEntityResponse { + return { entityIds: [], continuousToken: "" }; +} + +export const PermissionLookupEntityResponse: MessageFns = { + encode(message: PermissionLookupEntityResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.entityIds) { + writer.uint32(10).string(v!); + } + if (message.continuousToken !== "") { + writer.uint32(18).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupEntityResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupEntityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entityIds.push(reader.string()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupEntityResponse { + return { + entityIds: globalThis.Array.isArray(object?.entity_ids) + ? object.entity_ids.map((e: any) => globalThis.String(e)) + : [], + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: PermissionLookupEntityResponse): unknown { + const obj: any = {}; + if (message.entityIds?.length) { + obj.entity_ids = message.entityIds; + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupEntityResponse { + return PermissionLookupEntityResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupEntityResponse { + const message = createBasePermissionLookupEntityResponse(); + message.entityIds = object.entityIds?.map((e) => e) || []; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBasePermissionLookupEntityStreamResponse(): PermissionLookupEntityStreamResponse { + return { entityId: "", continuousToken: "" }; +} + +export const PermissionLookupEntityStreamResponse: MessageFns = { + encode(message: PermissionLookupEntityStreamResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.entityId !== "") { + writer.uint32(10).string(message.entityId); + } + if (message.continuousToken !== "") { + writer.uint32(18).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupEntityStreamResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupEntityStreamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.entityId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupEntityStreamResponse { + return { + entityId: isSet(object.entity_id) ? globalThis.String(object.entity_id) : "", + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: PermissionLookupEntityStreamResponse): unknown { + const obj: any = {}; + if (message.entityId !== "") { + obj.entity_id = message.entityId; + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupEntityStreamResponse { + return PermissionLookupEntityStreamResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupEntityStreamResponse { + const message = createBasePermissionLookupEntityStreamResponse(); + message.entityId = object.entityId ?? ""; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBasePermissionEntityFilterRequest(): PermissionEntityFilterRequest { + return { + tenantId: "", + metadata: undefined, + entrance: undefined, + subject: undefined, + context: undefined, + scope: {}, + cursor: "", + }; +} + +export const PermissionEntityFilterRequest: MessageFns = { + encode(message: PermissionEntityFilterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + PermissionEntityFilterRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.entrance !== undefined) { + Entrance.encode(message.entrance, writer.uint32(26).fork()).join(); + } + if (message.subject !== undefined) { + Subject.encode(message.subject, writer.uint32(34).fork()).join(); + } + if (message.context !== undefined) { + Context.encode(message.context, writer.uint32(42).fork()).join(); + } + Object.entries(message.scope).forEach(([key, value]) => { + PermissionEntityFilterRequest_ScopeEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).join(); + }); + if (message.cursor !== "") { + writer.uint32(58).string(message.cursor); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionEntityFilterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionEntityFilterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = PermissionEntityFilterRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.entrance = Entrance.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.subject = Subject.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.context = Context.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + const entry6 = PermissionEntityFilterRequest_ScopeEntry.decode(reader, reader.uint32()); + if (entry6.value !== undefined) { + message.scope[entry6.key] = entry6.value; + } + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.cursor = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionEntityFilterRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? PermissionEntityFilterRequestMetadata.fromJSON(object.metadata) : undefined, + entrance: isSet(object.entrance) ? Entrance.fromJSON(object.entrance) : undefined, + subject: isSet(object.subject) ? Subject.fromJSON(object.subject) : undefined, + context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, + scope: isObject(object.scope) + ? Object.entries(object.scope).reduce<{ [key: string]: StringArrayValue }>((acc, [key, value]) => { + acc[key] = StringArrayValue.fromJSON(value); + return acc; + }, {}) + : {}, + cursor: isSet(object.cursor) ? globalThis.String(object.cursor) : "", + }; + }, + + toJSON(message: PermissionEntityFilterRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = PermissionEntityFilterRequestMetadata.toJSON(message.metadata); + } + if (message.entrance !== undefined) { + obj.entrance = Entrance.toJSON(message.entrance); + } + if (message.subject !== undefined) { + obj.subject = Subject.toJSON(message.subject); + } + if (message.context !== undefined) { + obj.context = Context.toJSON(message.context); + } + if (message.scope) { + const entries = Object.entries(message.scope); + if (entries.length > 0) { + obj.scope = {}; + entries.forEach(([k, v]) => { + obj.scope[k] = StringArrayValue.toJSON(v); + }); + } + } + if (message.cursor !== "") { + obj.cursor = message.cursor; + } + return obj; + }, + + create(base?: DeepPartial): PermissionEntityFilterRequest { + return PermissionEntityFilterRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionEntityFilterRequest { + const message = createBasePermissionEntityFilterRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? PermissionEntityFilterRequestMetadata.fromPartial(object.metadata) + : undefined; + message.entrance = (object.entrance !== undefined && object.entrance !== null) + ? Entrance.fromPartial(object.entrance) + : undefined; + message.subject = (object.subject !== undefined && object.subject !== null) + ? Subject.fromPartial(object.subject) + : undefined; + message.context = (object.context !== undefined && object.context !== null) + ? Context.fromPartial(object.context) + : undefined; + message.scope = Object.entries(object.scope ?? {}).reduce<{ [key: string]: StringArrayValue }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = StringArrayValue.fromPartial(value); + } + return acc; + }, + {}, + ); + message.cursor = object.cursor ?? ""; + return message; + }, +}; + +function createBasePermissionEntityFilterRequest_ScopeEntry(): PermissionEntityFilterRequest_ScopeEntry { + return { key: "", value: undefined }; +} + +export const PermissionEntityFilterRequest_ScopeEntry: MessageFns = { + encode(message: PermissionEntityFilterRequest_ScopeEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + StringArrayValue.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionEntityFilterRequest_ScopeEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionEntityFilterRequest_ScopeEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = StringArrayValue.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionEntityFilterRequest_ScopeEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? StringArrayValue.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: PermissionEntityFilterRequest_ScopeEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = StringArrayValue.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): PermissionEntityFilterRequest_ScopeEntry { + return PermissionEntityFilterRequest_ScopeEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionEntityFilterRequest_ScopeEntry { + const message = createBasePermissionEntityFilterRequest_ScopeEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? StringArrayValue.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBasePermissionEntityFilterRequestMetadata(): PermissionEntityFilterRequestMetadata { + return { schemaVersion: "", snapToken: "", depth: 0 }; +} + +export const PermissionEntityFilterRequestMetadata: MessageFns = { + encode(message: PermissionEntityFilterRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + if (message.snapToken !== "") { + writer.uint32(18).string(message.snapToken); + } + if (message.depth !== 0) { + writer.uint32(24).int32(message.depth); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionEntityFilterRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionEntityFilterRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.snapToken = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.depth = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionEntityFilterRequestMetadata { + return { + schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "", + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + depth: isSet(object.depth) ? globalThis.Number(object.depth) : 0, + }; + }, + + toJSON(message: PermissionEntityFilterRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + if (message.depth !== 0) { + obj.depth = Math.round(message.depth); + } + return obj; + }, + + create(base?: DeepPartial): PermissionEntityFilterRequestMetadata { + return PermissionEntityFilterRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionEntityFilterRequestMetadata { + const message = createBasePermissionEntityFilterRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + message.snapToken = object.snapToken ?? ""; + message.depth = object.depth ?? 0; + return message; + }, +}; + +function createBasePermissionLookupSubjectRequest(): PermissionLookupSubjectRequest { + return { + tenantId: "", + metadata: undefined, + entity: undefined, + permission: "", + subjectReference: undefined, + context: undefined, + arguments: [], + pageSize: 0, + continuousToken: "", + }; +} + +export const PermissionLookupSubjectRequest: MessageFns = { + encode(message: PermissionLookupSubjectRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + PermissionLookupSubjectRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(26).fork()).join(); + } + if (message.permission !== "") { + writer.uint32(34).string(message.permission); + } + if (message.subjectReference !== undefined) { + RelationReference.encode(message.subjectReference, writer.uint32(42).fork()).join(); + } + if (message.context !== undefined) { + Context.encode(message.context, writer.uint32(50).fork()).join(); + } + for (const v of message.arguments) { + Argument.encode(v!, writer.uint32(58).fork()).join(); + } + if (message.pageSize !== 0) { + writer.uint32(64).uint32(message.pageSize); + } + if (message.continuousToken !== "") { + writer.uint32(74).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupSubjectRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupSubjectRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = PermissionLookupSubjectRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.permission = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.subjectReference = RelationReference.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.context = Context.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.arguments.push(Argument.decode(reader, reader.uint32())); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.pageSize = reader.uint32(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupSubjectRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? PermissionLookupSubjectRequestMetadata.fromJSON(object.metadata) : undefined, + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + permission: isSet(object.permission) ? globalThis.String(object.permission) : "", + subjectReference: isSet(object.subject_reference) + ? RelationReference.fromJSON(object.subject_reference) + : undefined, + context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, + arguments: globalThis.Array.isArray(object?.arguments) + ? object.arguments.map((e: any) => Argument.fromJSON(e)) + : [], + pageSize: isSet(object.page_size) ? globalThis.Number(object.page_size) : 0, + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: PermissionLookupSubjectRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = PermissionLookupSubjectRequestMetadata.toJSON(message.metadata); + } + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.permission !== "") { + obj.permission = message.permission; + } + if (message.subjectReference !== undefined) { + obj.subject_reference = RelationReference.toJSON(message.subjectReference); + } + if (message.context !== undefined) { + obj.context = Context.toJSON(message.context); + } + if (message.arguments?.length) { + obj.arguments = message.arguments.map((e) => Argument.toJSON(e)); + } + if (message.pageSize !== 0) { + obj.page_size = Math.round(message.pageSize); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupSubjectRequest { + return PermissionLookupSubjectRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupSubjectRequest { + const message = createBasePermissionLookupSubjectRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? PermissionLookupSubjectRequestMetadata.fromPartial(object.metadata) + : undefined; + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.permission = object.permission ?? ""; + message.subjectReference = (object.subjectReference !== undefined && object.subjectReference !== null) + ? RelationReference.fromPartial(object.subjectReference) + : undefined; + message.context = (object.context !== undefined && object.context !== null) + ? Context.fromPartial(object.context) + : undefined; + message.arguments = object.arguments?.map((e) => Argument.fromPartial(e)) || []; + message.pageSize = object.pageSize ?? 0; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBasePermissionLookupSubjectRequestMetadata(): PermissionLookupSubjectRequestMetadata { + return { schemaVersion: "", snapToken: "", depth: 0 }; +} + +export const PermissionLookupSubjectRequestMetadata: MessageFns = { + encode(message: PermissionLookupSubjectRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + if (message.snapToken !== "") { + writer.uint32(18).string(message.snapToken); + } + if (message.depth !== 0) { + writer.uint32(24).int32(message.depth); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupSubjectRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupSubjectRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.snapToken = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.depth = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupSubjectRequestMetadata { + return { + schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "", + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + depth: isSet(object.depth) ? globalThis.Number(object.depth) : 0, + }; + }, + + toJSON(message: PermissionLookupSubjectRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + if (message.depth !== 0) { + obj.depth = Math.round(message.depth); + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupSubjectRequestMetadata { + return PermissionLookupSubjectRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupSubjectRequestMetadata { + const message = createBasePermissionLookupSubjectRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + message.snapToken = object.snapToken ?? ""; + message.depth = object.depth ?? 0; + return message; + }, +}; + +function createBasePermissionLookupSubjectResponse(): PermissionLookupSubjectResponse { + return { subjectIds: [], continuousToken: "" }; +} + +export const PermissionLookupSubjectResponse: MessageFns = { + encode(message: PermissionLookupSubjectResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.subjectIds) { + writer.uint32(10).string(v!); + } + if (message.continuousToken !== "") { + writer.uint32(18).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionLookupSubjectResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionLookupSubjectResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.subjectIds.push(reader.string()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionLookupSubjectResponse { + return { + subjectIds: globalThis.Array.isArray(object?.subject_ids) + ? object.subject_ids.map((e: any) => globalThis.String(e)) + : [], + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: PermissionLookupSubjectResponse): unknown { + const obj: any = {}; + if (message.subjectIds?.length) { + obj.subject_ids = message.subjectIds; + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): PermissionLookupSubjectResponse { + return PermissionLookupSubjectResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionLookupSubjectResponse { + const message = createBasePermissionLookupSubjectResponse(); + message.subjectIds = object.subjectIds?.map((e) => e) || []; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBasePermissionSubjectPermissionRequest(): PermissionSubjectPermissionRequest { + return { tenantId: "", metadata: undefined, entity: undefined, subject: undefined, context: undefined }; +} + +export const PermissionSubjectPermissionRequest: MessageFns = { + encode(message: PermissionSubjectPermissionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + PermissionSubjectPermissionRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.entity !== undefined) { + Entity.encode(message.entity, writer.uint32(26).fork()).join(); + } + if (message.subject !== undefined) { + Subject.encode(message.subject, writer.uint32(34).fork()).join(); + } + if (message.context !== undefined) { + Context.encode(message.context, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionSubjectPermissionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionSubjectPermissionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = PermissionSubjectPermissionRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.entity = Entity.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.subject = Subject.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.context = Context.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionSubjectPermissionRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) + ? PermissionSubjectPermissionRequestMetadata.fromJSON(object.metadata) + : undefined, + entity: isSet(object.entity) ? Entity.fromJSON(object.entity) : undefined, + subject: isSet(object.subject) ? Subject.fromJSON(object.subject) : undefined, + context: isSet(object.context) ? Context.fromJSON(object.context) : undefined, + }; + }, + + toJSON(message: PermissionSubjectPermissionRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = PermissionSubjectPermissionRequestMetadata.toJSON(message.metadata); + } + if (message.entity !== undefined) { + obj.entity = Entity.toJSON(message.entity); + } + if (message.subject !== undefined) { + obj.subject = Subject.toJSON(message.subject); + } + if (message.context !== undefined) { + obj.context = Context.toJSON(message.context); + } + return obj; + }, + + create(base?: DeepPartial): PermissionSubjectPermissionRequest { + return PermissionSubjectPermissionRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionSubjectPermissionRequest { + const message = createBasePermissionSubjectPermissionRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? PermissionSubjectPermissionRequestMetadata.fromPartial(object.metadata) + : undefined; + message.entity = (object.entity !== undefined && object.entity !== null) + ? Entity.fromPartial(object.entity) + : undefined; + message.subject = (object.subject !== undefined && object.subject !== null) + ? Subject.fromPartial(object.subject) + : undefined; + message.context = (object.context !== undefined && object.context !== null) + ? Context.fromPartial(object.context) + : undefined; + return message; + }, +}; + +function createBasePermissionSubjectPermissionRequestMetadata(): PermissionSubjectPermissionRequestMetadata { + return { schemaVersion: "", snapToken: "", onlyPermission: false, depth: 0 }; +} + +export const PermissionSubjectPermissionRequestMetadata: MessageFns = { + encode(message: PermissionSubjectPermissionRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + if (message.snapToken !== "") { + writer.uint32(18).string(message.snapToken); + } + if (message.onlyPermission !== false) { + writer.uint32(24).bool(message.onlyPermission); + } + if (message.depth !== 0) { + writer.uint32(32).int32(message.depth); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionSubjectPermissionRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionSubjectPermissionRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.snapToken = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.onlyPermission = reader.bool(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.depth = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionSubjectPermissionRequestMetadata { + return { + schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "", + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + onlyPermission: isSet(object.only_permission) ? globalThis.Boolean(object.only_permission) : false, + depth: isSet(object.depth) ? globalThis.Number(object.depth) : 0, + }; + }, + + toJSON(message: PermissionSubjectPermissionRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + if (message.onlyPermission !== false) { + obj.only_permission = message.onlyPermission; + } + if (message.depth !== 0) { + obj.depth = Math.round(message.depth); + } + return obj; + }, + + create(base?: DeepPartial): PermissionSubjectPermissionRequestMetadata { + return PermissionSubjectPermissionRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): PermissionSubjectPermissionRequestMetadata { + const message = createBasePermissionSubjectPermissionRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + message.snapToken = object.snapToken ?? ""; + message.onlyPermission = object.onlyPermission ?? false; + message.depth = object.depth ?? 0; + return message; + }, +}; + +function createBasePermissionSubjectPermissionResponse(): PermissionSubjectPermissionResponse { + return { results: {} }; +} + +export const PermissionSubjectPermissionResponse: MessageFns = { + encode(message: PermissionSubjectPermissionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.results).forEach(([key, value]) => { + PermissionSubjectPermissionResponse_ResultsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()) + .join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionSubjectPermissionResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionSubjectPermissionResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = PermissionSubjectPermissionResponse_ResultsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.results[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionSubjectPermissionResponse { + return { + results: isObject(object.results) + ? Object.entries(object.results).reduce<{ [key: string]: CheckResult }>((acc, [key, value]) => { + acc[key] = checkResultFromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: PermissionSubjectPermissionResponse): unknown { + const obj: any = {}; + if (message.results) { + const entries = Object.entries(message.results); + if (entries.length > 0) { + obj.results = {}; + entries.forEach(([k, v]) => { + obj.results[k] = checkResultToJSON(v); + }); + } + } + return obj; + }, + + create(base?: DeepPartial): PermissionSubjectPermissionResponse { + return PermissionSubjectPermissionResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PermissionSubjectPermissionResponse { + const message = createBasePermissionSubjectPermissionResponse(); + message.results = Object.entries(object.results ?? {}).reduce<{ [key: string]: CheckResult }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value as CheckResult; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBasePermissionSubjectPermissionResponse_ResultsEntry(): PermissionSubjectPermissionResponse_ResultsEntry { + return { key: "", value: 0 }; +} + +export const PermissionSubjectPermissionResponse_ResultsEntry: MessageFns< + PermissionSubjectPermissionResponse_ResultsEntry +> = { + encode( + message: PermissionSubjectPermissionResponse_ResultsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== 0) { + writer.uint32(16).int32(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PermissionSubjectPermissionResponse_ResultsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePermissionSubjectPermissionResponse_ResultsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.value = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PermissionSubjectPermissionResponse_ResultsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? checkResultFromJSON(object.value) : 0, + }; + }, + + toJSON(message: PermissionSubjectPermissionResponse_ResultsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== 0) { + obj.value = checkResultToJSON(message.value); + } + return obj; + }, + + create( + base?: DeepPartial, + ): PermissionSubjectPermissionResponse_ResultsEntry { + return PermissionSubjectPermissionResponse_ResultsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): PermissionSubjectPermissionResponse_ResultsEntry { + const message = createBasePermissionSubjectPermissionResponse_ResultsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseWatchRequest(): WatchRequest { + return { tenantId: "", snapToken: "" }; +} + +export const WatchRequest: MessageFns = { + encode(message: WatchRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.snapToken !== "") { + writer.uint32(18).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): WatchRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWatchRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): WatchRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "", + }; + }, + + toJSON(message: WatchRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): WatchRequest { + return WatchRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): WatchRequest { + const message = createBaseWatchRequest(); + message.tenantId = object.tenantId ?? ""; + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseWatchResponse(): WatchResponse { + return { changes: undefined }; +} + +export const WatchResponse: MessageFns = { + encode(message: WatchResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.changes !== undefined) { + DataChanges.encode(message.changes, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): WatchResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseWatchResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.changes = DataChanges.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): WatchResponse { + return { changes: isSet(object.changes) ? DataChanges.fromJSON(object.changes) : undefined }; + }, + + toJSON(message: WatchResponse): unknown { + const obj: any = {}; + if (message.changes !== undefined) { + obj.changes = DataChanges.toJSON(message.changes); + } + return obj; + }, + + create(base?: DeepPartial): WatchResponse { + return WatchResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): WatchResponse { + const message = createBaseWatchResponse(); + message.changes = (object.changes !== undefined && object.changes !== null) + ? DataChanges.fromPartial(object.changes) + : undefined; + return message; + }, +}; + +function createBaseSchemaWriteRequest(): SchemaWriteRequest { + return { tenantId: "", schema: "" }; +} + +export const SchemaWriteRequest: MessageFns = { + encode(message: SchemaWriteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.schema !== "") { + writer.uint32(18).string(message.schema); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaWriteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaWriteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.schema = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaWriteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + schema: isSet(object.schema) ? globalThis.String(object.schema) : "", + }; + }, + + toJSON(message: SchemaWriteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.schema !== "") { + obj.schema = message.schema; + } + return obj; + }, + + create(base?: DeepPartial): SchemaWriteRequest { + return SchemaWriteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaWriteRequest { + const message = createBaseSchemaWriteRequest(); + message.tenantId = object.tenantId ?? ""; + message.schema = object.schema ?? ""; + return message; + }, +}; + +function createBaseSchemaWriteResponse(): SchemaWriteResponse { + return { schemaVersion: "" }; +} + +export const SchemaWriteResponse: MessageFns = { + encode(message: SchemaWriteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaWriteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaWriteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaWriteResponse { + return { schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "" }; + }, + + toJSON(message: SchemaWriteResponse): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + return obj; + }, + + create(base?: DeepPartial): SchemaWriteResponse { + return SchemaWriteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaWriteResponse { + const message = createBaseSchemaWriteResponse(); + message.schemaVersion = object.schemaVersion ?? ""; + return message; + }, +}; + +function createBaseSchemaPartialWriteRequest(): SchemaPartialWriteRequest { + return { tenantId: "", metadata: undefined, partials: {} }; +} + +export const SchemaPartialWriteRequest: MessageFns = { + encode(message: SchemaPartialWriteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + SchemaPartialWriteRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + Object.entries(message.partials).forEach(([key, value]) => { + SchemaPartialWriteRequest_PartialsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaPartialWriteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaPartialWriteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = SchemaPartialWriteRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + const entry3 = SchemaPartialWriteRequest_PartialsEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.partials[entry3.key] = entry3.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaPartialWriteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? SchemaPartialWriteRequestMetadata.fromJSON(object.metadata) : undefined, + partials: isObject(object.partials) + ? Object.entries(object.partials).reduce<{ [key: string]: Partials }>((acc, [key, value]) => { + acc[key] = Partials.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: SchemaPartialWriteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = SchemaPartialWriteRequestMetadata.toJSON(message.metadata); + } + if (message.partials) { + const entries = Object.entries(message.partials); + if (entries.length > 0) { + obj.partials = {}; + entries.forEach(([k, v]) => { + obj.partials[k] = Partials.toJSON(v); + }); + } + } + return obj; + }, + + create(base?: DeepPartial): SchemaPartialWriteRequest { + return SchemaPartialWriteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaPartialWriteRequest { + const message = createBaseSchemaPartialWriteRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? SchemaPartialWriteRequestMetadata.fromPartial(object.metadata) + : undefined; + message.partials = Object.entries(object.partials ?? {}).reduce<{ [key: string]: Partials }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Partials.fromPartial(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseSchemaPartialWriteRequest_PartialsEntry(): SchemaPartialWriteRequest_PartialsEntry { + return { key: "", value: undefined }; +} + +export const SchemaPartialWriteRequest_PartialsEntry: MessageFns = { + encode(message: SchemaPartialWriteRequest_PartialsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Partials.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaPartialWriteRequest_PartialsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaPartialWriteRequest_PartialsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Partials.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaPartialWriteRequest_PartialsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Partials.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: SchemaPartialWriteRequest_PartialsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Partials.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): SchemaPartialWriteRequest_PartialsEntry { + return SchemaPartialWriteRequest_PartialsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaPartialWriteRequest_PartialsEntry { + const message = createBaseSchemaPartialWriteRequest_PartialsEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? Partials.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseSchemaPartialWriteRequestMetadata(): SchemaPartialWriteRequestMetadata { + return { schemaVersion: "" }; +} + +export const SchemaPartialWriteRequestMetadata: MessageFns = { + encode(message: SchemaPartialWriteRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaPartialWriteRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaPartialWriteRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaPartialWriteRequestMetadata { + return { schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "" }; + }, + + toJSON(message: SchemaPartialWriteRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + return obj; + }, + + create(base?: DeepPartial): SchemaPartialWriteRequestMetadata { + return SchemaPartialWriteRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaPartialWriteRequestMetadata { + const message = createBaseSchemaPartialWriteRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + return message; + }, +}; + +function createBaseSchemaPartialWriteResponse(): SchemaPartialWriteResponse { + return { schemaVersion: "" }; +} + +export const SchemaPartialWriteResponse: MessageFns = { + encode(message: SchemaPartialWriteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaPartialWriteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaPartialWriteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaPartialWriteResponse { + return { schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "" }; + }, + + toJSON(message: SchemaPartialWriteResponse): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + return obj; + }, + + create(base?: DeepPartial): SchemaPartialWriteResponse { + return SchemaPartialWriteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaPartialWriteResponse { + const message = createBaseSchemaPartialWriteResponse(); + message.schemaVersion = object.schemaVersion ?? ""; + return message; + }, +}; + +function createBaseSchemaReadRequest(): SchemaReadRequest { + return { tenantId: "", metadata: undefined }; +} + +export const SchemaReadRequest: MessageFns = { + encode(message: SchemaReadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + SchemaReadRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaReadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaReadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = SchemaReadRequestMetadata.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaReadRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? SchemaReadRequestMetadata.fromJSON(object.metadata) : undefined, + }; + }, + + toJSON(message: SchemaReadRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = SchemaReadRequestMetadata.toJSON(message.metadata); + } + return obj; + }, + + create(base?: DeepPartial): SchemaReadRequest { + return SchemaReadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaReadRequest { + const message = createBaseSchemaReadRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? SchemaReadRequestMetadata.fromPartial(object.metadata) + : undefined; + return message; + }, +}; + +function createBaseSchemaReadRequestMetadata(): SchemaReadRequestMetadata { + return { schemaVersion: "" }; +} + +export const SchemaReadRequestMetadata: MessageFns = { + encode(message: SchemaReadRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaReadRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaReadRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaReadRequestMetadata { + return { schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "" }; + }, + + toJSON(message: SchemaReadRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + return obj; + }, + + create(base?: DeepPartial): SchemaReadRequestMetadata { + return SchemaReadRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaReadRequestMetadata { + const message = createBaseSchemaReadRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + return message; + }, +}; + +function createBaseSchemaReadResponse(): SchemaReadResponse { + return { schema: undefined }; +} + +export const SchemaReadResponse: MessageFns = { + encode(message: SchemaReadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schema !== undefined) { + SchemaDefinition1.encode(message.schema, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaReadResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaReadResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schema = SchemaDefinition1.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaReadResponse { + return { schema: isSet(object.schema) ? SchemaDefinition1.fromJSON(object.schema) : undefined }; + }, + + toJSON(message: SchemaReadResponse): unknown { + const obj: any = {}; + if (message.schema !== undefined) { + obj.schema = SchemaDefinition1.toJSON(message.schema); + } + return obj; + }, + + create(base?: DeepPartial): SchemaReadResponse { + return SchemaReadResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaReadResponse { + const message = createBaseSchemaReadResponse(); + message.schema = (object.schema !== undefined && object.schema !== null) + ? SchemaDefinition1.fromPartial(object.schema) + : undefined; + return message; + }, +}; + +function createBaseSchemaListRequest(): SchemaListRequest { + return { tenantId: "", pageSize: 0, continuousToken: "" }; +} + +export const SchemaListRequest: MessageFns = { + encode(message: SchemaListRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.pageSize !== 0) { + writer.uint32(16).uint32(message.pageSize); + } + if (message.continuousToken !== "") { + writer.uint32(26).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaListRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaListRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pageSize = reader.uint32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaListRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + pageSize: isSet(object.page_size) ? globalThis.Number(object.page_size) : 0, + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: SchemaListRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.pageSize !== 0) { + obj.page_size = Math.round(message.pageSize); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): SchemaListRequest { + return SchemaListRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaListRequest { + const message = createBaseSchemaListRequest(); + message.tenantId = object.tenantId ?? ""; + message.pageSize = object.pageSize ?? 0; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBaseSchemaListResponse(): SchemaListResponse { + return { head: "", schemas: [], continuousToken: "" }; +} + +export const SchemaListResponse: MessageFns = { + encode(message: SchemaListResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.head !== "") { + writer.uint32(10).string(message.head); + } + for (const v of message.schemas) { + SchemaList.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.continuousToken !== "") { + writer.uint32(26).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaListResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaListResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.head = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.schemas.push(SchemaList.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaListResponse { + return { + head: isSet(object.head) ? globalThis.String(object.head) : "", + schemas: globalThis.Array.isArray(object?.schemas) ? object.schemas.map((e: any) => SchemaList.fromJSON(e)) : [], + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: SchemaListResponse): unknown { + const obj: any = {}; + if (message.head !== "") { + obj.head = message.head; + } + if (message.schemas?.length) { + obj.schemas = message.schemas.map((e) => SchemaList.toJSON(e)); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): SchemaListResponse { + return SchemaListResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaListResponse { + const message = createBaseSchemaListResponse(); + message.head = object.head ?? ""; + message.schemas = object.schemas?.map((e) => SchemaList.fromPartial(e)) || []; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBaseSchemaList(): SchemaList { + return { version: "", createdAt: "" }; +} + +export const SchemaList: MessageFns = { + encode(message: SchemaList, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.createdAt !== "") { + writer.uint32(18).string(message.createdAt); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SchemaList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchemaList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.version = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.createdAt = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SchemaList { + return { + version: isSet(object.version) ? globalThis.String(object.version) : "", + createdAt: isSet(object.created_at) ? globalThis.String(object.created_at) : "", + }; + }, + + toJSON(message: SchemaList): unknown { + const obj: any = {}; + if (message.version !== "") { + obj.version = message.version; + } + if (message.createdAt !== "") { + obj.created_at = message.createdAt; + } + return obj; + }, + + create(base?: DeepPartial): SchemaList { + return SchemaList.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SchemaList { + const message = createBaseSchemaList(); + message.version = object.version ?? ""; + message.createdAt = object.createdAt ?? ""; + return message; + }, +}; + +function createBaseDataWriteRequest(): DataWriteRequest { + return { tenantId: "", metadata: undefined, tuples: [], attributes: [] }; +} + +export const DataWriteRequest: MessageFns = { + encode(message: DataWriteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + DataWriteRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + for (const v of message.tuples) { + Tuple.encode(v!, writer.uint32(26).fork()).join(); + } + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataWriteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataWriteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = DataWriteRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.tuples.push(Tuple.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataWriteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? DataWriteRequestMetadata.fromJSON(object.metadata) : undefined, + tuples: globalThis.Array.isArray(object?.tuples) ? object.tuples.map((e: any) => Tuple.fromJSON(e)) : [], + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + }; + }, + + toJSON(message: DataWriteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = DataWriteRequestMetadata.toJSON(message.metadata); + } + if (message.tuples?.length) { + obj.tuples = message.tuples.map((e) => Tuple.toJSON(e)); + } + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): DataWriteRequest { + return DataWriteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataWriteRequest { + const message = createBaseDataWriteRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? DataWriteRequestMetadata.fromPartial(object.metadata) + : undefined; + message.tuples = object.tuples?.map((e) => Tuple.fromPartial(e)) || []; + message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDataWriteRequestMetadata(): DataWriteRequestMetadata { + return { schemaVersion: "" }; +} + +export const DataWriteRequestMetadata: MessageFns = { + encode(message: DataWriteRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataWriteRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataWriteRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataWriteRequestMetadata { + return { schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "" }; + }, + + toJSON(message: DataWriteRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + return obj; + }, + + create(base?: DeepPartial): DataWriteRequestMetadata { + return DataWriteRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataWriteRequestMetadata { + const message = createBaseDataWriteRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + return message; + }, +}; + +function createBaseDataWriteResponse(): DataWriteResponse { + return { snapToken: "" }; +} + +export const DataWriteResponse: MessageFns = { + encode(message: DataWriteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataWriteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataWriteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataWriteResponse { + return { snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "" }; + }, + + toJSON(message: DataWriteResponse): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): DataWriteResponse { + return DataWriteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataWriteResponse { + const message = createBaseDataWriteResponse(); + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseRelationshipWriteRequest(): RelationshipWriteRequest { + return { tenantId: "", metadata: undefined, tuples: [] }; +} + +export const RelationshipWriteRequest: MessageFns = { + encode(message: RelationshipWriteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + RelationshipWriteRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + for (const v of message.tuples) { + Tuple.encode(v!, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipWriteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipWriteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = RelationshipWriteRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.tuples.push(Tuple.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipWriteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? RelationshipWriteRequestMetadata.fromJSON(object.metadata) : undefined, + tuples: globalThis.Array.isArray(object?.tuples) ? object.tuples.map((e: any) => Tuple.fromJSON(e)) : [], + }; + }, + + toJSON(message: RelationshipWriteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = RelationshipWriteRequestMetadata.toJSON(message.metadata); + } + if (message.tuples?.length) { + obj.tuples = message.tuples.map((e) => Tuple.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): RelationshipWriteRequest { + return RelationshipWriteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipWriteRequest { + const message = createBaseRelationshipWriteRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? RelationshipWriteRequestMetadata.fromPartial(object.metadata) + : undefined; + message.tuples = object.tuples?.map((e) => Tuple.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseRelationshipWriteRequestMetadata(): RelationshipWriteRequestMetadata { + return { schemaVersion: "" }; +} + +export const RelationshipWriteRequestMetadata: MessageFns = { + encode(message: RelationshipWriteRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.schemaVersion !== "") { + writer.uint32(10).string(message.schemaVersion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipWriteRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipWriteRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.schemaVersion = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipWriteRequestMetadata { + return { schemaVersion: isSet(object.schema_version) ? globalThis.String(object.schema_version) : "" }; + }, + + toJSON(message: RelationshipWriteRequestMetadata): unknown { + const obj: any = {}; + if (message.schemaVersion !== "") { + obj.schema_version = message.schemaVersion; + } + return obj; + }, + + create(base?: DeepPartial): RelationshipWriteRequestMetadata { + return RelationshipWriteRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipWriteRequestMetadata { + const message = createBaseRelationshipWriteRequestMetadata(); + message.schemaVersion = object.schemaVersion ?? ""; + return message; + }, +}; + +function createBaseRelationshipWriteResponse(): RelationshipWriteResponse { + return { snapToken: "" }; +} + +export const RelationshipWriteResponse: MessageFns = { + encode(message: RelationshipWriteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipWriteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipWriteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipWriteResponse { + return { snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "" }; + }, + + toJSON(message: RelationshipWriteResponse): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): RelationshipWriteResponse { + return RelationshipWriteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipWriteResponse { + const message = createBaseRelationshipWriteResponse(); + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseRelationshipReadRequest(): RelationshipReadRequest { + return { tenantId: "", metadata: undefined, filter: undefined, pageSize: 0, continuousToken: "" }; +} + +export const RelationshipReadRequest: MessageFns = { + encode(message: RelationshipReadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + RelationshipReadRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.filter !== undefined) { + TupleFilter.encode(message.filter, writer.uint32(26).fork()).join(); + } + if (message.pageSize !== 0) { + writer.uint32(32).uint32(message.pageSize); + } + if (message.continuousToken !== "") { + writer.uint32(42).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipReadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipReadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = RelationshipReadRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.filter = TupleFilter.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.pageSize = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipReadRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? RelationshipReadRequestMetadata.fromJSON(object.metadata) : undefined, + filter: isSet(object.filter) ? TupleFilter.fromJSON(object.filter) : undefined, + pageSize: isSet(object.page_size) ? globalThis.Number(object.page_size) : 0, + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: RelationshipReadRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = RelationshipReadRequestMetadata.toJSON(message.metadata); + } + if (message.filter !== undefined) { + obj.filter = TupleFilter.toJSON(message.filter); + } + if (message.pageSize !== 0) { + obj.page_size = Math.round(message.pageSize); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): RelationshipReadRequest { + return RelationshipReadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipReadRequest { + const message = createBaseRelationshipReadRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? RelationshipReadRequestMetadata.fromPartial(object.metadata) + : undefined; + message.filter = (object.filter !== undefined && object.filter !== null) + ? TupleFilter.fromPartial(object.filter) + : undefined; + message.pageSize = object.pageSize ?? 0; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBaseRelationshipReadRequestMetadata(): RelationshipReadRequestMetadata { + return { snapToken: "" }; +} + +export const RelationshipReadRequestMetadata: MessageFns = { + encode(message: RelationshipReadRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipReadRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipReadRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipReadRequestMetadata { + return { snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "" }; + }, + + toJSON(message: RelationshipReadRequestMetadata): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): RelationshipReadRequestMetadata { + return RelationshipReadRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipReadRequestMetadata { + const message = createBaseRelationshipReadRequestMetadata(); + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseRelationshipReadResponse(): RelationshipReadResponse { + return { tuples: [], continuousToken: "" }; +} + +export const RelationshipReadResponse: MessageFns = { + encode(message: RelationshipReadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.tuples) { + Tuple.encode(v!, writer.uint32(10).fork()).join(); + } + if (message.continuousToken !== "") { + writer.uint32(18).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipReadResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipReadResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tuples.push(Tuple.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipReadResponse { + return { + tuples: globalThis.Array.isArray(object?.tuples) ? object.tuples.map((e: any) => Tuple.fromJSON(e)) : [], + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: RelationshipReadResponse): unknown { + const obj: any = {}; + if (message.tuples?.length) { + obj.tuples = message.tuples.map((e) => Tuple.toJSON(e)); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): RelationshipReadResponse { + return RelationshipReadResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipReadResponse { + const message = createBaseRelationshipReadResponse(); + message.tuples = object.tuples?.map((e) => Tuple.fromPartial(e)) || []; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBaseAttributeReadRequest(): AttributeReadRequest { + return { tenantId: "", metadata: undefined, filter: undefined, pageSize: 0, continuousToken: "" }; +} + +export const AttributeReadRequest: MessageFns = { + encode(message: AttributeReadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.metadata !== undefined) { + AttributeReadRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); + } + if (message.filter !== undefined) { + AttributeFilter.encode(message.filter, writer.uint32(26).fork()).join(); + } + if (message.pageSize !== 0) { + writer.uint32(32).uint32(message.pageSize); + } + if (message.continuousToken !== "") { + writer.uint32(42).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AttributeReadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributeReadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.metadata = AttributeReadRequestMetadata.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.filter = AttributeFilter.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.pageSize = reader.uint32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributeReadRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + metadata: isSet(object.metadata) ? AttributeReadRequestMetadata.fromJSON(object.metadata) : undefined, + filter: isSet(object.filter) ? AttributeFilter.fromJSON(object.filter) : undefined, + pageSize: isSet(object.page_size) ? globalThis.Number(object.page_size) : 0, + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: AttributeReadRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.metadata !== undefined) { + obj.metadata = AttributeReadRequestMetadata.toJSON(message.metadata); + } + if (message.filter !== undefined) { + obj.filter = AttributeFilter.toJSON(message.filter); + } + if (message.pageSize !== 0) { + obj.page_size = Math.round(message.pageSize); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): AttributeReadRequest { + return AttributeReadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AttributeReadRequest { + const message = createBaseAttributeReadRequest(); + message.tenantId = object.tenantId ?? ""; + message.metadata = (object.metadata !== undefined && object.metadata !== null) + ? AttributeReadRequestMetadata.fromPartial(object.metadata) + : undefined; + message.filter = (object.filter !== undefined && object.filter !== null) + ? AttributeFilter.fromPartial(object.filter) + : undefined; + message.pageSize = object.pageSize ?? 0; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBaseAttributeReadRequestMetadata(): AttributeReadRequestMetadata { + return { snapToken: "" }; +} + +export const AttributeReadRequestMetadata: MessageFns = { + encode(message: AttributeReadRequestMetadata, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AttributeReadRequestMetadata { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributeReadRequestMetadata(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributeReadRequestMetadata { + return { snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "" }; + }, + + toJSON(message: AttributeReadRequestMetadata): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): AttributeReadRequestMetadata { + return AttributeReadRequestMetadata.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AttributeReadRequestMetadata { + const message = createBaseAttributeReadRequestMetadata(); + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseAttributeReadResponse(): AttributeReadResponse { + return { attributes: [], continuousToken: "" }; +} + +export const AttributeReadResponse: MessageFns = { + encode(message: AttributeReadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.attributes) { + Attribute.encode(v!, writer.uint32(10).fork()).join(); + } + if (message.continuousToken !== "") { + writer.uint32(18).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AttributeReadResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAttributeReadResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.attributes.push(Attribute.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AttributeReadResponse { + return { + attributes: globalThis.Array.isArray(object?.attributes) + ? object.attributes.map((e: any) => Attribute.fromJSON(e)) + : [], + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: AttributeReadResponse): unknown { + const obj: any = {}; + if (message.attributes?.length) { + obj.attributes = message.attributes.map((e) => Attribute.toJSON(e)); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): AttributeReadResponse { + return AttributeReadResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AttributeReadResponse { + const message = createBaseAttributeReadResponse(); + message.attributes = object.attributes?.map((e) => Attribute.fromPartial(e)) || []; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBaseDataDeleteRequest(): DataDeleteRequest { + return { tenantId: "", tupleFilter: undefined, attributeFilter: undefined }; +} + +export const DataDeleteRequest: MessageFns = { + encode(message: DataDeleteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.tupleFilter !== undefined) { + TupleFilter.encode(message.tupleFilter, writer.uint32(18).fork()).join(); + } + if (message.attributeFilter !== undefined) { + AttributeFilter.encode(message.attributeFilter, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataDeleteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataDeleteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.tupleFilter = TupleFilter.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.attributeFilter = AttributeFilter.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataDeleteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + tupleFilter: isSet(object.tuple_filter) ? TupleFilter.fromJSON(object.tuple_filter) : undefined, + attributeFilter: isSet(object.attribute_filter) ? AttributeFilter.fromJSON(object.attribute_filter) : undefined, + }; + }, + + toJSON(message: DataDeleteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.tupleFilter !== undefined) { + obj.tuple_filter = TupleFilter.toJSON(message.tupleFilter); + } + if (message.attributeFilter !== undefined) { + obj.attribute_filter = AttributeFilter.toJSON(message.attributeFilter); + } + return obj; + }, + + create(base?: DeepPartial): DataDeleteRequest { + return DataDeleteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataDeleteRequest { + const message = createBaseDataDeleteRequest(); + message.tenantId = object.tenantId ?? ""; + message.tupleFilter = (object.tupleFilter !== undefined && object.tupleFilter !== null) + ? TupleFilter.fromPartial(object.tupleFilter) + : undefined; + message.attributeFilter = (object.attributeFilter !== undefined && object.attributeFilter !== null) + ? AttributeFilter.fromPartial(object.attributeFilter) + : undefined; + return message; + }, +}; + +function createBaseDataDeleteResponse(): DataDeleteResponse { + return { snapToken: "" }; +} + +export const DataDeleteResponse: MessageFns = { + encode(message: DataDeleteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DataDeleteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDataDeleteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DataDeleteResponse { + return { snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "" }; + }, + + toJSON(message: DataDeleteResponse): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): DataDeleteResponse { + return DataDeleteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DataDeleteResponse { + const message = createBaseDataDeleteResponse(); + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseRelationshipDeleteRequest(): RelationshipDeleteRequest { + return { tenantId: "", filter: undefined }; +} + +export const RelationshipDeleteRequest: MessageFns = { + encode(message: RelationshipDeleteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.filter !== undefined) { + TupleFilter.encode(message.filter, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipDeleteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipDeleteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.filter = TupleFilter.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipDeleteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + filter: isSet(object.filter) ? TupleFilter.fromJSON(object.filter) : undefined, + }; + }, + + toJSON(message: RelationshipDeleteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.filter !== undefined) { + obj.filter = TupleFilter.toJSON(message.filter); + } + return obj; + }, + + create(base?: DeepPartial): RelationshipDeleteRequest { + return RelationshipDeleteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipDeleteRequest { + const message = createBaseRelationshipDeleteRequest(); + message.tenantId = object.tenantId ?? ""; + message.filter = (object.filter !== undefined && object.filter !== null) + ? TupleFilter.fromPartial(object.filter) + : undefined; + return message; + }, +}; + +function createBaseRelationshipDeleteResponse(): RelationshipDeleteResponse { + return { snapToken: "" }; +} + +export const RelationshipDeleteResponse: MessageFns = { + encode(message: RelationshipDeleteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RelationshipDeleteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRelationshipDeleteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RelationshipDeleteResponse { + return { snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "" }; + }, + + toJSON(message: RelationshipDeleteResponse): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): RelationshipDeleteResponse { + return RelationshipDeleteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RelationshipDeleteResponse { + const message = createBaseRelationshipDeleteResponse(); + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseBundleRunRequest(): BundleRunRequest { + return { tenantId: "", name: "", arguments: {} }; +} + +export const BundleRunRequest: MessageFns = { + encode(message: BundleRunRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + Object.entries(message.arguments).forEach(([key, value]) => { + BundleRunRequest_ArgumentsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleRunRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleRunRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.name = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + const entry3 = BundleRunRequest_ArgumentsEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.arguments[entry3.key] = entry3.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleRunRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + arguments: isObject(object.arguments) + ? Object.entries(object.arguments).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: BundleRunRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.arguments) { + const entries = Object.entries(message.arguments); + if (entries.length > 0) { + obj.arguments = {}; + entries.forEach(([k, v]) => { + obj.arguments[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): BundleRunRequest { + return BundleRunRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleRunRequest { + const message = createBaseBundleRunRequest(); + message.tenantId = object.tenantId ?? ""; + message.name = object.name ?? ""; + message.arguments = Object.entries(object.arguments ?? {}).reduce<{ [key: string]: string }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseBundleRunRequest_ArgumentsEntry(): BundleRunRequest_ArgumentsEntry { + return { key: "", value: "" }; +} + +export const BundleRunRequest_ArgumentsEntry: MessageFns = { + encode(message: BundleRunRequest_ArgumentsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleRunRequest_ArgumentsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleRunRequest_ArgumentsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleRunRequest_ArgumentsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: BundleRunRequest_ArgumentsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): BundleRunRequest_ArgumentsEntry { + return BundleRunRequest_ArgumentsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleRunRequest_ArgumentsEntry { + const message = createBaseBundleRunRequest_ArgumentsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseBundleRunResponse(): BundleRunResponse { + return { snapToken: "" }; +} + +export const BundleRunResponse: MessageFns = { + encode(message: BundleRunResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.snapToken !== "") { + writer.uint32(10).string(message.snapToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleRunResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleRunResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.snapToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleRunResponse { + return { snapToken: isSet(object.snap_token) ? globalThis.String(object.snap_token) : "" }; + }, + + toJSON(message: BundleRunResponse): unknown { + const obj: any = {}; + if (message.snapToken !== "") { + obj.snap_token = message.snapToken; + } + return obj; + }, + + create(base?: DeepPartial): BundleRunResponse { + return BundleRunResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleRunResponse { + const message = createBaseBundleRunResponse(); + message.snapToken = object.snapToken ?? ""; + return message; + }, +}; + +function createBaseBundleWriteRequest(): BundleWriteRequest { + return { tenantId: "", bundles: [] }; +} + +export const BundleWriteRequest: MessageFns = { + encode(message: BundleWriteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + for (const v of message.bundles) { + DataBundle.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleWriteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleWriteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bundles.push(DataBundle.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleWriteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + bundles: globalThis.Array.isArray(object?.bundles) ? object.bundles.map((e: any) => DataBundle.fromJSON(e)) : [], + }; + }, + + toJSON(message: BundleWriteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.bundles?.length) { + obj.bundles = message.bundles.map((e) => DataBundle.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): BundleWriteRequest { + return BundleWriteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleWriteRequest { + const message = createBaseBundleWriteRequest(); + message.tenantId = object.tenantId ?? ""; + message.bundles = object.bundles?.map((e) => DataBundle.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseBundleWriteResponse(): BundleWriteResponse { + return { names: [] }; +} + +export const BundleWriteResponse: MessageFns = { + encode(message: BundleWriteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.names) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleWriteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleWriteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.names.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleWriteResponse { + return { names: globalThis.Array.isArray(object?.names) ? object.names.map((e: any) => globalThis.String(e)) : [] }; + }, + + toJSON(message: BundleWriteResponse): unknown { + const obj: any = {}; + if (message.names?.length) { + obj.names = message.names; + } + return obj; + }, + + create(base?: DeepPartial): BundleWriteResponse { + return BundleWriteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleWriteResponse { + const message = createBaseBundleWriteResponse(); + message.names = object.names?.map((e) => e) || []; + return message; + }, +}; + +function createBaseBundleReadRequest(): BundleReadRequest { + return { tenantId: "", name: "" }; +} + +export const BundleReadRequest: MessageFns = { + encode(message: BundleReadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleReadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleReadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.name = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleReadRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + }; + }, + + toJSON(message: BundleReadRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.name !== "") { + obj.name = message.name; + } + return obj; + }, + + create(base?: DeepPartial): BundleReadRequest { + return BundleReadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleReadRequest { + const message = createBaseBundleReadRequest(); + message.tenantId = object.tenantId ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseBundleReadResponse(): BundleReadResponse { + return { bundle: undefined }; +} + +export const BundleReadResponse: MessageFns = { + encode(message: BundleReadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bundle !== undefined) { + DataBundle.encode(message.bundle, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleReadResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleReadResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bundle = DataBundle.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleReadResponse { + return { bundle: isSet(object.bundle) ? DataBundle.fromJSON(object.bundle) : undefined }; + }, + + toJSON(message: BundleReadResponse): unknown { + const obj: any = {}; + if (message.bundle !== undefined) { + obj.bundle = DataBundle.toJSON(message.bundle); + } + return obj; + }, + + create(base?: DeepPartial): BundleReadResponse { + return BundleReadResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleReadResponse { + const message = createBaseBundleReadResponse(); + message.bundle = (object.bundle !== undefined && object.bundle !== null) + ? DataBundle.fromPartial(object.bundle) + : undefined; + return message; + }, +}; + +function createBaseBundleDeleteRequest(): BundleDeleteRequest { + return { tenantId: "", name: "" }; +} + +export const BundleDeleteRequest: MessageFns = { + encode(message: BundleDeleteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleDeleteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleDeleteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.name = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleDeleteRequest { + return { + tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + }; + }, + + toJSON(message: BundleDeleteRequest): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + if (message.name !== "") { + obj.name = message.name; + } + return obj; + }, + + create(base?: DeepPartial): BundleDeleteRequest { + return BundleDeleteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleDeleteRequest { + const message = createBaseBundleDeleteRequest(); + message.tenantId = object.tenantId ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseBundleDeleteResponse(): BundleDeleteResponse { + return { name: "" }; +} + +export const BundleDeleteResponse: MessageFns = { + encode(message: BundleDeleteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BundleDeleteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBundleDeleteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BundleDeleteResponse { + return { name: isSet(object.name) ? globalThis.String(object.name) : "" }; + }, + + toJSON(message: BundleDeleteResponse): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + return obj; + }, + + create(base?: DeepPartial): BundleDeleteResponse { + return BundleDeleteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BundleDeleteResponse { + const message = createBaseBundleDeleteResponse(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseTenantCreateRequest(): TenantCreateRequest { + return { id: "", name: "" }; +} + +export const TenantCreateRequest: MessageFns = { + encode(message: TenantCreateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TenantCreateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTenantCreateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.name = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TenantCreateRequest { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + }; + }, + + toJSON(message: TenantCreateRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.name !== "") { + obj.name = message.name; + } + return obj; + }, + + create(base?: DeepPartial): TenantCreateRequest { + return TenantCreateRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TenantCreateRequest { + const message = createBaseTenantCreateRequest(); + message.id = object.id ?? ""; + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseTenantCreateResponse(): TenantCreateResponse { + return { tenant: undefined }; +} + +export const TenantCreateResponse: MessageFns = { + encode(message: TenantCreateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenant !== undefined) { + Tenant.encode(message.tenant, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TenantCreateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTenantCreateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenant = Tenant.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TenantCreateResponse { + return { tenant: isSet(object.tenant) ? Tenant.fromJSON(object.tenant) : undefined }; + }, + + toJSON(message: TenantCreateResponse): unknown { + const obj: any = {}; + if (message.tenant !== undefined) { + obj.tenant = Tenant.toJSON(message.tenant); + } + return obj; + }, + + create(base?: DeepPartial): TenantCreateResponse { + return TenantCreateResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TenantCreateResponse { + const message = createBaseTenantCreateResponse(); + message.tenant = (object.tenant !== undefined && object.tenant !== null) + ? Tenant.fromPartial(object.tenant) + : undefined; + return message; + }, +}; + +function createBaseTenantDeleteRequest(): TenantDeleteRequest { + return { id: "" }; +} + +export const TenantDeleteRequest: MessageFns = { + encode(message: TenantDeleteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TenantDeleteRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTenantDeleteRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TenantDeleteRequest { + return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; + }, + + toJSON(message: TenantDeleteRequest): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + return obj; + }, + + create(base?: DeepPartial): TenantDeleteRequest { + return TenantDeleteRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TenantDeleteRequest { + const message = createBaseTenantDeleteRequest(); + message.id = object.id ?? ""; + return message; + }, +}; + +function createBaseTenantDeleteResponse(): TenantDeleteResponse { + return { tenantId: "" }; +} + +export const TenantDeleteResponse: MessageFns = { + encode(message: TenantDeleteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tenantId !== "") { + writer.uint32(10).string(message.tenantId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TenantDeleteResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTenantDeleteResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenantId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TenantDeleteResponse { + return { tenantId: isSet(object.tenant_id) ? globalThis.String(object.tenant_id) : "" }; + }, + + toJSON(message: TenantDeleteResponse): unknown { + const obj: any = {}; + if (message.tenantId !== "") { + obj.tenant_id = message.tenantId; + } + return obj; + }, + + create(base?: DeepPartial): TenantDeleteResponse { + return TenantDeleteResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TenantDeleteResponse { + const message = createBaseTenantDeleteResponse(); + message.tenantId = object.tenantId ?? ""; + return message; + }, +}; + +function createBaseTenantListRequest(): TenantListRequest { + return { pageSize: 0, continuousToken: "" }; +} + +export const TenantListRequest: MessageFns = { + encode(message: TenantListRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pageSize !== 0) { + writer.uint32(8).uint32(message.pageSize); + } + if (message.continuousToken !== "") { + writer.uint32(18).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TenantListRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTenantListRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.pageSize = reader.uint32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TenantListRequest { + return { + pageSize: isSet(object.page_size) ? globalThis.Number(object.page_size) : 0, + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: TenantListRequest): unknown { + const obj: any = {}; + if (message.pageSize !== 0) { + obj.page_size = Math.round(message.pageSize); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): TenantListRequest { + return TenantListRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TenantListRequest { + const message = createBaseTenantListRequest(); + message.pageSize = object.pageSize ?? 0; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +function createBaseTenantListResponse(): TenantListResponse { + return { tenants: [], continuousToken: "" }; +} + +export const TenantListResponse: MessageFns = { + encode(message: TenantListResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.tenants) { + Tenant.encode(v!, writer.uint32(10).fork()).join(); + } + if (message.continuousToken !== "") { + writer.uint32(18).string(message.continuousToken); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TenantListResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTenantListResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tenants.push(Tenant.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.continuousToken = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TenantListResponse { + return { + tenants: globalThis.Array.isArray(object?.tenants) ? object.tenants.map((e: any) => Tenant.fromJSON(e)) : [], + continuousToken: isSet(object.continuous_token) ? globalThis.String(object.continuous_token) : "", + }; + }, + + toJSON(message: TenantListResponse): unknown { + const obj: any = {}; + if (message.tenants?.length) { + obj.tenants = message.tenants.map((e) => Tenant.toJSON(e)); + } + if (message.continuousToken !== "") { + obj.continuous_token = message.continuousToken; + } + return obj; + }, + + create(base?: DeepPartial): TenantListResponse { + return TenantListResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TenantListResponse { + const message = createBaseTenantListResponse(); + message.tenants = object.tenants?.map((e) => Tenant.fromPartial(e)) || []; + message.continuousToken = object.continuousToken ?? ""; + return message; + }, +}; + +/** + * * PERMISSION SERVICE ** + * Permission service contains methods to interact with permissions. + */ +export type PermissionDefinition = typeof PermissionDefinition; +export const PermissionDefinition = { + name: "Permission", + fullName: "base.v1.Permission", + methods: { + /** + * Check method receives a PermissionCheckRequest and returns a PermissionCheckResponse. + * It is used to determine whether a specific user has permission to perform an action on a resource. + * For example, "Can the user 1 push to repository 1?" + */ + check: { + name: "Check", + requestType: PermissionCheckRequest, + requestStream: false, + responseType: PermissionCheckResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 227, + 12, + 10, + 10, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 18, + 9, + 99, + 104, + 101, + 99, + 107, + 32, + 97, + 112, + 105, + 42, + 17, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 46, + 99, + 104, + 101, + 99, + 107, + 106, + 182, + 12, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 164, + 12, + 50, + 161, + 12, + 10, + 192, + 4, + 42, + 189, + 4, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 157, + 4, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 146, + 4, + 26, + 143, + 4, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 67, + 104, + 101, + 99, + 107, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 67, + 104, + 101, + 99, + 107, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 67, + 104, + 101, + 99, + 107, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 68, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 38, + 118, + 49, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 105, + 102, + 32, + 99, + 114, + 46, + 67, + 97, + 110, + 32, + 61, + 61, + 32, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 67, + 104, + 101, + 99, + 107, + 82, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 95, + 82, + 101, + 115, + 117, + 108, + 116, + 95, + 82, + 69, + 83, + 85, + 76, + 84, + 95, + 65, + 76, + 76, + 79, + 87, + 69, + 68, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 82, + 69, + 83, + 85, + 76, + 84, + 95, + 65, + 76, + 76, + 79, + 87, + 69, + 68, + 10, + 125, + 32, + 101, + 108, + 115, + 101, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 82, + 69, + 83, + 85, + 76, + 84, + 95, + 68, + 69, + 78, + 73, + 69, + 68, + 10, + 125, + 10, + 155, + 4, + 42, + 152, + 4, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 238, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 227, + 3, + 26, + 224, + 3, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 99, + 104, + 101, + 99, + 107, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 32, + 10, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 100, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 105, + 102, + 32, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 46, + 99, + 97, + 110, + 32, + 61, + 61, + 61, + 32, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 67, + 104, + 101, + 99, + 107, + 82, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 95, + 82, + 101, + 115, + 117, + 108, + 116, + 46, + 82, + 69, + 83, + 85, + 76, + 84, + 95, + 65, + 76, + 76, + 79, + 87, + 69, + 68, + 41, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 115, + 111, + 108, + 101, + 46, + 108, + 111, + 103, + 40, + 34, + 82, + 69, + 83, + 85, + 76, + 84, + 95, + 65, + 76, + 76, + 79, + 87, + 69, + 68, + 34, + 41, + 10, + 32, + 32, + 32, + 32, + 125, + 32, + 101, + 108, + 115, + 101, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 115, + 111, + 108, + 101, + 46, + 108, + 111, + 103, + 40, + 34, + 82, + 69, + 83, + 85, + 76, + 84, + 95, + 68, + 69, + 78, + 73, + 69, + 68, + 34, + 41, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 41, + 10, + 189, + 3, + 42, + 186, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 150, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 139, + 3, + 26, + 136, + 3, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 99, + 104, + 101, + 99, + 107, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 34, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 95, + 118, + 101, + 114, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 100, + 101, + 112, + 116, + 104, + 34, + 58, + 32, + 50, + 48, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 34, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 125, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 46, + 58, + 1, + 42, + 34, + 41, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 99, + 104, + 101, + 99, + 107, + ]), + ], + }, + }, + }, + /** + * Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse. + * It expands relationships according to the schema provided. + */ + expand: { + name: "Expand", + requestType: PermissionExpandRequest, + requestStream: false, + responseType: PermissionExpandResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 171, + 8, + 10, + 10, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 18, + 10, + 101, + 120, + 112, + 97, + 110, + 100, + 32, + 97, + 112, + 105, + 42, + 18, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 46, + 101, + 120, + 112, + 97, + 110, + 100, + 106, + 252, + 7, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 234, + 7, + 50, + 231, + 7, + 10, + 238, + 2, + 42, + 235, + 2, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 203, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 192, + 2, + 26, + 189, + 2, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 69, + 120, + 112, + 97, + 110, + 100, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 69, + 120, + 112, + 97, + 110, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 69, + 120, + 112, + 97, + 110, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 112, + 117, + 115, + 104, + 34, + 44, + 10, + 125, + 41, + 10, + 141, + 2, + 42, + 138, + 2, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 224, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 213, + 1, + 26, + 210, + 1, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 101, + 120, + 112, + 97, + 110, + 100, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 112, + 117, + 115, + 104, + 34, + 44, + 10, + 125, + 41, + 10, + 227, + 2, + 42, + 224, + 2, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 188, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 177, + 2, + 26, + 174, + 2, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 101, + 120, + 112, + 97, + 110, + 100, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 34, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 95, + 118, + 101, + 114, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 112, + 117, + 115, + 104, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 47, + 58, + 1, + 42, + 34, + 42, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 101, + 120, + 112, + 97, + 110, + 100, + ]), + ], + }, + }, + }, + /** + * LookupEntity method receives a PermissionLookupEntityRequest and returns a PermissionLookupEntityResponse. + * It is used to retrieve an entity by its identifier. + */ + lookupEntity: { + name: "LookupEntity", + requestType: PermissionLookupEntityRequest, + requestStream: false, + responseType: PermissionLookupEntityResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 144, + 11, + 10, + 10, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 18, + 13, + 108, + 111, + 111, + 107, + 117, + 112, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 42, + 24, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 46, + 108, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 106, + 216, + 10, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 198, + 10, + 50, + 195, + 10, + 10, + 213, + 3, + 42, + 210, + 3, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 178, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 167, + 3, + 26, + 164, + 3, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 68, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 38, + 118, + 49, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 80, + 97, + 103, + 101, + 83, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 67, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 10, + 167, + 3, + 42, + 164, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 250, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 239, + 2, + 26, + 236, + 2, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 108, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 100, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 95, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 112, + 97, + 103, + 101, + 95, + 115, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 115, + 111, + 108, + 101, + 46, + 108, + 111, + 103, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 46, + 101, + 110, + 116, + 105, + 116, + 121, + 95, + 105, + 100, + 115, + 41, + 10, + 125, + 41, + 10, + 190, + 3, + 42, + 187, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 151, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 140, + 3, + 26, + 137, + 3, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 108, + 111, + 111, + 107, + 117, + 112, + 45, + 101, + 110, + 116, + 105, + 116, + 121, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 34, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 34, + 58, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 95, + 118, + 101, + 114, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 100, + 101, + 112, + 116, + 104, + 34, + 58, + 32, + 50, + 48, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 95, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 34, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 34, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 34, + 49, + 34, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 112, + 97, + 103, + 101, + 95, + 115, + 105, + 122, + 101, + 34, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 34, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 54, + 58, + 1, + 42, + 34, + 49, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 108, + 111, + 111, + 107, + 117, + 112, + 45, + 101, + 110, + 116, + 105, + 116, + 121, + ]), + ], + }, + }, + }, + /** + * LookupEntityStream method receives a PermissionLookupEntityRequest and streams a series of PermissionLookupEntityStreamResponse messages. + * It is used to retrieve entities by their identifiers in a streaming fashion. + */ + lookupEntityStream: { + name: "LookupEntityStream", + requestType: PermissionLookupEntityRequest, + requestStream: false, + responseType: PermissionLookupEntityStreamResponse, + responseStream: true, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 153, + 12, + 10, + 10, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 18, + 20, + 108, + 111, + 111, + 107, + 117, + 112, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 115, + 116, + 114, + 101, + 97, + 109, + 42, + 30, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 46, + 108, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 83, + 116, + 114, + 101, + 97, + 109, + 106, + 212, + 11, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 194, + 11, + 50, + 191, + 11, + 10, + 200, + 4, + 42, + 197, + 4, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 165, + 4, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 154, + 4, + 26, + 151, + 4, + 115, + 116, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 83, + 116, + 114, + 101, + 97, + 109, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 68, + 101, + 112, + 116, + 104, + 58, + 32, + 53, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 118, + 105, + 101, + 119, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 38, + 118, + 49, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 97, + 103, + 101, + 83, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 67, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 10, + 10, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 115, + 116, + 114, + 101, + 97, + 109, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 102, + 111, + 114, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 114, + 101, + 115, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 115, + 116, + 114, + 46, + 82, + 101, + 99, + 118, + 40, + 41, + 10, + 10, + 32, + 32, + 32, + 32, + 105, + 102, + 32, + 101, + 114, + 114, + 32, + 61, + 61, + 32, + 105, + 111, + 46, + 69, + 79, + 70, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 98, + 114, + 101, + 97, + 107, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 114, + 101, + 115, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 73, + 100, + 10, + 125, + 10, + 241, + 6, + 42, + 238, + 6, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 196, + 6, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 185, + 6, + 26, + 182, + 6, + 99, + 111, + 110, + 115, + 116, + 32, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 32, + 61, + 32, + 114, + 101, + 113, + 117, + 105, + 114, + 101, + 40, + 34, + 64, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 47, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 45, + 110, + 111, + 100, + 101, + 34, + 41, + 59, + 10, + 99, + 111, + 110, + 115, + 116, + 32, + 123, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 83, + 116, + 114, + 101, + 97, + 109, + 82, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 125, + 32, + 61, + 32, + 114, + 101, + 113, + 117, + 105, + 114, + 101, + 40, + 34, + 64, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 47, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 45, + 110, + 111, + 100, + 101, + 47, + 100, + 105, + 115, + 116, + 47, + 115, + 114, + 99, + 47, + 103, + 114, + 112, + 99, + 47, + 103, + 101, + 110, + 101, + 114, + 97, + 116, + 101, + 100, + 47, + 98, + 97, + 115, + 101, + 47, + 118, + 49, + 47, + 115, + 101, + 114, + 118, + 105, + 99, + 101, + 34, + 41, + 59, + 10, + 10, + 102, + 117, + 110, + 99, + 116, + 105, + 111, + 110, + 32, + 109, + 97, + 105, + 110, + 40, + 41, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 115, + 116, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 32, + 61, + 32, + 110, + 101, + 119, + 32, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 46, + 103, + 114, + 112, + 99, + 46, + 110, + 101, + 119, + 67, + 108, + 105, + 101, + 110, + 116, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 101, + 110, + 100, + 112, + 111, + 105, + 110, + 116, + 58, + 32, + 34, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 56, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 41, + 59, + 10, + 10, + 32, + 32, + 32, + 32, + 108, + 101, + 116, + 32, + 114, + 101, + 115, + 32, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 108, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 83, + 116, + 114, + 101, + 97, + 109, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 100, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 118, + 105, + 101, + 119, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 112, + 97, + 103, + 101, + 95, + 115, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 41, + 59, + 10, + 10, + 32, + 32, + 32, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 40, + 114, + 101, + 115, + 41, + 59, + 10, + 125, + 10, + 10, + 97, + 115, + 121, + 110, + 99, + 32, + 102, + 117, + 110, + 99, + 116, + 105, + 111, + 110, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 40, + 114, + 101, + 115, + 58, + 32, + 65, + 115, + 121, + 110, + 99, + 73, + 116, + 101, + 114, + 97, + 98, + 108, + 101, + 60, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 69, + 110, + 116, + 105, + 116, + 121, + 83, + 116, + 114, + 101, + 97, + 109, + 82, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 62, + 41, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 102, + 111, + 114, + 32, + 97, + 119, + 97, + 105, + 116, + 32, + 40, + 99, + 111, + 110, + 115, + 116, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 32, + 111, + 102, + 32, + 114, + 101, + 115, + 41, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 46, + 101, + 110, + 116, + 105, + 116, + 121, + 73, + 100, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + ]), + ], + 578365826: [ + Buffer.from([ + 61, + 58, + 1, + 42, + 34, + 56, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 108, + 111, + 111, + 107, + 117, + 112, + 45, + 101, + 110, + 116, + 105, + 116, + 121, + 45, + 115, + 116, + 114, + 101, + 97, + 109, + ]), + ], + }, + }, + }, + /** + * LookupSubject method receives a PermissionLookupSubjectRequest and returns a PermissionLookupSubjectResponse. + * It is used to retrieve a subject by its identifier. + */ + lookupSubject: { + name: "LookupSubject", + requestType: PermissionLookupSubjectRequest, + requestStream: false, + responseType: PermissionLookupSubjectResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 189, + 12, + 10, + 10, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 18, + 14, + 108, + 111, + 111, + 107, + 117, + 112, + 45, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 42, + 25, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 46, + 108, + 111, + 111, + 107, + 117, + 112, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 106, + 131, + 12, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 241, + 11, + 50, + 238, + 11, + 10, + 159, + 4, + 42, + 156, + 4, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 252, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 241, + 3, + 26, + 238, + 3, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 76, + 111, + 111, + 107, + 117, + 112, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 76, + 111, + 111, + 107, + 117, + 112, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 68, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 82, + 101, + 102, + 101, + 114, + 101, + 110, + 99, + 101, + 58, + 32, + 38, + 118, + 49, + 46, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 82, + 101, + 102, + 101, + 114, + 101, + 110, + 99, + 101, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 97, + 103, + 101, + 83, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 67, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 10, + 220, + 3, + 42, + 217, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 175, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 164, + 3, + 26, + 161, + 3, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 108, + 111, + 111, + 107, + 117, + 112, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 100, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 95, + 114, + 101, + 102, + 101, + 114, + 101, + 110, + 99, + 101, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 112, + 97, + 103, + 101, + 95, + 115, + 105, + 122, + 101, + 58, + 32, + 49, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 115, + 111, + 108, + 101, + 46, + 108, + 111, + 103, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 46, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 95, + 105, + 100, + 115, + 41, + 10, + 125, + 41, + 10, + 234, + 3, + 42, + 231, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 195, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 184, + 3, + 26, + 181, + 3, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 108, + 111, + 111, + 107, + 117, + 112, + 45, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 34, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 34, + 58, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 95, + 118, + 101, + 114, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 100, + 101, + 112, + 116, + 104, + 34, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 34, + 44, + 10, + 32, + 32, + 34, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 95, + 114, + 101, + 102, + 101, + 114, + 101, + 110, + 99, + 101, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 112, + 97, + 103, + 101, + 95, + 115, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 55, + 58, + 1, + 42, + 34, + 50, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 108, + 111, + 111, + 107, + 117, + 112, + 45, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + ]), + ], + }, + }, + }, + /** + * SubjectPermission method receives a PermissionSubjectPermissionRequest and returns a PermissionSubjectPermissionResponse. + * It is used to retrieve permissions related to a specific subject. + */ + subjectPermission: { + name: "SubjectPermission", + requestType: PermissionSubjectPermissionRequest, + requestStream: false, + responseType: PermissionSubjectPermissionResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 190, + 11, + 10, + 10, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 18, + 18, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 32, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 42, + 29, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 46, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 106, + 252, + 10, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 234, + 10, + 50, + 231, + 10, + 10, + 241, + 3, + 42, + 238, + 3, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 206, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 195, + 3, + 26, + 192, + 3, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 79, + 110, + 108, + 121, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 102, + 97, + 108, + 115, + 101, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 68, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 38, + 118, + 49, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 159, + 3, + 42, + 156, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 242, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 231, + 2, + 26, + 228, + 2, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 46, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 111, + 110, + 108, + 121, + 80, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 58, + 32, + 116, + 114, + 117, + 101, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 100, + 101, + 112, + 116, + 104, + 58, + 32, + 50, + 48, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 115, + 111, + 108, + 101, + 46, + 108, + 111, + 103, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 59, + 10, + 125, + 41, + 10, + 206, + 3, + 42, + 203, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 167, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 156, + 3, + 26, + 153, + 3, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 45, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 34, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 34, + 58, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 95, + 118, + 101, + 114, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 111, + 110, + 108, + 121, + 95, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 116, + 114, + 117, + 101, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 100, + 101, + 112, + 116, + 104, + 34, + 58, + 32, + 50, + 48, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 125, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 59, + 58, + 1, + 42, + 34, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + 115, + 47, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 45, + 112, + 101, + 114, + 109, + 105, + 115, + 115, + 105, + 111, + 110, + ]), + ], + }, + }, + }, + }, +} as const; + +export interface PermissionServiceImplementation { + /** + * Check method receives a PermissionCheckRequest and returns a PermissionCheckResponse. + * It is used to determine whether a specific user has permission to perform an action on a resource. + * For example, "Can the user 1 push to repository 1?" + */ + check( + request: PermissionCheckRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** + * Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse. + * It expands relationships according to the schema provided. + */ + expand( + request: PermissionExpandRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** + * LookupEntity method receives a PermissionLookupEntityRequest and returns a PermissionLookupEntityResponse. + * It is used to retrieve an entity by its identifier. + */ + lookupEntity( + request: PermissionLookupEntityRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** + * LookupEntityStream method receives a PermissionLookupEntityRequest and streams a series of PermissionLookupEntityStreamResponse messages. + * It is used to retrieve entities by their identifiers in a streaming fashion. + */ + lookupEntityStream( + request: PermissionLookupEntityRequest, + context: CallContext & CallContextExt, + ): ServerStreamingMethodResult>; + /** + * LookupSubject method receives a PermissionLookupSubjectRequest and returns a PermissionLookupSubjectResponse. + * It is used to retrieve a subject by its identifier. + */ + lookupSubject( + request: PermissionLookupSubjectRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** + * SubjectPermission method receives a PermissionSubjectPermissionRequest and returns a PermissionSubjectPermissionResponse. + * It is used to retrieve permissions related to a specific subject. + */ + subjectPermission( + request: PermissionSubjectPermissionRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface PermissionClient { + /** + * Check method receives a PermissionCheckRequest and returns a PermissionCheckResponse. + * It is used to determine whether a specific user has permission to perform an action on a resource. + * For example, "Can the user 1 push to repository 1?" + */ + check( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** + * Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse. + * It expands relationships according to the schema provided. + */ + expand( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** + * LookupEntity method receives a PermissionLookupEntityRequest and returns a PermissionLookupEntityResponse. + * It is used to retrieve an entity by its identifier. + */ + lookupEntity( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** + * LookupEntityStream method receives a PermissionLookupEntityRequest and streams a series of PermissionLookupEntityStreamResponse messages. + * It is used to retrieve entities by their identifiers in a streaming fashion. + */ + lookupEntityStream( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): AsyncIterable; + /** + * LookupSubject method receives a PermissionLookupSubjectRequest and returns a PermissionLookupSubjectResponse. + * It is used to retrieve a subject by its identifier. + */ + lookupSubject( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** + * SubjectPermission method receives a PermissionSubjectPermissionRequest and returns a PermissionSubjectPermissionResponse. + * It is used to retrieve permissions related to a specific subject. + */ + subjectPermission( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +/** + * Watch is the main RPC in the Watch service. It establishes a stream between + * the client and the server. The server pushes data changes into this stream + * and the client can read those in real time. + */ +export type WatchDefinition = typeof WatchDefinition; +export const WatchDefinition = { + name: "Watch", + fullName: "base.v1.Watch", + methods: { + watch: { + name: "Watch", + requestType: WatchRequest, + requestStream: false, + responseType: WatchResponse, + responseStream: true, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 147, + 7, + 10, + 5, + 87, + 97, + 116, + 99, + 104, + 18, + 13, + 119, + 97, + 116, + 99, + 104, + 32, + 99, + 104, + 97, + 110, + 103, + 101, + 115, + 42, + 11, + 119, + 97, + 116, + 99, + 104, + 46, + 119, + 97, + 116, + 99, + 104, + 106, + 237, + 6, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 219, + 6, + 50, + 216, + 6, + 10, + 158, + 2, + 42, + 155, + 2, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 251, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 240, + 1, + 26, + 237, + 1, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 87, + 97, + 116, + 99, + 104, + 46, + 87, + 97, + 116, + 99, + 104, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 87, + 97, + 116, + 99, + 104, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 10, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 115, + 116, + 114, + 101, + 97, + 109, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 102, + 111, + 114, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 114, + 101, + 115, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 114, + 46, + 82, + 101, + 99, + 118, + 40, + 41, + 10, + 10, + 32, + 32, + 32, + 32, + 105, + 102, + 32, + 101, + 114, + 114, + 32, + 61, + 61, + 32, + 105, + 111, + 46, + 69, + 79, + 70, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 98, + 114, + 101, + 97, + 107, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 114, + 101, + 115, + 46, + 67, + 104, + 97, + 110, + 103, + 101, + 115, + 10, + 125, + 10, + 10, + 180, + 4, + 42, + 177, + 4, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 135, + 4, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 252, + 3, + 26, + 249, + 3, + 99, + 111, + 110, + 115, + 116, + 32, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 32, + 61, + 32, + 114, + 101, + 113, + 117, + 105, + 114, + 101, + 40, + 34, + 64, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 47, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 45, + 110, + 111, + 100, + 101, + 34, + 41, + 59, + 10, + 99, + 111, + 110, + 115, + 116, + 32, + 123, + 87, + 97, + 116, + 99, + 104, + 82, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 125, + 32, + 61, + 32, + 114, + 101, + 113, + 117, + 105, + 114, + 101, + 40, + 34, + 64, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 47, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 45, + 110, + 111, + 100, + 101, + 47, + 100, + 105, + 115, + 116, + 47, + 115, + 114, + 99, + 47, + 103, + 114, + 112, + 99, + 47, + 103, + 101, + 110, + 101, + 114, + 97, + 116, + 101, + 100, + 47, + 98, + 97, + 115, + 101, + 47, + 118, + 49, + 47, + 115, + 101, + 114, + 118, + 105, + 99, + 101, + 34, + 41, + 59, + 10, + 10, + 102, + 117, + 110, + 99, + 116, + 105, + 111, + 110, + 32, + 109, + 97, + 105, + 110, + 40, + 41, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 115, + 116, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 32, + 61, + 32, + 110, + 101, + 119, + 32, + 112, + 101, + 114, + 109, + 105, + 102, + 121, + 46, + 103, + 114, + 112, + 99, + 46, + 110, + 101, + 119, + 67, + 108, + 105, + 101, + 110, + 116, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 101, + 110, + 100, + 112, + 111, + 105, + 110, + 116, + 58, + 32, + 34, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 56, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 41, + 59, + 10, + 10, + 32, + 32, + 32, + 32, + 108, + 101, + 116, + 32, + 114, + 101, + 115, + 32, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 119, + 97, + 116, + 99, + 104, + 46, + 119, + 97, + 116, + 99, + 104, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 41, + 59, + 10, + 10, + 32, + 32, + 32, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 40, + 114, + 101, + 115, + 41, + 59, + 10, + 125, + 10, + 10, + 97, + 115, + 121, + 110, + 99, + 32, + 102, + 117, + 110, + 99, + 116, + 105, + 111, + 110, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 40, + 114, + 101, + 115, + 58, + 32, + 65, + 115, + 121, + 110, + 99, + 73, + 116, + 101, + 114, + 97, + 98, + 108, + 101, + 60, + 87, + 97, + 116, + 99, + 104, + 82, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 62, + 41, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 102, + 111, + 114, + 32, + 97, + 119, + 97, + 105, + 116, + 32, + 40, + 99, + 111, + 110, + 115, + 116, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 32, + 111, + 102, + 32, + 114, + 101, + 115, + 41, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 46, + 99, + 104, + 97, + 110, + 103, + 101, + 115, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 10, + ]), + ], + 578365826: [ + Buffer.from([ + 34, + 58, + 1, + 42, + 34, + 29, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 119, + 97, + 116, + 99, + 104, + ]), + ], + }, + }, + }, + }, +} as const; + +export interface WatchServiceImplementation { + watch( + request: WatchRequest, + context: CallContext & CallContextExt, + ): ServerStreamingMethodResult>; +} + +export interface WatchClient { + watch(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable; +} + +/** The Schema service definition. */ +export type SchemaDefinition = typeof SchemaDefinition; +export const SchemaDefinition = { + name: "Schema", + fullName: "base.v1.Schema", + methods: { + /** Write is an RPC that allows you to write your authorization model. */ + write: { + name: "Write", + requestType: SchemaWriteRequest, + requestStream: false, + responseType: SchemaWriteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 218, + 15, + 10, + 6, + 83, + 99, + 104, + 101, + 109, + 97, + 18, + 12, + 119, + 114, + 105, + 116, + 101, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 42, + 13, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 46, + 119, + 114, + 105, + 116, + 101, + 106, + 178, + 15, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 160, + 15, + 50, + 157, + 15, + 10, + 242, + 4, + 42, + 239, + 4, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 207, + 4, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 196, + 4, + 26, + 193, + 4, + 115, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 83, + 99, + 104, + 101, + 109, + 97, + 46, + 87, + 114, + 105, + 116, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 83, + 99, + 104, + 101, + 109, + 97, + 87, + 114, + 105, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 58, + 32, + 96, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 117, + 115, + 101, + 114, + 32, + 123, + 125, + 10, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 97, + 100, + 109, + 105, + 110, + 32, + 64, + 117, + 115, + 101, + 114, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 109, + 101, + 109, + 98, + 101, + 114, + 32, + 64, + 117, + 115, + 101, + 114, + 10, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 99, + 114, + 101, + 97, + 116, + 101, + 95, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 32, + 61, + 32, + 40, + 97, + 100, + 109, + 105, + 110, + 32, + 111, + 114, + 32, + 109, + 101, + 109, + 98, + 101, + 114, + 41, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 61, + 32, + 97, + 100, + 109, + 105, + 110, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 111, + 119, + 110, + 101, + 114, + 32, + 64, + 117, + 115, + 101, + 114, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 112, + 97, + 114, + 101, + 110, + 116, + 32, + 64, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 10, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 112, + 117, + 115, + 104, + 32, + 61, + 32, + 111, + 119, + 110, + 101, + 114, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 114, + 101, + 97, + 100, + 32, + 61, + 32, + 40, + 111, + 119, + 110, + 101, + 114, + 32, + 97, + 110, + 100, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 97, + 100, + 109, + 105, + 110, + 32, + 97, + 110, + 100, + 32, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 109, + 101, + 109, + 98, + 101, + 114, + 41, + 41, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 61, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 109, + 101, + 109, + 98, + 101, + 114, + 32, + 97, + 110, + 100, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 97, + 100, + 109, + 105, + 110, + 32, + 111, + 114, + 32, + 111, + 119, + 110, + 101, + 114, + 41, + 41, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 96, + 44, + 10, + 125, + 41, + 10, + 243, + 4, + 42, + 240, + 4, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 198, + 4, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 187, + 4, + 26, + 184, + 4, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 115, + 99, + 104, + 101, + 109, + 97, + 46, + 119, + 114, + 105, + 116, + 101, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 58, + 32, + 96, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 117, + 115, + 101, + 114, + 32, + 123, + 125, + 10, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 97, + 100, + 109, + 105, + 110, + 32, + 64, + 117, + 115, + 101, + 114, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 109, + 101, + 109, + 98, + 101, + 114, + 32, + 64, + 117, + 115, + 101, + 114, + 10, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 99, + 114, + 101, + 97, + 116, + 101, + 95, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 32, + 61, + 32, + 40, + 97, + 100, + 109, + 105, + 110, + 32, + 111, + 114, + 32, + 109, + 101, + 109, + 98, + 101, + 114, + 41, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 61, + 32, + 97, + 100, + 109, + 105, + 110, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 111, + 119, + 110, + 101, + 114, + 32, + 64, + 117, + 115, + 101, + 114, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 112, + 97, + 114, + 101, + 110, + 116, + 32, + 64, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 10, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 112, + 117, + 115, + 104, + 32, + 61, + 32, + 111, + 119, + 110, + 101, + 114, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 114, + 101, + 97, + 100, + 32, + 61, + 32, + 40, + 111, + 119, + 110, + 101, + 114, + 32, + 97, + 110, + 100, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 97, + 100, + 109, + 105, + 110, + 32, + 97, + 110, + 100, + 32, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 109, + 101, + 109, + 98, + 101, + 114, + 41, + 41, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 61, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 109, + 101, + 109, + 98, + 101, + 114, + 32, + 97, + 110, + 100, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 97, + 100, + 109, + 105, + 110, + 32, + 111, + 114, + 32, + 111, + 119, + 110, + 101, + 114, + 41, + 41, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 96, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 175, + 5, + 42, + 172, + 5, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 136, + 5, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 253, + 4, + 26, + 250, + 4, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 47, + 119, + 114, + 105, + 116, + 101, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 34, + 58, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 117, + 115, + 101, + 114, + 32, + 123, + 125, + 92, + 110, + 92, + 110, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 32, + 123, + 92, + 110, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 97, + 100, + 109, + 105, + 110, + 32, + 64, + 117, + 115, + 101, + 114, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 109, + 101, + 109, + 98, + 101, + 114, + 32, + 64, + 117, + 115, + 101, + 114, + 92, + 110, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 99, + 114, + 101, + 97, + 116, + 101, + 95, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 32, + 61, + 32, + 40, + 97, + 100, + 109, + 105, + 110, + 32, + 111, + 114, + 32, + 109, + 101, + 109, + 98, + 101, + 114, + 41, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 61, + 32, + 97, + 100, + 109, + 105, + 110, + 92, + 110, + 32, + 32, + 32, + 32, + 125, + 92, + 110, + 92, + 110, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 32, + 114, + 101, + 112, + 111, + 115, + 105, + 116, + 111, + 114, + 121, + 32, + 123, + 92, + 110, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 111, + 119, + 110, + 101, + 114, + 32, + 64, + 117, + 115, + 101, + 114, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 32, + 112, + 97, + 114, + 101, + 110, + 116, + 32, + 64, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 92, + 110, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 112, + 117, + 115, + 104, + 32, + 61, + 32, + 111, + 119, + 110, + 101, + 114, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 114, + 101, + 97, + 100, + 32, + 61, + 32, + 40, + 111, + 119, + 110, + 101, + 114, + 32, + 97, + 110, + 100, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 97, + 100, + 109, + 105, + 110, + 32, + 97, + 110, + 100, + 32, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 109, + 101, + 109, + 98, + 101, + 114, + 41, + 41, + 92, + 110, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 99, + 116, + 105, + 111, + 110, + 32, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 61, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 109, + 101, + 109, + 98, + 101, + 114, + 32, + 97, + 110, + 100, + 32, + 40, + 112, + 97, + 114, + 101, + 110, + 116, + 46, + 97, + 100, + 109, + 105, + 110, + 32, + 111, + 114, + 32, + 111, + 119, + 110, + 101, + 114, + 41, + 41, + 92, + 110, + 32, + 125, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 42, + 58, + 1, + 42, + 34, + 37, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 47, + 119, + 114, + 105, + 116, + 101, + ]), + ], + }, + }, + }, + /** PartialWrite is an RPC that allows you to partially update an existing authorization model. */ + partialWrite: { + name: "PartialWrite", + requestType: SchemaPartialWriteRequest, + requestStream: false, + responseType: SchemaPartialWriteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 74, + 10, + 6, + 83, + 99, + 104, + 101, + 109, + 97, + 18, + 41, + 112, + 97, + 114, + 116, + 105, + 97, + 108, + 108, + 121, + 32, + 117, + 112, + 100, + 97, + 116, + 101, + 32, + 121, + 111, + 117, + 114, + 32, + 97, + 117, + 116, + 104, + 111, + 114, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 32, + 109, + 111, + 100, + 101, + 108, + 42, + 21, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 46, + 112, + 97, + 114, + 116, + 105, + 97, + 108, + 45, + 119, + 114, + 105, + 116, + 101, + ]), + ], + 578365826: [ + Buffer.from([ + 50, + 58, + 1, + 42, + 50, + 45, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 47, + 112, + 97, + 114, + 116, + 105, + 97, + 108, + 45, + 119, + 114, + 105, + 116, + 101, + ]), + ], + }, + }, + }, + /** Read is an RPC that allows you to read your authorization model. */ + read: { + name: "Read", + requestType: SchemaReadRequest, + requestStream: false, + responseType: SchemaReadResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 255, + 5, + 10, + 6, + 83, + 99, + 104, + 101, + 109, + 97, + 18, + 11, + 114, + 101, + 97, + 100, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 42, + 12, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 46, + 114, + 101, + 97, + 100, + 106, + 217, + 5, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 199, + 5, + 50, + 196, + 5, + 10, + 245, + 1, + 42, + 242, + 1, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 210, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 199, + 1, + 26, + 196, + 1, + 115, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 83, + 99, + 104, + 101, + 109, + 97, + 46, + 82, + 101, + 97, + 100, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 83, + 99, + 104, + 101, + 109, + 97, + 82, + 101, + 97, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 83, + 99, + 104, + 101, + 109, + 97, + 82, + 101, + 97, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 99, + 110, + 98, + 101, + 54, + 115, + 101, + 53, + 102, + 109, + 97, + 108, + 49, + 56, + 103, + 112, + 99, + 54, + 54, + 103, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 182, + 1, + 42, + 179, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 137, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 127, + 26, + 125, + 108, + 101, + 116, + 32, + 114, + 101, + 115, + 32, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 115, + 99, + 104, + 101, + 109, + 97, + 46, + 114, + 101, + 97, + 100, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 115, + 119, + 82, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 46, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 144, + 2, + 42, + 141, + 2, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 233, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 222, + 1, + 26, + 219, + 1, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 47, + 114, + 101, + 97, + 100, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 95, + 118, + 101, + 114, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 99, + 110, + 98, + 101, + 54, + 115, + 101, + 53, + 102, + 109, + 97, + 108, + 49, + 56, + 103, + 112, + 99, + 54, + 54, + 103, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 41, + 58, + 1, + 42, + 34, + 36, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 47, + 114, + 101, + 97, + 100, + ]), + ], + }, + }, + }, + /** List is an RPC that allows you to list all authorization models. */ + list: { + name: "List", + requestType: SchemaListRequest, + requestStream: false, + responseType: SchemaListResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 253, + 4, + 10, + 6, + 83, + 99, + 104, + 101, + 109, + 97, + 18, + 11, + 108, + 105, + 115, + 116, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 42, + 12, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 46, + 108, + 105, + 115, + 116, + 106, + 215, + 4, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 197, + 4, + 50, + 194, + 4, + 10, + 189, + 1, + 42, + 186, + 1, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 154, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 143, + 1, + 26, + 140, + 1, + 115, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 83, + 99, + 104, + 101, + 109, + 97, + 46, + 76, + 105, + 115, + 116, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 83, + 99, + 104, + 101, + 109, + 97, + 76, + 105, + 115, + 116, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 80, + 97, + 103, + 101, + 83, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 67, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 10, + 133, + 1, + 42, + 130, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 89, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 79, + 26, + 77, + 108, + 101, + 116, + 32, + 114, + 101, + 115, + 32, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 115, + 99, + 104, + 101, + 109, + 97, + 46, + 108, + 105, + 115, + 116, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 10, + 125, + 41, + 10, + 247, + 1, + 42, + 244, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 208, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 197, + 1, + 26, + 194, + 1, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 47, + 108, + 105, + 115, + 116, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 112, + 97, + 103, + 101, + 95, + 115, + 105, + 122, + 101, + 34, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 41, + 58, + 1, + 42, + 34, + 36, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 115, + 99, + 104, + 101, + 109, + 97, + 115, + 47, + 108, + 105, + 115, + 116, + ]), + ], + }, + }, + }, + }, +} as const; + +export interface SchemaServiceImplementation { + /** Write is an RPC that allows you to write your authorization model. */ + write(request: SchemaWriteRequest, context: CallContext & CallContextExt): Promise>; + /** PartialWrite is an RPC that allows you to partially update an existing authorization model. */ + partialWrite( + request: SchemaPartialWriteRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** Read is an RPC that allows you to read your authorization model. */ + read(request: SchemaReadRequest, context: CallContext & CallContextExt): Promise>; + /** List is an RPC that allows you to list all authorization models. */ + list(request: SchemaListRequest, context: CallContext & CallContextExt): Promise>; +} + +export interface SchemaClient { + /** Write is an RPC that allows you to write your authorization model. */ + write(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + /** PartialWrite is an RPC that allows you to partially update an existing authorization model. */ + partialWrite( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** Read is an RPC that allows you to read your authorization model. */ + read(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + /** List is an RPC that allows you to list all authorization models. */ + list(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} + +/** The Data service provides RPC methods for managing data in the context of relationships and attributes. */ +export type DataDefinition = typeof DataDefinition; +export const DataDefinition = { + name: "Data", + fullName: "base.v1.Data", + methods: { + /** The Write RPC method creates a new relation tuple. */ + write: { + name: "Write", + requestType: DataWriteRequest, + requestStream: false, + responseType: DataWriteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 196, + 20, + 10, + 4, + 68, + 97, + 116, + 97, + 18, + 10, + 119, + 114, + 105, + 116, + 101, + 32, + 100, + 97, + 116, + 97, + 42, + 10, + 100, + 97, + 116, + 97, + 46, + 119, + 114, + 105, + 116, + 101, + 106, + 163, + 20, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 145, + 20, + 50, + 142, + 20, + 10, + 182, + 7, + 42, + 179, + 7, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 147, + 7, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 136, + 7, + 26, + 133, + 7, + 47, + 47, + 32, + 67, + 111, + 110, + 118, + 101, + 114, + 116, + 32, + 116, + 104, + 101, + 32, + 119, + 114, + 97, + 112, + 112, + 101, + 100, + 32, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 32, + 118, + 97, + 108, + 117, + 101, + 32, + 105, + 110, + 116, + 111, + 32, + 65, + 110, + 121, + 32, + 112, + 114, + 111, + 116, + 111, + 32, + 109, + 101, + 115, + 115, + 97, + 103, + 101, + 10, + 118, + 97, + 108, + 117, + 101, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 97, + 110, + 121, + 112, + 98, + 46, + 78, + 101, + 119, + 40, + 38, + 118, + 49, + 46, + 66, + 111, + 111, + 108, + 101, + 97, + 110, + 86, + 97, + 108, + 117, + 101, + 123, + 10, + 32, + 32, + 32, + 32, + 68, + 97, + 116, + 97, + 58, + 32, + 116, + 114, + 117, + 101, + 44, + 10, + 125, + 41, + 10, + 105, + 102, + 32, + 101, + 114, + 114, + 32, + 33, + 61, + 32, + 110, + 105, + 108, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 72, + 97, + 110, + 100, + 108, + 101, + 32, + 101, + 114, + 114, + 111, + 114, + 10, + 125, + 10, + 10, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 68, + 97, + 116, + 97, + 46, + 87, + 114, + 105, + 116, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 87, + 114, + 105, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 87, + 114, + 105, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 84, + 117, + 112, + 108, + 101, + 115, + 58, + 32, + 91, + 93, + 42, + 118, + 49, + 46, + 84, + 117, + 112, + 108, + 101, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 32, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 111, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 32, + 38, + 118, + 49, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 32, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 58, + 32, + 91, + 93, + 42, + 118, + 49, + 46, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 32, + 32, + 34, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 58, + 32, + 34, + 105, + 115, + 95, + 112, + 114, + 105, + 118, + 97, + 116, + 101, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 86, + 97, + 108, + 117, + 101, + 58, + 32, + 32, + 32, + 32, + 32, + 118, + 97, + 108, + 117, + 101, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 128, + 6, + 42, + 253, + 5, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 211, + 5, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 200, + 5, + 26, + 197, + 5, + 99, + 111, + 110, + 115, + 116, + 32, + 98, + 111, + 111, + 108, + 101, + 97, + 110, + 86, + 97, + 108, + 117, + 101, + 32, + 61, + 32, + 66, + 111, + 111, + 108, + 101, + 97, + 110, + 86, + 97, + 108, + 117, + 101, + 46, + 102, + 114, + 111, + 109, + 74, + 83, + 79, + 78, + 40, + 123, + 32, + 100, + 97, + 116, + 97, + 58, + 32, + 116, + 114, + 117, + 101, + 32, + 125, + 41, + 59, + 10, + 10, + 99, + 111, + 110, + 115, + 116, + 32, + 118, + 97, + 108, + 117, + 101, + 32, + 61, + 32, + 65, + 110, + 121, + 46, + 102, + 114, + 111, + 109, + 74, + 83, + 79, + 78, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 85, + 114, + 108, + 58, + 32, + 39, + 116, + 121, + 112, + 101, + 46, + 103, + 111, + 111, + 103, + 108, + 101, + 97, + 112, + 105, + 115, + 46, + 99, + 111, + 109, + 47, + 98, + 97, + 115, + 101, + 46, + 118, + 49, + 46, + 66, + 111, + 111, + 108, + 101, + 97, + 110, + 86, + 97, + 108, + 117, + 101, + 39, + 44, + 10, + 32, + 32, + 32, + 32, + 118, + 97, + 108, + 117, + 101, + 58, + 32, + 66, + 111, + 111, + 108, + 101, + 97, + 110, + 86, + 97, + 108, + 117, + 101, + 46, + 101, + 110, + 99, + 111, + 100, + 101, + 40, + 98, + 111, + 111, + 108, + 101, + 97, + 110, + 86, + 97, + 108, + 117, + 101, + 41, + 46, + 102, + 105, + 110, + 105, + 115, + 104, + 40, + 41, + 10, + 125, + 41, + 59, + 10, + 10, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 100, + 97, + 116, + 97, + 46, + 119, + 114, + 105, + 116, + 101, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 99, + 104, + 101, + 109, + 97, + 86, + 101, + 114, + 115, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 116, + 117, + 112, + 108, + 101, + 115, + 58, + 32, + 91, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 111, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 125, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 58, + 32, + 91, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 58, + 32, + 34, + 105, + 115, + 95, + 112, + 114, + 105, + 118, + 97, + 116, + 101, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 118, + 97, + 108, + 117, + 101, + 58, + 32, + 118, + 97, + 108, + 117, + 101, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 93, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 207, + 6, + 42, + 204, + 6, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 168, + 6, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 157, + 6, + 26, + 154, + 6, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 119, + 114, + 105, + 116, + 101, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 115, + 99, + 104, + 101, + 109, + 97, + 95, + 118, + 101, + 114, + 115, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 116, + 117, + 112, + 108, + 101, + 115, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 101, + 100, + 105, + 116, + 111, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 100, + 111, + 99, + 117, + 109, + 101, + 110, + 116, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 34, + 58, + 32, + 34, + 105, + 115, + 95, + 112, + 114, + 105, + 118, + 97, + 116, + 101, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 118, + 97, + 108, + 117, + 101, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 64, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 116, + 121, + 112, + 101, + 46, + 103, + 111, + 111, + 103, + 108, + 101, + 97, + 112, + 105, + 115, + 46, + 99, + 111, + 109, + 47, + 98, + 97, + 115, + 101, + 46, + 118, + 49, + 46, + 66, + 111, + 111, + 108, + 101, + 97, + 110, + 86, + 97, + 108, + 117, + 101, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 100, + 97, + 116, + 97, + 34, + 58, + 32, + 116, + 114, + 117, + 101, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 93, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 39, + 58, + 1, + 42, + 34, + 34, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 119, + 114, + 105, + 116, + 101, + ]), + ], + }, + }, + }, + /** RPC method to write relationships for a tenant. This can be accessed via a POST request to the given HTTP path. It's tagged under "Data" in OpenAPI documentation. */ + writeRelationships: { + name: "WriteRelationships", + requestType: RelationshipWriteRequest, + requestStream: false, + responseType: RelationshipWriteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 48, + 10, + 4, + 68, + 97, + 116, + 97, + 18, + 19, + 119, + 114, + 105, + 116, + 101, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 42, + 19, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 46, + 119, + 114, + 105, + 116, + 101, + ]), + ], + 578365826: [ + Buffer.from([ + 48, + 58, + 1, + 42, + 34, + 43, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 47, + 119, + 114, + 105, + 116, + 101, + ]), + ], + }, + }, + }, + /** The ReadRelationships RPC method reads relation tuple(s). */ + readRelationships: { + name: "ReadRelationships", + requestType: RelationshipReadRequest, + requestStream: false, + responseType: RelationshipReadResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 184, + 11, + 10, + 4, + 68, + 97, + 116, + 97, + 18, + 18, + 114, + 101, + 97, + 100, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 42, + 23, + 100, + 97, + 116, + 97, + 46, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 46, + 114, + 101, + 97, + 100, + 106, + 130, + 11, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 240, + 10, + 50, + 237, + 10, + 10, + 166, + 4, + 42, + 163, + 4, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 131, + 4, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 248, + 3, + 26, + 245, + 3, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 68, + 97, + 116, + 97, + 46, + 82, + 101, + 97, + 100, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 46, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 82, + 101, + 97, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 46, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 82, + 101, + 97, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 70, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 38, + 118, + 49, + 46, + 84, + 117, + 112, + 108, + 101, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 115, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 34, + 49, + 34, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 109, + 101, + 109, + 98, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 38, + 118, + 49, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 34, + 34, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 41, + 10, + 132, + 3, + 42, + 129, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 215, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 204, + 2, + 26, + 201, + 2, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 100, + 97, + 116, + 97, + 46, + 114, + 101, + 97, + 100, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 40, + 123, + 10, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 102, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 109, + 101, + 109, + 98, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 125, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 186, + 3, + 42, + 183, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 147, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 136, + 3, + 26, + 133, + 3, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 47, + 114, + 101, + 97, + 100, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 102, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 109, + 101, + 109, + 98, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 125, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 52, + 58, + 1, + 42, + 34, + 47, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 47, + 114, + 101, + 97, + 100, + ]), + ], + }, + }, + }, + /** The ReadAttributes RPC method reads attribute(s) of a relation. */ + readAttributes: { + name: "ReadAttributes", + requestType: AttributeReadRequest, + requestStream: false, + responseType: AttributeReadResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 207, + 9, + 10, + 4, + 68, + 97, + 116, + 97, + 18, + 15, + 114, + 101, + 97, + 100, + 32, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 42, + 20, + 100, + 97, + 116, + 97, + 46, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 46, + 114, + 101, + 97, + 100, + 106, + 159, + 9, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 141, + 9, + 50, + 138, + 9, + 10, + 181, + 3, + 42, + 178, + 3, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 146, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 135, + 3, + 26, + 132, + 3, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 68, + 97, + 116, + 97, + 46, + 82, + 101, + 97, + 100, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 46, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 82, + 101, + 97, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 46, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 82, + 101, + 97, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 70, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 38, + 118, + 49, + 46, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 115, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 34, + 49, + 34, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 34, + 112, + 114, + 105, + 118, + 97, + 116, + 101, + 34, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 203, + 2, + 42, + 200, + 2, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 158, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 147, + 2, + 26, + 144, + 2, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 100, + 97, + 116, + 97, + 46, + 114, + 101, + 97, + 100, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 40, + 123, + 10, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 102, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 112, + 114, + 105, + 118, + 97, + 116, + 101, + 34, + 10, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 125, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 129, + 3, + 42, + 254, + 2, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 218, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 207, + 2, + 26, + 204, + 2, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 47, + 114, + 101, + 97, + 100, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 102, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 112, + 114, + 105, + 118, + 97, + 116, + 101, + 34, + 10, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 125, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 49, + 58, + 1, + 42, + 34, + 44, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 47, + 114, + 101, + 97, + 100, + ]), + ], + }, + }, + }, + /** The Delete RPC method deletes a relation tuple. */ + delete: { + name: "Delete", + requestType: DataDeleteRequest, + requestStream: false, + responseType: DataDeleteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 179, + 11, + 10, + 4, + 68, + 97, + 116, + 97, + 18, + 11, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 100, + 97, + 116, + 97, + 42, + 11, + 100, + 97, + 116, + 97, + 46, + 100, + 101, + 108, + 101, + 116, + 101, + 106, + 144, + 11, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 254, + 10, + 50, + 251, + 10, + 10, + 143, + 4, + 42, + 140, + 4, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 236, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 225, + 3, + 26, + 222, + 3, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 68, + 97, + 116, + 97, + 46, + 68, + 101, + 108, + 101, + 116, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 68, + 101, + 108, + 101, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 38, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 68, + 101, + 108, + 101, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 77, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 110, + 97, + 112, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 84, + 117, + 112, + 108, + 101, + 70, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 38, + 118, + 49, + 46, + 84, + 117, + 112, + 108, + 101, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 69, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 38, + 118, + 49, + 46, + 69, + 110, + 116, + 105, + 116, + 121, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 115, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 34, + 49, + 34, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 97, + 100, + 109, + 105, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 38, + 118, + 49, + 46, + 83, + 117, + 98, + 106, + 101, + 99, + 116, + 70, + 105, + 108, + 116, + 101, + 114, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 84, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 34, + 49, + 34, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 41, + 10, + 148, + 3, + 42, + 145, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 231, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 220, + 2, + 26, + 217, + 2, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 100, + 97, + 116, + 97, + 46, + 100, + 101, + 108, + 101, + 116, + 101, + 40, + 123, + 10, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 109, + 101, + 116, + 97, + 100, + 97, + 116, + 97, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 115, + 110, + 97, + 112, + 95, + 116, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 116, + 117, + 112, + 108, + 101, + 70, + 105, + 108, + 116, + 101, + 114, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 101, + 110, + 116, + 105, + 116, + 121, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 97, + 100, + 109, + 105, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 116, + 121, + 112, + 101, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 105, + 100, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 125, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 207, + 3, + 42, + 204, + 3, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 168, + 3, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 157, + 3, + 26, + 154, + 3, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 100, + 101, + 108, + 101, + 116, + 101, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 34, + 116, + 117, + 112, + 108, + 101, + 95, + 102, + 105, + 108, + 116, + 101, + 114, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 101, + 110, + 116, + 105, + 116, + 121, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 115, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 97, + 100, + 109, + 105, + 110, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 115, + 117, + 98, + 106, + 101, + 99, + 116, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 116, + 121, + 112, + 101, + 34, + 58, + 32, + 34, + 117, + 115, + 101, + 114, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 115, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 49, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 34, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 95, + 102, + 105, + 108, + 116, + 101, + 114, + 34, + 58, + 32, + 123, + 125, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 40, + 58, + 1, + 42, + 34, + 35, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 100, + 101, + 108, + 101, + 116, + 101, + ]), + ], + }, + }, + }, + /** RPC method to delete relationships for a tenant, accessed via a POST request to the specified path, tagged as "Data" in OpenAPI documentation. */ + deleteRelationships: { + name: "DeleteRelationships", + requestType: RelationshipDeleteRequest, + requestStream: false, + responseType: RelationshipDeleteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 50, + 10, + 4, + 68, + 97, + 116, + 97, + 18, + 20, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 42, + 20, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 46, + 100, + 101, + 108, + 101, + 116, + 101, + ]), + ], + 578365826: [ + Buffer.from([ + 49, + 58, + 1, + 42, + 34, + 44, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 47, + 100, + 101, + 108, + 101, + 116, + 101, + ]), + ], + }, + }, + }, + /** Executes or runs a specific bundle. This method is useful for processing or triggering actions based on the bundle's data. */ + runBundle: { + name: "RunBundle", + requestType: BundleRunRequest, + requestStream: false, + responseType: BundleRunResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 177, + 7, + 10, + 4, + 68, + 97, + 116, + 97, + 18, + 10, + 114, + 117, + 110, + 32, + 98, + 117, + 110, + 100, + 108, + 101, + 42, + 10, + 98, + 117, + 110, + 100, + 108, + 101, + 46, + 114, + 117, + 110, + 106, + 144, + 7, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 254, + 6, + 50, + 251, + 6, + 10, + 165, + 2, + 42, + 162, + 2, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 130, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 247, + 1, + 26, + 244, + 1, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 68, + 97, + 116, + 97, + 46, + 82, + 117, + 110, + 66, + 117, + 110, + 100, + 108, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 66, + 117, + 110, + 100, + 108, + 101, + 82, + 117, + 110, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 78, + 97, + 109, + 101, + 58, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 65, + 114, + 103, + 117, + 109, + 101, + 110, + 116, + 115, + 58, + 32, + 109, + 97, + 112, + 91, + 115, + 116, + 114, + 105, + 110, + 103, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 34, + 58, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 53, + 54, + 52, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 34, + 58, + 32, + 34, + 55, + 56, + 57, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 138, + 2, + 42, + 135, + 2, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 221, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 210, + 1, + 26, + 207, + 1, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 100, + 97, + 116, + 97, + 46, + 114, + 117, + 110, + 66, + 117, + 110, + 100, + 108, + 101, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 110, + 97, + 109, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 97, + 114, + 103, + 117, + 109, + 101, + 110, + 116, + 115, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 58, + 32, + 34, + 53, + 54, + 52, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 58, + 32, + 34, + 55, + 56, + 57, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 195, + 2, + 42, + 192, + 2, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 156, + 2, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 145, + 2, + 26, + 142, + 2, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 114, + 117, + 110, + 45, + 98, + 117, + 110, + 100, + 108, + 101, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 110, + 97, + 109, + 101, + 34, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 97, + 114, + 103, + 117, + 109, + 101, + 110, + 116, + 115, + 34, + 58, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 34, + 58, + 32, + 34, + 53, + 54, + 52, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 34, + 58, + 32, + 34, + 55, + 56, + 57, + 34, + 10, + 32, + 32, + 32, + 32, + 125, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 44, + 58, + 1, + 42, + 34, + 39, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 100, + 97, + 116, + 97, + 47, + 114, + 117, + 110, + 45, + 98, + 117, + 110, + 100, + 108, + 101, + ]), + ], + }, + }, + }, + }, +} as const; + +export interface DataServiceImplementation { + /** The Write RPC method creates a new relation tuple. */ + write(request: DataWriteRequest, context: CallContext & CallContextExt): Promise>; + /** RPC method to write relationships for a tenant. This can be accessed via a POST request to the given HTTP path. It's tagged under "Data" in OpenAPI documentation. */ + writeRelationships( + request: RelationshipWriteRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** The ReadRelationships RPC method reads relation tuple(s). */ + readRelationships( + request: RelationshipReadRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** The ReadAttributes RPC method reads attribute(s) of a relation. */ + readAttributes( + request: AttributeReadRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** The Delete RPC method deletes a relation tuple. */ + delete(request: DataDeleteRequest, context: CallContext & CallContextExt): Promise>; + /** RPC method to delete relationships for a tenant, accessed via a POST request to the specified path, tagged as "Data" in OpenAPI documentation. */ + deleteRelationships( + request: RelationshipDeleteRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** Executes or runs a specific bundle. This method is useful for processing or triggering actions based on the bundle's data. */ + runBundle(request: BundleRunRequest, context: CallContext & CallContextExt): Promise>; +} + +export interface DataClient { + /** The Write RPC method creates a new relation tuple. */ + write(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + /** RPC method to write relationships for a tenant. This can be accessed via a POST request to the given HTTP path. It's tagged under "Data" in OpenAPI documentation. */ + writeRelationships( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** The ReadRelationships RPC method reads relation tuple(s). */ + readRelationships( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** The ReadAttributes RPC method reads attribute(s) of a relation. */ + readAttributes( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** The Delete RPC method deletes a relation tuple. */ + delete(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + /** RPC method to delete relationships for a tenant, accessed via a POST request to the specified path, tagged as "Data" in OpenAPI documentation. */ + deleteRelationships( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** Executes or runs a specific bundle. This method is useful for processing or triggering actions based on the bundle's data. */ + runBundle(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} + +export type BundleDefinition = typeof BundleDefinition; +export const BundleDefinition = { + name: "Bundle", + fullName: "base.v1.Bundle", + methods: { + /** Writes a bundle of data for a specific operation. This is a general purpose method to handle writing data bundles. */ + write: { + name: "Write", + requestType: BundleWriteRequest, + requestStream: false, + responseType: BundleWriteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 136, + 20, + 10, + 6, + 66, + 117, + 110, + 100, + 108, + 101, + 18, + 12, + 119, + 114, + 105, + 116, + 101, + 32, + 98, + 117, + 110, + 100, + 108, + 101, + 42, + 12, + 98, + 117, + 110, + 100, + 108, + 101, + 46, + 119, + 114, + 105, + 116, + 101, + 106, + 225, + 19, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 207, + 19, + 50, + 204, + 19, + 10, + 211, + 6, + 42, + 208, + 6, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 176, + 6, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 165, + 6, + 26, + 162, + 6, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 66, + 117, + 110, + 100, + 108, + 101, + 46, + 87, + 114, + 105, + 116, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 66, + 117, + 110, + 100, + 108, + 101, + 87, + 114, + 105, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 66, + 117, + 110, + 100, + 108, + 101, + 115, + 58, + 32, + 91, + 93, + 42, + 118, + 49, + 46, + 68, + 97, + 116, + 97, + 66, + 117, + 110, + 100, + 108, + 101, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 78, + 97, + 109, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 65, + 114, + 103, + 117, + 109, + 101, + 110, + 116, + 115, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 79, + 112, + 101, + 114, + 97, + 116, + 105, + 111, + 110, + 115, + 58, + 32, + 91, + 93, + 42, + 118, + 49, + 46, + 79, + 112, + 101, + 114, + 97, + 116, + 105, + 111, + 110, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 82, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 87, + 114, + 105, + 116, + 101, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 35, + 97, + 100, + 109, + 105, + 110, + 64, + 117, + 115, + 101, + 114, + 58, + 123, + 123, + 46, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 125, + 125, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 35, + 109, + 97, + 110, + 97, + 103, + 101, + 114, + 64, + 117, + 115, + 101, + 114, + 58, + 123, + 123, + 46, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 125, + 125, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 65, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 87, + 114, + 105, + 116, + 101, + 58, + 32, + 91, + 93, + 115, + 116, + 114, + 105, + 110, + 103, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 36, + 112, + 117, + 98, + 108, + 105, + 99, + 124, + 98, + 111, + 111, + 108, + 101, + 97, + 110, + 58, + 102, + 97, + 108, + 115, + 101, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 32, + 32, + 32, + 32, + 125, + 44, + 10, + 125, + 41, + 10, + 155, + 6, + 42, + 152, + 6, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 238, + 5, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 227, + 5, + 26, + 224, + 5, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 98, + 117, + 110, + 100, + 108, + 101, + 46, + 119, + 114, + 105, + 116, + 101, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 98, + 117, + 110, + 100, + 108, + 101, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 110, + 97, + 109, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 114, + 103, + 117, + 109, + 101, + 110, + 116, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 111, + 112, + 101, + 114, + 97, + 116, + 105, + 111, + 110, + 115, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 95, + 119, + 114, + 105, + 116, + 101, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 35, + 97, + 100, + 109, + 105, + 110, + 64, + 117, + 115, + 101, + 114, + 58, + 123, + 123, + 46, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 125, + 125, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 35, + 109, + 97, + 110, + 97, + 103, + 101, + 114, + 64, + 117, + 115, + 101, + 114, + 58, + 123, + 123, + 46, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 125, + 125, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 95, + 119, + 114, + 105, + 116, + 101, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 36, + 112, + 117, + 98, + 108, + 105, + 99, + 124, + 98, + 111, + 111, + 108, + 101, + 97, + 110, + 58, + 102, + 97, + 108, + 115, + 101, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 93, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 213, + 6, + 42, + 210, + 6, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 174, + 6, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 163, + 6, + 26, + 160, + 6, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 98, + 117, + 110, + 100, + 108, + 101, + 47, + 119, + 114, + 105, + 116, + 101, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 98, + 117, + 110, + 100, + 108, + 101, + 115, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 110, + 97, + 109, + 101, + 34, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 97, + 114, + 103, + 117, + 109, + 101, + 110, + 116, + 115, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 112, + 101, + 114, + 97, + 116, + 105, + 111, + 110, + 115, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 114, + 101, + 108, + 97, + 116, + 105, + 111, + 110, + 115, + 104, + 105, + 112, + 115, + 95, + 119, + 114, + 105, + 116, + 101, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 35, + 97, + 100, + 109, + 105, + 110, + 64, + 117, + 115, + 101, + 114, + 58, + 123, + 123, + 46, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 125, + 125, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 35, + 109, + 97, + 110, + 97, + 103, + 101, + 114, + 64, + 117, + 115, + 101, + 114, + 58, + 123, + 123, + 46, + 99, + 114, + 101, + 97, + 116, + 111, + 114, + 73, + 68, + 125, + 125, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 44, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 97, + 116, + 116, + 114, + 105, + 98, + 117, + 116, + 101, + 115, + 95, + 119, + 114, + 105, + 116, + 101, + 34, + 58, + 32, + 91, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 58, + 123, + 123, + 46, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 73, + 68, + 125, + 125, + 36, + 112, + 117, + 98, + 108, + 105, + 99, + 124, + 98, + 111, + 111, + 108, + 101, + 97, + 110, + 58, + 102, + 97, + 108, + 115, + 101, + 34, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 93, + 10, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 32, + 125, + 10, + 32, + 32, + 32, + 32, + 93, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 41, + 58, + 1, + 42, + 34, + 36, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 98, + 117, + 110, + 100, + 108, + 101, + 47, + 119, + 114, + 105, + 116, + 101, + ]), + ], + }, + }, + }, + /** Reads a data bundle based on a specified request. This method is tailored for retrieving data bundles. */ + read: { + name: "Read", + requestType: BundleReadRequest, + requestStream: false, + responseType: BundleReadResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 153, + 5, + 10, + 6, + 66, + 117, + 110, + 100, + 108, + 101, + 18, + 11, + 114, + 101, + 97, + 100, + 32, + 98, + 117, + 110, + 100, + 108, + 101, + 42, + 11, + 98, + 117, + 110, + 100, + 108, + 101, + 46, + 114, + 101, + 97, + 100, + 106, + 244, + 4, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 226, + 4, + 50, + 223, + 4, + 10, + 184, + 1, + 42, + 181, + 1, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 149, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 138, + 1, + 26, + 135, + 1, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 66, + 117, + 110, + 100, + 108, + 101, + 46, + 82, + 101, + 97, + 100, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 66, + 117, + 110, + 100, + 108, + 101, + 82, + 101, + 97, + 100, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 78, + 97, + 109, + 101, + 58, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 125, + 41, + 10, + 181, + 1, + 42, + 178, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 136, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 126, + 26, + 124, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 98, + 117, + 110, + 100, + 108, + 101, + 46, + 114, + 101, + 97, + 100, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 110, + 97, + 109, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 233, + 1, + 42, + 230, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 194, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 183, + 1, + 26, + 180, + 1, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 98, + 117, + 110, + 100, + 108, + 101, + 47, + 114, + 101, + 97, + 100, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 110, + 97, + 109, + 101, + 34, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 40, + 58, + 1, + 42, + 34, + 35, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 98, + 117, + 110, + 100, + 108, + 101, + 47, + 114, + 101, + 97, + 100, + ]), + ], + }, + }, + }, + /** Deletes a specific data bundle. This method is used to remove existing bundles from the system. */ + delete: { + name: "Delete", + requestType: BundleDeleteRequest, + requestStream: false, + responseType: BundleDeleteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 166, + 5, + 10, + 6, + 66, + 117, + 110, + 100, + 108, + 101, + 18, + 13, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 98, + 117, + 110, + 100, + 108, + 101, + 42, + 13, + 98, + 117, + 110, + 100, + 108, + 101, + 46, + 100, + 101, + 108, + 101, + 116, + 101, + 106, + 253, + 4, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 235, + 4, + 50, + 232, + 4, + 10, + 188, + 1, + 42, + 185, + 1, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 153, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 142, + 1, + 26, + 139, + 1, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 66, + 117, + 110, + 100, + 108, + 101, + 46, + 68, + 101, + 108, + 101, + 116, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 66, + 117, + 110, + 100, + 108, + 101, + 68, + 101, + 108, + 101, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 84, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 78, + 97, + 109, + 101, + 58, + 32, + 32, + 32, + 32, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 125, + 41, + 10, + 184, + 1, + 42, + 181, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 139, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 128, + 1, + 26, + 126, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 98, + 117, + 110, + 100, + 108, + 101, + 46, + 100, + 101, + 108, + 101, + 116, + 101, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 73, + 100, + 58, + 32, + 34, + 116, + 49, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 110, + 97, + 109, + 101, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 44, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 235, + 1, + 42, + 232, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 196, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 185, + 1, + 26, + 182, + 1, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 98, + 117, + 110, + 100, + 108, + 101, + 47, + 100, + 101, + 108, + 101, + 116, + 101, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 110, + 97, + 109, + 101, + 34, + 58, + 32, + 34, + 111, + 114, + 103, + 97, + 110, + 105, + 122, + 97, + 116, + 105, + 111, + 110, + 95, + 99, + 114, + 101, + 97, + 116, + 101, + 100, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 42, + 58, + 1, + 42, + 34, + 37, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 123, + 116, + 101, + 110, + 97, + 110, + 116, + 95, + 105, + 100, + 125, + 47, + 98, + 117, + 110, + 100, + 108, + 101, + 47, + 100, + 101, + 108, + 101, + 116, + 101, + ]), + ], + }, + }, + }, + }, +} as const; + +export interface BundleServiceImplementation { + /** Writes a bundle of data for a specific operation. This is a general purpose method to handle writing data bundles. */ + write(request: BundleWriteRequest, context: CallContext & CallContextExt): Promise>; + /** Reads a data bundle based on a specified request. This method is tailored for retrieving data bundles. */ + read(request: BundleReadRequest, context: CallContext & CallContextExt): Promise>; + /** Deletes a specific data bundle. This method is used to remove existing bundles from the system. */ + delete( + request: BundleDeleteRequest, + context: CallContext & CallContextExt, + ): Promise>; +} + +export interface BundleClient { + /** Writes a bundle of data for a specific operation. This is a general purpose method to handle writing data bundles. */ + write(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + /** Reads a data bundle based on a specified request. This method is tailored for retrieving data bundles. */ + read(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; + /** Deletes a specific data bundle. This method is used to remove existing bundles from the system. */ + delete( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; +} + +export type TenancyDefinition = typeof TenancyDefinition; +export const TenancyDefinition = { + name: "Tenancy", + fullName: "base.v1.Tenancy", + methods: { + /** + * Create is a unary RPC to create a new tenant. + * It requires a TenantCreateRequest and returns a TenantCreateResponse. + */ + create: { + name: "Create", + requestType: TenantCreateRequest, + requestStream: false, + responseType: TenantCreateResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 213, + 4, + 10, + 7, + 84, + 101, + 110, + 97, + 110, + 99, + 121, + 18, + 13, + 99, + 114, + 101, + 97, + 116, + 101, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 42, + 14, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 46, + 99, + 114, + 101, + 97, + 116, + 101, + 106, + 170, + 4, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 152, + 4, + 50, + 149, + 4, + 10, + 155, + 1, + 42, + 152, + 1, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 121, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 111, + 26, + 109, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 84, + 101, + 110, + 97, + 110, + 99, + 121, + 46, + 67, + 114, + 101, + 97, + 116, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 84, + 101, + 110, + 97, + 110, + 116, + 67, + 114, + 101, + 97, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 32, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 78, + 97, + 109, + 101, + 58, + 32, + 34, + 34, + 10, + 125, + 41, + 10, + 152, + 1, + 42, + 149, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 108, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 98, + 26, + 96, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 116, + 101, + 110, + 97, + 110, + 99, + 121, + 46, + 99, + 114, + 101, + 97, + 116, + 101, + 40, + 123, + 10, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 110, + 97, + 109, + 101, + 58, + 32, + 34, + 34, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 217, + 1, + 42, + 214, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 178, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 167, + 1, + 26, + 164, + 1, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 104, + 116, + 116, + 112, + 58, + 47, + 47, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 99, + 114, + 101, + 97, + 116, + 101, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 105, + 100, + 34, + 58, + 32, + 34, + 34, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 110, + 97, + 109, + 101, + 34, + 58, + 32, + 34, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 23, + 58, + 1, + 42, + 34, + 18, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 99, + 114, + 101, + 97, + 116, + 101, + ]), + ], + }, + }, + }, + /** + * Delete is a unary RPC to delete an existing tenant. + * It requires a TenantDeleteRequest and returns a TenantDeleteResponse. + */ + delete: { + name: "Delete", + requestType: TenantDeleteRequest, + requestStream: false, + responseType: TenantDeleteResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 214, + 3, + 10, + 7, + 84, + 101, + 110, + 97, + 110, + 99, + 121, + 18, + 13, + 100, + 101, + 108, + 101, + 116, + 101, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 42, + 14, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 46, + 100, + 101, + 108, + 101, + 116, + 101, + 106, + 171, + 3, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 153, + 3, + 50, + 150, + 3, + 10, + 139, + 1, + 42, + 136, + 1, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 105, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 95, + 26, + 93, + 114, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 84, + 101, + 110, + 97, + 110, + 99, + 121, + 46, + 68, + 101, + 108, + 101, + 116, + 101, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 84, + 101, + 110, + 97, + 110, + 116, + 68, + 101, + 108, + 101, + 116, + 101, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 73, + 100, + 58, + 32, + 34, + 34, + 10, + 125, + 41, + 10, + 140, + 1, + 42, + 137, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 96, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 86, + 26, + 84, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 116, + 101, + 110, + 97, + 110, + 99, + 121, + 46, + 100, + 101, + 108, + 101, + 116, + 101, + 40, + 123, + 10, + 32, + 32, + 32, + 105, + 100, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 46, + 116, + 104, + 101, + 110, + 40, + 40, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 41, + 32, + 61, + 62, + 32, + 123, + 10, + 32, + 32, + 32, + 32, + 47, + 47, + 32, + 104, + 97, + 110, + 100, + 108, + 101, + 32, + 114, + 101, + 115, + 112, + 111, + 110, + 115, + 101, + 10, + 125, + 41, + 10, + 119, + 42, + 117, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 82, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 72, + 26, + 70, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 68, + 69, + 76, + 69, + 84, + 69, + 32, + 39, + 104, + 116, + 116, + 112, + 58, + 47, + 47, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 116, + 49, + 39, + ]), + ], + 578365826: [ + Buffer.from([18, 42, 16, 47, 118, 49, 47, 116, 101, 110, 97, 110, 116, 115, 47, 123, 105, 100, 125]), + ], + }, + }, + }, + /** + * List is a unary RPC to get a list of all tenants. + * It requires a TenantListRequest and returns a TenantListResponse. + */ + list: { + name: "List", + requestType: TenantListRequest, + requestStream: false, + responseType: TenantListResponse, + responseStream: false, + options: { + _unknownFields: { + 8338: [ + Buffer.from([ + 214, + 4, + 10, + 7, + 84, + 101, + 110, + 97, + 110, + 99, + 121, + 18, + 12, + 108, + 105, + 115, + 116, + 32, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 42, + 12, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 46, + 108, + 105, + 115, + 116, + 106, + 174, + 4, + 10, + 13, + 120, + 45, + 99, + 111, + 100, + 101, + 83, + 97, + 109, + 112, + 108, + 101, + 115, + 18, + 156, + 4, + 50, + 153, + 4, + 10, + 168, + 1, + 42, + 165, + 1, + 10, + 13, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 12, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 4, + 26, + 2, + 103, + 111, + 10, + 133, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 123, + 26, + 121, + 99, + 114, + 44, + 32, + 101, + 114, + 114, + 32, + 58, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 84, + 101, + 110, + 97, + 110, + 99, + 121, + 46, + 76, + 105, + 115, + 116, + 40, + 99, + 111, + 110, + 116, + 101, + 120, + 116, + 46, + 66, + 97, + 99, + 107, + 103, + 114, + 111, + 117, + 110, + 100, + 40, + 41, + 44, + 32, + 38, + 118, + 49, + 46, + 84, + 101, + 110, + 97, + 110, + 116, + 76, + 105, + 115, + 116, + 82, + 101, + 113, + 117, + 101, + 115, + 116, + 123, + 10, + 32, + 32, + 32, + 32, + 80, + 97, + 103, + 101, + 83, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 67, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 10, + 133, + 1, + 42, + 130, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 110, + 111, + 100, + 101, + 10, + 20, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 12, + 26, + 10, + 106, + 97, + 118, + 97, + 115, + 99, + 114, + 105, + 112, + 116, + 10, + 89, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 79, + 26, + 77, + 108, + 101, + 116, + 32, + 114, + 101, + 115, + 32, + 61, + 32, + 99, + 108, + 105, + 101, + 110, + 116, + 46, + 116, + 101, + 110, + 97, + 110, + 99, + 121, + 46, + 108, + 105, + 115, + 116, + 40, + 123, + 10, + 32, + 32, + 32, + 32, + 112, + 97, + 103, + 101, + 83, + 105, + 122, + 101, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 84, + 111, + 107, + 101, + 110, + 58, + 32, + 34, + 34, + 44, + 10, + 125, + 41, + 10, + 227, + 1, + 42, + 224, + 1, + 10, + 15, + 10, + 5, + 108, + 97, + 98, + 101, + 108, + 18, + 6, + 26, + 4, + 99, + 85, + 82, + 76, + 10, + 14, + 10, + 4, + 108, + 97, + 110, + 103, + 18, + 6, + 26, + 4, + 99, + 117, + 114, + 108, + 10, + 188, + 1, + 10, + 6, + 115, + 111, + 117, + 114, + 99, + 101, + 18, + 177, + 1, + 26, + 174, + 1, + 99, + 117, + 114, + 108, + 32, + 45, + 45, + 108, + 111, + 99, + 97, + 116, + 105, + 111, + 110, + 32, + 45, + 45, + 114, + 101, + 113, + 117, + 101, + 115, + 116, + 32, + 80, + 79, + 83, + 84, + 32, + 39, + 108, + 111, + 99, + 97, + 108, + 104, + 111, + 115, + 116, + 58, + 51, + 52, + 55, + 54, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 108, + 105, + 115, + 116, + 39, + 32, + 92, + 10, + 45, + 45, + 104, + 101, + 97, + 100, + 101, + 114, + 32, + 39, + 67, + 111, + 110, + 116, + 101, + 110, + 116, + 45, + 84, + 121, + 112, + 101, + 58, + 32, + 97, + 112, + 112, + 108, + 105, + 99, + 97, + 116, + 105, + 111, + 110, + 47, + 106, + 115, + 111, + 110, + 39, + 32, + 92, + 10, + 45, + 45, + 100, + 97, + 116, + 97, + 45, + 114, + 97, + 119, + 32, + 39, + 123, + 10, + 32, + 32, + 32, + 32, + 34, + 112, + 97, + 103, + 101, + 95, + 115, + 105, + 122, + 101, + 34, + 58, + 32, + 50, + 48, + 44, + 10, + 32, + 32, + 32, + 32, + 34, + 99, + 111, + 110, + 116, + 105, + 110, + 117, + 111, + 117, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 34, + 58, + 32, + 34, + 34, + 10, + 125, + 39, + ]), + ], + 578365826: [ + Buffer.from([ + 21, + 58, + 1, + 42, + 34, + 16, + 47, + 118, + 49, + 47, + 116, + 101, + 110, + 97, + 110, + 116, + 115, + 47, + 108, + 105, + 115, + 116, + ]), + ], + }, + }, + }, + }, +} as const; + +export interface TenancyServiceImplementation { + /** + * Create is a unary RPC to create a new tenant. + * It requires a TenantCreateRequest and returns a TenantCreateResponse. + */ + create( + request: TenantCreateRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** + * Delete is a unary RPC to delete an existing tenant. + * It requires a TenantDeleteRequest and returns a TenantDeleteResponse. + */ + delete( + request: TenantDeleteRequest, + context: CallContext & CallContextExt, + ): Promise>; + /** + * List is a unary RPC to get a list of all tenants. + * It requires a TenantListRequest and returns a TenantListResponse. + */ + list(request: TenantListRequest, context: CallContext & CallContextExt): Promise>; +} + +export interface TenancyClient { + /** + * Create is a unary RPC to create a new tenant. + * It requires a TenantCreateRequest and returns a TenantCreateResponse. + */ + create( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** + * Delete is a unary RPC to delete an existing tenant. + * It requires a TenantDeleteRequest and returns a TenantDeleteResponse. + */ + delete( + request: DeepPartial, + options?: CallOptions & CallOptionsExt, + ): Promise; + /** + * List is a unary RPC to get a list of all tenants. + * It requires a TenantListRequest and returns a TenantListResponse. + */ + list(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator }; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/api/annotations.ts b/src/grpc/generated/google/api/annotations.ts new file mode 100644 index 0000000..5ae1518 --- /dev/null +++ b/src/grpc/generated/google/api/annotations.ts @@ -0,0 +1,9 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/api/annotations.proto + +/* eslint-disable */ + +export const protobufPackage = "google.api"; diff --git a/src/grpc/generated/google/api/expr/v1alpha1/checked.ts b/src/grpc/generated/google/api/expr/v1alpha1/checked.ts new file mode 100644 index 0000000..8b53adf --- /dev/null +++ b/src/grpc/generated/google/api/expr/v1alpha1/checked.ts @@ -0,0 +1,1950 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/api/expr/v1alpha1/checked.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; +import { Empty } from "../../../protobuf/empty"; +import { NullValue, nullValueFromJSON, nullValueToJSON } from "../../../protobuf/struct"; +import { Constant, Expr, SourceInfo } from "./syntax"; + +export const protobufPackage = "google.api.expr.v1alpha1"; + +/** A CEL expression which has been successfully type checked. */ +export interface CheckedExpr { + /** + * A map from expression ids to resolved references. + * + * The following entries are in this table: + * + * - An Ident or Select expression is represented here if it resolves to a + * declaration. For instance, if `a.b.c` is represented by + * `select(select(id(a), b), c)`, and `a.b` resolves to a declaration, + * while `c` is a field selection, then the reference is attached to the + * nested select expression (but not to the id or or the outer select). + * In turn, if `a` resolves to a declaration and `b.c` are field selections, + * the reference is attached to the ident expression. + * - Every Call expression has an entry here, identifying the function being + * called. + * - Every CreateStruct expression for a message has an entry, identifying + * the message. + */ + referenceMap: Map; + /** + * A map from expression ids to types. + * + * Every expression node which has a type different than DYN has a mapping + * here. If an expression has type DYN, it is omitted from this map to save + * space. + */ + typeMap: Map; + /** + * The source info derived from input that generated the parsed `expr` and + * any optimizations made during the type-checking pass. + */ + sourceInfo: + | SourceInfo + | undefined; + /** + * The expr version indicates the major / minor version number of the `expr` + * representation. + * + * The most common reason for a version change will be to indicate to the CEL + * runtimes that transformations have been performed on the expr during static + * analysis. In some cases, this will save the runtime the work of applying + * the same or similar transformations prior to evaluation. + */ + exprVersion: string; + /** + * The checked expression. Semantically equivalent to the parsed `expr`, but + * may have structural differences. + */ + expr: Expr | undefined; +} + +export interface CheckedExpr_ReferenceMapEntry { + key: Long; + value: Reference | undefined; +} + +export interface CheckedExpr_TypeMapEntry { + key: Long; + value: Type | undefined; +} + +/** Represents a CEL type. */ +export interface Type { + /** The kind of type. */ + typeKind?: + | // + /** Dynamic type. */ + { $case: "dyn"; dyn: Empty } + | // + /** Null value. */ + { $case: "null"; null: NullValue } + | // + /** Primitive types: `true`, `1u`, `-2.0`, `'string'`, `b'bytes'`. */ + { $case: "primitive"; primitive: Type_PrimitiveType } + | // + /** Wrapper of a primitive type, e.g. `google.protobuf.Int64Value`. */ + { $case: "wrapper"; wrapper: Type_PrimitiveType } + | // + /** Well-known protobuf type such as `google.protobuf.Timestamp`. */ + { $case: "wellKnown"; wellKnown: Type_WellKnownType } + | // + /** Parameterized list with elements of `list_type`, e.g. `list`. */ + { $case: "listType"; listType: Type_ListType } + | // + /** Parameterized map with typed keys and values. */ + { $case: "mapType"; mapType: Type_MapType } + | // + /** Function type. */ + { $case: "function"; function: Type_FunctionType } + | // + /** + * Protocol buffer message type. + * + * The `message_type` string specifies the qualified message type name. For + * example, `google.plus.Profile`. + */ + { $case: "messageType"; messageType: string } + | // + /** + * Type param type. + * + * The `type_param` string specifies the type parameter name, e.g. `list` + * would be a `list_type` whose element type was a `type_param` type + * named `E`. + */ + { $case: "typeParam"; typeParam: string } + | // + /** + * Type type. + * + * The `type` value specifies the target type. e.g. int is type with a + * target type of `Primitive.INT`. + */ + { $case: "type"; type: Type } + | // + /** + * Error type. + * + * During type-checking if an expression is an error, its type is propagated + * as the `ERROR` type. This permits the type-checker to discover other + * errors present in the expression. + */ + { $case: "error"; error: Empty } + | // + /** Abstract, application defined type. */ + { $case: "abstractType"; abstractType: Type_AbstractType } + | undefined; +} + +/** CEL primitive types. */ +export enum Type_PrimitiveType { + /** PRIMITIVE_TYPE_UNSPECIFIED - Unspecified type. */ + PRIMITIVE_TYPE_UNSPECIFIED = 0, + /** BOOL - Boolean type. */ + BOOL = 1, + /** + * INT64 - Int64 type. + * + * Proto-based integer values are widened to int64. + */ + INT64 = 2, + /** + * UINT64 - Uint64 type. + * + * Proto-based unsigned integer values are widened to uint64. + */ + UINT64 = 3, + /** + * DOUBLE - Double type. + * + * Proto-based float values are widened to double values. + */ + DOUBLE = 4, + /** STRING - String type. */ + STRING = 5, + /** BYTES - Bytes type. */ + BYTES = 6, + UNRECOGNIZED = -1, +} + +export function type_PrimitiveTypeFromJSON(object: any): Type_PrimitiveType { + switch (object) { + case 0: + case "PRIMITIVE_TYPE_UNSPECIFIED": + return Type_PrimitiveType.PRIMITIVE_TYPE_UNSPECIFIED; + case 1: + case "BOOL": + return Type_PrimitiveType.BOOL; + case 2: + case "INT64": + return Type_PrimitiveType.INT64; + case 3: + case "UINT64": + return Type_PrimitiveType.UINT64; + case 4: + case "DOUBLE": + return Type_PrimitiveType.DOUBLE; + case 5: + case "STRING": + return Type_PrimitiveType.STRING; + case 6: + case "BYTES": + return Type_PrimitiveType.BYTES; + case -1: + case "UNRECOGNIZED": + default: + return Type_PrimitiveType.UNRECOGNIZED; + } +} + +export function type_PrimitiveTypeToJSON(object: Type_PrimitiveType): string { + switch (object) { + case Type_PrimitiveType.PRIMITIVE_TYPE_UNSPECIFIED: + return "PRIMITIVE_TYPE_UNSPECIFIED"; + case Type_PrimitiveType.BOOL: + return "BOOL"; + case Type_PrimitiveType.INT64: + return "INT64"; + case Type_PrimitiveType.UINT64: + return "UINT64"; + case Type_PrimitiveType.DOUBLE: + return "DOUBLE"; + case Type_PrimitiveType.STRING: + return "STRING"; + case Type_PrimitiveType.BYTES: + return "BYTES"; + case Type_PrimitiveType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Well-known protobuf types treated with first-class support in CEL. */ +export enum Type_WellKnownType { + /** WELL_KNOWN_TYPE_UNSPECIFIED - Unspecified type. */ + WELL_KNOWN_TYPE_UNSPECIFIED = 0, + /** + * ANY - Well-known protobuf.Any type. + * + * Any types are a polymorphic message type. During type-checking they are + * treated like `DYN` types, but at runtime they are resolved to a specific + * message type specified at evaluation time. + */ + ANY = 1, + /** TIMESTAMP - Well-known protobuf.Timestamp type, internally referenced as `timestamp`. */ + TIMESTAMP = 2, + /** DURATION - Well-known protobuf.Duration type, internally referenced as `duration`. */ + DURATION = 3, + UNRECOGNIZED = -1, +} + +export function type_WellKnownTypeFromJSON(object: any): Type_WellKnownType { + switch (object) { + case 0: + case "WELL_KNOWN_TYPE_UNSPECIFIED": + return Type_WellKnownType.WELL_KNOWN_TYPE_UNSPECIFIED; + case 1: + case "ANY": + return Type_WellKnownType.ANY; + case 2: + case "TIMESTAMP": + return Type_WellKnownType.TIMESTAMP; + case 3: + case "DURATION": + return Type_WellKnownType.DURATION; + case -1: + case "UNRECOGNIZED": + default: + return Type_WellKnownType.UNRECOGNIZED; + } +} + +export function type_WellKnownTypeToJSON(object: Type_WellKnownType): string { + switch (object) { + case Type_WellKnownType.WELL_KNOWN_TYPE_UNSPECIFIED: + return "WELL_KNOWN_TYPE_UNSPECIFIED"; + case Type_WellKnownType.ANY: + return "ANY"; + case Type_WellKnownType.TIMESTAMP: + return "TIMESTAMP"; + case Type_WellKnownType.DURATION: + return "DURATION"; + case Type_WellKnownType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** List type with typed elements, e.g. `list`. */ +export interface Type_ListType { + /** The element type. */ + elemType: Type | undefined; +} + +/** Map type with parameterized key and value types, e.g. `map`. */ +export interface Type_MapType { + /** The type of the key. */ + keyType: + | Type + | undefined; + /** The type of the value. */ + valueType: Type | undefined; +} + +/** Function type with result and arg types. */ +export interface Type_FunctionType { + /** Result type of the function. */ + resultType: + | Type + | undefined; + /** Argument types of the function. */ + argTypes: Type[]; +} + +/** Application defined abstract type. */ +export interface Type_AbstractType { + /** The fully qualified name of this abstract type. */ + name: string; + /** Parameter types for this abstract type. */ + parameterTypes: Type[]; +} + +/** + * Represents a declaration of a named value or function. + * + * A declaration is part of the contract between the expression, the agent + * evaluating that expression, and the caller requesting evaluation. + */ +export interface Decl { + /** + * The fully qualified name of the declaration. + * + * Declarations are organized in containers and this represents the full path + * to the declaration in its container, as in `google.api.expr.Decl`. + * + * Declarations used as + * [FunctionDecl.Overload][google.api.expr.v1alpha1.Decl.FunctionDecl.Overload] + * parameters may or may not have a name depending on whether the overload is + * function declaration or a function definition containing a result + * [Expr][google.api.expr.v1alpha1.Expr]. + */ + name: string; + /** Required. The declaration kind. */ + declKind?: + | // + /** Identifier declaration. */ + { $case: "ident"; ident: Decl_IdentDecl } + | // + /** Function declaration. */ + { $case: "function"; function: Decl_FunctionDecl } + | undefined; +} + +/** + * Identifier declaration which specifies its type and optional `Expr` value. + * + * An identifier without a value is a declaration that must be provided at + * evaluation time. An identifier with a value should resolve to a constant, + * but may be used in conjunction with other identifiers bound at evaluation + * time. + */ +export interface Decl_IdentDecl { + /** Required. The type of the identifier. */ + type: + | Type + | undefined; + /** + * The constant value of the identifier. If not specified, the identifier + * must be supplied at evaluation time. + */ + value: + | Constant + | undefined; + /** Documentation string for the identifier. */ + doc: string; +} + +/** + * Function declaration specifies one or more overloads which indicate the + * function's parameter types and return type. + * + * Functions have no observable side-effects (there may be side-effects like + * logging which are not observable from CEL). + */ +export interface Decl_FunctionDecl { + /** Required. List of function overloads, must contain at least one overload. */ + overloads: Decl_FunctionDecl_Overload[]; +} + +/** + * An overload indicates a function's parameter types and return type, and + * may optionally include a function body described in terms of + * [Expr][google.api.expr.v1alpha1.Expr] values. + * + * Functions overloads are declared in either a function or method + * call-style. For methods, the `params[0]` is the expected type of the + * target receiver. + * + * Overloads must have non-overlapping argument types after erasure of all + * parameterized type variables (similar as type erasure in Java). + */ +export interface Decl_FunctionDecl_Overload { + /** + * Required. Globally unique overload name of the function which reflects + * the function name and argument types. + * + * This will be used by a [Reference][google.api.expr.v1alpha1.Reference] + * to indicate the `overload_id` that was resolved for the function + * `name`. + */ + overloadId: string; + /** + * List of function parameter [Type][google.api.expr.v1alpha1.Type] + * values. + * + * Param types are disjoint after generic type parameters have been + * replaced with the type `DYN`. Since the `DYN` type is compatible with + * any other type, this means that if `A` is a type parameter, the + * function types `int` and `int` are not disjoint. Likewise, + * `map` is not disjoint from `map`. + * + * When the `result_type` of a function is a generic type param, the + * type param name also appears as the `type` of on at least one params. + */ + params: Type[]; + /** + * The type param names associated with the function declaration. + * + * For example, `function ex(K key, map map) : V` would yield + * the type params of `K, V`. + */ + typeParams: string[]; + /** + * Required. The result type of the function. For example, the operator + * `string.isEmpty()` would have `result_type` of `kind: BOOL`. + */ + resultType: + | Type + | undefined; + /** + * Whether the function is to be used in a method call-style `x.f(...)` + * or a function call-style `f(x, ...)`. + * + * For methods, the first parameter declaration, `params[0]` is the + * expected type of the target receiver. + */ + isInstanceFunction: boolean; + /** Documentation string for the overload. */ + doc: string; +} + +/** Describes a resolved reference to a declaration. */ +export interface Reference { + /** The fully qualified name of the declaration. */ + name: string; + /** + * For references to functions, this is a list of `Overload.overload_id` + * values which match according to typing rules. + * + * If the list has more than one element, overload resolution among the + * presented candidates must happen at runtime because of dynamic types. The + * type checker attempts to narrow down this list as much as possible. + * + * Empty if this is not a reference to a + * [Decl.FunctionDecl][google.api.expr.v1alpha1.Decl.FunctionDecl]. + */ + overloadId: string[]; + /** + * For references to constants, this may contain the value of the + * constant if known at compile time. + */ + value: Constant | undefined; +} + +function createBaseCheckedExpr(): CheckedExpr { + return { referenceMap: new Map(), typeMap: new Map(), sourceInfo: undefined, exprVersion: "", expr: undefined }; +} + +export const CheckedExpr: MessageFns = { + encode(message: CheckedExpr, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + message.referenceMap.forEach((value, key) => { + CheckedExpr_ReferenceMapEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + message.typeMap.forEach((value, key) => { + CheckedExpr_TypeMapEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + if (message.sourceInfo !== undefined) { + SourceInfo.encode(message.sourceInfo, writer.uint32(42).fork()).join(); + } + if (message.exprVersion !== "") { + writer.uint32(50).string(message.exprVersion); + } + if (message.expr !== undefined) { + Expr.encode(message.expr, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CheckedExpr { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCheckedExpr(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + + const entry2 = CheckedExpr_ReferenceMapEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.referenceMap.set(entry2.key, entry2.value); + } + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + const entry3 = CheckedExpr_TypeMapEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.typeMap.set(entry3.key, entry3.value); + } + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.sourceInfo = SourceInfo.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.exprVersion = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.expr = Expr.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CheckedExpr { + return { + referenceMap: isObject(object.referenceMap) + ? Object.entries(object.referenceMap).reduce>((acc, [key, value]) => { + acc.set(Long.fromValue(key), Reference.fromJSON(value)); + return acc; + }, new Map()) + : new Map(), + typeMap: isObject(object.typeMap) + ? Object.entries(object.typeMap).reduce>((acc, [key, value]) => { + acc.set(Long.fromValue(key), Type.fromJSON(value)); + return acc; + }, new Map()) + : new Map(), + sourceInfo: isSet(object.sourceInfo) ? SourceInfo.fromJSON(object.sourceInfo) : undefined, + exprVersion: isSet(object.exprVersion) ? globalThis.String(object.exprVersion) : "", + expr: isSet(object.expr) ? Expr.fromJSON(object.expr) : undefined, + }; + }, + + toJSON(message: CheckedExpr): unknown { + const obj: any = {}; + if (message.referenceMap?.size) { + obj.referenceMap = {}; + message.referenceMap.forEach((v, k) => { + obj.referenceMap[longToNumber(k)] = Reference.toJSON(v); + }); + } + if (message.typeMap?.size) { + obj.typeMap = {}; + message.typeMap.forEach((v, k) => { + obj.typeMap[longToNumber(k)] = Type.toJSON(v); + }); + } + if (message.sourceInfo !== undefined) { + obj.sourceInfo = SourceInfo.toJSON(message.sourceInfo); + } + if (message.exprVersion !== "") { + obj.exprVersion = message.exprVersion; + } + if (message.expr !== undefined) { + obj.expr = Expr.toJSON(message.expr); + } + return obj; + }, + + create(base?: DeepPartial): CheckedExpr { + return CheckedExpr.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CheckedExpr { + const message = createBaseCheckedExpr(); + message.referenceMap = (() => { + const m = new Map(); + (object.referenceMap as Map ?? new Map()).forEach((value, key) => { + if (value !== undefined) { + m.set(key, Reference.fromPartial(value)); + } + }); + return m; + })(); + message.typeMap = (() => { + const m = new Map(); + (object.typeMap as Map ?? new Map()).forEach((value, key) => { + if (value !== undefined) { + m.set(key, Type.fromPartial(value)); + } + }); + return m; + })(); + message.sourceInfo = (object.sourceInfo !== undefined && object.sourceInfo !== null) + ? SourceInfo.fromPartial(object.sourceInfo) + : undefined; + message.exprVersion = object.exprVersion ?? ""; + message.expr = (object.expr !== undefined && object.expr !== null) ? Expr.fromPartial(object.expr) : undefined; + return message; + }, +}; + +function createBaseCheckedExpr_ReferenceMapEntry(): CheckedExpr_ReferenceMapEntry { + return { key: Long.ZERO, value: undefined }; +} + +export const CheckedExpr_ReferenceMapEntry: MessageFns = { + encode(message: CheckedExpr_ReferenceMapEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.key.equals(Long.ZERO)) { + writer.uint32(8).int64(message.key.toString()); + } + if (message.value !== undefined) { + Reference.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CheckedExpr_ReferenceMapEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCheckedExpr_ReferenceMapEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.key = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Reference.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CheckedExpr_ReferenceMapEntry { + return { + key: isSet(object.key) ? Long.fromValue(object.key) : Long.ZERO, + value: isSet(object.value) ? Reference.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: CheckedExpr_ReferenceMapEntry): unknown { + const obj: any = {}; + if (!message.key.equals(Long.ZERO)) { + obj.key = (message.key || Long.ZERO).toString(); + } + if (message.value !== undefined) { + obj.value = Reference.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): CheckedExpr_ReferenceMapEntry { + return CheckedExpr_ReferenceMapEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CheckedExpr_ReferenceMapEntry { + const message = createBaseCheckedExpr_ReferenceMapEntry(); + message.key = (object.key !== undefined && object.key !== null) ? Long.fromValue(object.key) : Long.ZERO; + message.value = (object.value !== undefined && object.value !== null) + ? Reference.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseCheckedExpr_TypeMapEntry(): CheckedExpr_TypeMapEntry { + return { key: Long.ZERO, value: undefined }; +} + +export const CheckedExpr_TypeMapEntry: MessageFns = { + encode(message: CheckedExpr_TypeMapEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.key.equals(Long.ZERO)) { + writer.uint32(8).int64(message.key.toString()); + } + if (message.value !== undefined) { + Type.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CheckedExpr_TypeMapEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCheckedExpr_TypeMapEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.key = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Type.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CheckedExpr_TypeMapEntry { + return { + key: isSet(object.key) ? Long.fromValue(object.key) : Long.ZERO, + value: isSet(object.value) ? Type.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: CheckedExpr_TypeMapEntry): unknown { + const obj: any = {}; + if (!message.key.equals(Long.ZERO)) { + obj.key = (message.key || Long.ZERO).toString(); + } + if (message.value !== undefined) { + obj.value = Type.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): CheckedExpr_TypeMapEntry { + return CheckedExpr_TypeMapEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CheckedExpr_TypeMapEntry { + const message = createBaseCheckedExpr_TypeMapEntry(); + message.key = (object.key !== undefined && object.key !== null) ? Long.fromValue(object.key) : Long.ZERO; + message.value = (object.value !== undefined && object.value !== null) ? Type.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseType(): Type { + return { typeKind: undefined }; +} + +export const Type: MessageFns = { + encode(message: Type, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + switch (message.typeKind?.$case) { + case "dyn": + Empty.encode(message.typeKind.dyn, writer.uint32(10).fork()).join(); + break; + case "null": + writer.uint32(16).int32(message.typeKind.null); + break; + case "primitive": + writer.uint32(24).int32(message.typeKind.primitive); + break; + case "wrapper": + writer.uint32(32).int32(message.typeKind.wrapper); + break; + case "wellKnown": + writer.uint32(40).int32(message.typeKind.wellKnown); + break; + case "listType": + Type_ListType.encode(message.typeKind.listType, writer.uint32(50).fork()).join(); + break; + case "mapType": + Type_MapType.encode(message.typeKind.mapType, writer.uint32(58).fork()).join(); + break; + case "function": + Type_FunctionType.encode(message.typeKind.function, writer.uint32(66).fork()).join(); + break; + case "messageType": + writer.uint32(74).string(message.typeKind.messageType); + break; + case "typeParam": + writer.uint32(82).string(message.typeKind.typeParam); + break; + case "type": + Type.encode(message.typeKind.type, writer.uint32(90).fork()).join(); + break; + case "error": + Empty.encode(message.typeKind.error, writer.uint32(98).fork()).join(); + break; + case "abstractType": + Type_AbstractType.encode(message.typeKind.abstractType, writer.uint32(114).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Type { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.typeKind = { $case: "dyn", dyn: Empty.decode(reader, reader.uint32()) }; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.typeKind = { $case: "null", null: reader.int32() as any }; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.typeKind = { $case: "primitive", primitive: reader.int32() as any }; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.typeKind = { $case: "wrapper", wrapper: reader.int32() as any }; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.typeKind = { $case: "wellKnown", wellKnown: reader.int32() as any }; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.typeKind = { $case: "listType", listType: Type_ListType.decode(reader, reader.uint32()) }; + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.typeKind = { $case: "mapType", mapType: Type_MapType.decode(reader, reader.uint32()) }; + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.typeKind = { $case: "function", function: Type_FunctionType.decode(reader, reader.uint32()) }; + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.typeKind = { $case: "messageType", messageType: reader.string() }; + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.typeKind = { $case: "typeParam", typeParam: reader.string() }; + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.typeKind = { $case: "type", type: Type.decode(reader, reader.uint32()) }; + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.typeKind = { $case: "error", error: Empty.decode(reader, reader.uint32()) }; + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.typeKind = { $case: "abstractType", abstractType: Type_AbstractType.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type { + return { + typeKind: isSet(object.dyn) + ? { $case: "dyn", dyn: Empty.fromJSON(object.dyn) } + : isSet(object.null) + ? { $case: "null", null: nullValueFromJSON(object.null) } + : isSet(object.primitive) + ? { $case: "primitive", primitive: type_PrimitiveTypeFromJSON(object.primitive) } + : isSet(object.wrapper) + ? { $case: "wrapper", wrapper: type_PrimitiveTypeFromJSON(object.wrapper) } + : isSet(object.wellKnown) + ? { $case: "wellKnown", wellKnown: type_WellKnownTypeFromJSON(object.wellKnown) } + : isSet(object.listType) + ? { $case: "listType", listType: Type_ListType.fromJSON(object.listType) } + : isSet(object.mapType) + ? { $case: "mapType", mapType: Type_MapType.fromJSON(object.mapType) } + : isSet(object.function) + ? { $case: "function", function: Type_FunctionType.fromJSON(object.function) } + : isSet(object.messageType) + ? { $case: "messageType", messageType: globalThis.String(object.messageType) } + : isSet(object.typeParam) + ? { $case: "typeParam", typeParam: globalThis.String(object.typeParam) } + : isSet(object.type) + ? { $case: "type", type: Type.fromJSON(object.type) } + : isSet(object.error) + ? { $case: "error", error: Empty.fromJSON(object.error) } + : isSet(object.abstractType) + ? { $case: "abstractType", abstractType: Type_AbstractType.fromJSON(object.abstractType) } + : undefined, + }; + }, + + toJSON(message: Type): unknown { + const obj: any = {}; + if (message.typeKind?.$case === "dyn") { + obj.dyn = Empty.toJSON(message.typeKind.dyn); + } else if (message.typeKind?.$case === "null") { + obj.null = nullValueToJSON(message.typeKind.null); + } else if (message.typeKind?.$case === "primitive") { + obj.primitive = type_PrimitiveTypeToJSON(message.typeKind.primitive); + } else if (message.typeKind?.$case === "wrapper") { + obj.wrapper = type_PrimitiveTypeToJSON(message.typeKind.wrapper); + } else if (message.typeKind?.$case === "wellKnown") { + obj.wellKnown = type_WellKnownTypeToJSON(message.typeKind.wellKnown); + } else if (message.typeKind?.$case === "listType") { + obj.listType = Type_ListType.toJSON(message.typeKind.listType); + } else if (message.typeKind?.$case === "mapType") { + obj.mapType = Type_MapType.toJSON(message.typeKind.mapType); + } else if (message.typeKind?.$case === "function") { + obj.function = Type_FunctionType.toJSON(message.typeKind.function); + } else if (message.typeKind?.$case === "messageType") { + obj.messageType = message.typeKind.messageType; + } else if (message.typeKind?.$case === "typeParam") { + obj.typeParam = message.typeKind.typeParam; + } else if (message.typeKind?.$case === "type") { + obj.type = Type.toJSON(message.typeKind.type); + } else if (message.typeKind?.$case === "error") { + obj.error = Empty.toJSON(message.typeKind.error); + } else if (message.typeKind?.$case === "abstractType") { + obj.abstractType = Type_AbstractType.toJSON(message.typeKind.abstractType); + } + return obj; + }, + + create(base?: DeepPartial): Type { + return Type.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Type { + const message = createBaseType(); + switch (object.typeKind?.$case) { + case "dyn": { + if (object.typeKind?.dyn !== undefined && object.typeKind?.dyn !== null) { + message.typeKind = { $case: "dyn", dyn: Empty.fromPartial(object.typeKind.dyn) }; + } + break; + } + case "null": { + if (object.typeKind?.null !== undefined && object.typeKind?.null !== null) { + message.typeKind = { $case: "null", null: object.typeKind.null }; + } + break; + } + case "primitive": { + if (object.typeKind?.primitive !== undefined && object.typeKind?.primitive !== null) { + message.typeKind = { $case: "primitive", primitive: object.typeKind.primitive }; + } + break; + } + case "wrapper": { + if (object.typeKind?.wrapper !== undefined && object.typeKind?.wrapper !== null) { + message.typeKind = { $case: "wrapper", wrapper: object.typeKind.wrapper }; + } + break; + } + case "wellKnown": { + if (object.typeKind?.wellKnown !== undefined && object.typeKind?.wellKnown !== null) { + message.typeKind = { $case: "wellKnown", wellKnown: object.typeKind.wellKnown }; + } + break; + } + case "listType": { + if (object.typeKind?.listType !== undefined && object.typeKind?.listType !== null) { + message.typeKind = { $case: "listType", listType: Type_ListType.fromPartial(object.typeKind.listType) }; + } + break; + } + case "mapType": { + if (object.typeKind?.mapType !== undefined && object.typeKind?.mapType !== null) { + message.typeKind = { $case: "mapType", mapType: Type_MapType.fromPartial(object.typeKind.mapType) }; + } + break; + } + case "function": { + if (object.typeKind?.function !== undefined && object.typeKind?.function !== null) { + message.typeKind = { $case: "function", function: Type_FunctionType.fromPartial(object.typeKind.function) }; + } + break; + } + case "messageType": { + if (object.typeKind?.messageType !== undefined && object.typeKind?.messageType !== null) { + message.typeKind = { $case: "messageType", messageType: object.typeKind.messageType }; + } + break; + } + case "typeParam": { + if (object.typeKind?.typeParam !== undefined && object.typeKind?.typeParam !== null) { + message.typeKind = { $case: "typeParam", typeParam: object.typeKind.typeParam }; + } + break; + } + case "type": { + if (object.typeKind?.type !== undefined && object.typeKind?.type !== null) { + message.typeKind = { $case: "type", type: Type.fromPartial(object.typeKind.type) }; + } + break; + } + case "error": { + if (object.typeKind?.error !== undefined && object.typeKind?.error !== null) { + message.typeKind = { $case: "error", error: Empty.fromPartial(object.typeKind.error) }; + } + break; + } + case "abstractType": { + if (object.typeKind?.abstractType !== undefined && object.typeKind?.abstractType !== null) { + message.typeKind = { + $case: "abstractType", + abstractType: Type_AbstractType.fromPartial(object.typeKind.abstractType), + }; + } + break; + } + } + return message; + }, +}; + +function createBaseType_ListType(): Type_ListType { + return { elemType: undefined }; +} + +export const Type_ListType: MessageFns = { + encode(message: Type_ListType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.elemType !== undefined) { + Type.encode(message.elemType, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Type_ListType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_ListType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.elemType = Type.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_ListType { + return { elemType: isSet(object.elemType) ? Type.fromJSON(object.elemType) : undefined }; + }, + + toJSON(message: Type_ListType): unknown { + const obj: any = {}; + if (message.elemType !== undefined) { + obj.elemType = Type.toJSON(message.elemType); + } + return obj; + }, + + create(base?: DeepPartial): Type_ListType { + return Type_ListType.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Type_ListType { + const message = createBaseType_ListType(); + message.elemType = (object.elemType !== undefined && object.elemType !== null) + ? Type.fromPartial(object.elemType) + : undefined; + return message; + }, +}; + +function createBaseType_MapType(): Type_MapType { + return { keyType: undefined, valueType: undefined }; +} + +export const Type_MapType: MessageFns = { + encode(message: Type_MapType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.keyType !== undefined) { + Type.encode(message.keyType, writer.uint32(10).fork()).join(); + } + if (message.valueType !== undefined) { + Type.encode(message.valueType, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Type_MapType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_MapType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.keyType = Type.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.valueType = Type.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_MapType { + return { + keyType: isSet(object.keyType) ? Type.fromJSON(object.keyType) : undefined, + valueType: isSet(object.valueType) ? Type.fromJSON(object.valueType) : undefined, + }; + }, + + toJSON(message: Type_MapType): unknown { + const obj: any = {}; + if (message.keyType !== undefined) { + obj.keyType = Type.toJSON(message.keyType); + } + if (message.valueType !== undefined) { + obj.valueType = Type.toJSON(message.valueType); + } + return obj; + }, + + create(base?: DeepPartial): Type_MapType { + return Type_MapType.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Type_MapType { + const message = createBaseType_MapType(); + message.keyType = (object.keyType !== undefined && object.keyType !== null) + ? Type.fromPartial(object.keyType) + : undefined; + message.valueType = (object.valueType !== undefined && object.valueType !== null) + ? Type.fromPartial(object.valueType) + : undefined; + return message; + }, +}; + +function createBaseType_FunctionType(): Type_FunctionType { + return { resultType: undefined, argTypes: [] }; +} + +export const Type_FunctionType: MessageFns = { + encode(message: Type_FunctionType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.resultType !== undefined) { + Type.encode(message.resultType, writer.uint32(10).fork()).join(); + } + for (const v of message.argTypes) { + Type.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Type_FunctionType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_FunctionType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.resultType = Type.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.argTypes.push(Type.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_FunctionType { + return { + resultType: isSet(object.resultType) ? Type.fromJSON(object.resultType) : undefined, + argTypes: globalThis.Array.isArray(object?.argTypes) ? object.argTypes.map((e: any) => Type.fromJSON(e)) : [], + }; + }, + + toJSON(message: Type_FunctionType): unknown { + const obj: any = {}; + if (message.resultType !== undefined) { + obj.resultType = Type.toJSON(message.resultType); + } + if (message.argTypes?.length) { + obj.argTypes = message.argTypes.map((e) => Type.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Type_FunctionType { + return Type_FunctionType.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Type_FunctionType { + const message = createBaseType_FunctionType(); + message.resultType = (object.resultType !== undefined && object.resultType !== null) + ? Type.fromPartial(object.resultType) + : undefined; + message.argTypes = object.argTypes?.map((e) => Type.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseType_AbstractType(): Type_AbstractType { + return { name: "", parameterTypes: [] }; +} + +export const Type_AbstractType: MessageFns = { + encode(message: Type_AbstractType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.parameterTypes) { + Type.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Type_AbstractType { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseType_AbstractType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.parameterTypes.push(Type.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Type_AbstractType { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + parameterTypes: globalThis.Array.isArray(object?.parameterTypes) + ? object.parameterTypes.map((e: any) => Type.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Type_AbstractType): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.parameterTypes?.length) { + obj.parameterTypes = message.parameterTypes.map((e) => Type.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Type_AbstractType { + return Type_AbstractType.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Type_AbstractType { + const message = createBaseType_AbstractType(); + message.name = object.name ?? ""; + message.parameterTypes = object.parameterTypes?.map((e) => Type.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDecl(): Decl { + return { name: "", declKind: undefined }; +} + +export const Decl: MessageFns = { + encode(message: Decl, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + switch (message.declKind?.$case) { + case "ident": + Decl_IdentDecl.encode(message.declKind.ident, writer.uint32(18).fork()).join(); + break; + case "function": + Decl_FunctionDecl.encode(message.declKind.function, writer.uint32(26).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Decl { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecl(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.declKind = { $case: "ident", ident: Decl_IdentDecl.decode(reader, reader.uint32()) }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.declKind = { $case: "function", function: Decl_FunctionDecl.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Decl { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + declKind: isSet(object.ident) + ? { $case: "ident", ident: Decl_IdentDecl.fromJSON(object.ident) } + : isSet(object.function) + ? { $case: "function", function: Decl_FunctionDecl.fromJSON(object.function) } + : undefined, + }; + }, + + toJSON(message: Decl): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.declKind?.$case === "ident") { + obj.ident = Decl_IdentDecl.toJSON(message.declKind.ident); + } else if (message.declKind?.$case === "function") { + obj.function = Decl_FunctionDecl.toJSON(message.declKind.function); + } + return obj; + }, + + create(base?: DeepPartial): Decl { + return Decl.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Decl { + const message = createBaseDecl(); + message.name = object.name ?? ""; + switch (object.declKind?.$case) { + case "ident": { + if (object.declKind?.ident !== undefined && object.declKind?.ident !== null) { + message.declKind = { $case: "ident", ident: Decl_IdentDecl.fromPartial(object.declKind.ident) }; + } + break; + } + case "function": { + if (object.declKind?.function !== undefined && object.declKind?.function !== null) { + message.declKind = { $case: "function", function: Decl_FunctionDecl.fromPartial(object.declKind.function) }; + } + break; + } + } + return message; + }, +}; + +function createBaseDecl_IdentDecl(): Decl_IdentDecl { + return { type: undefined, value: undefined, doc: "" }; +} + +export const Decl_IdentDecl: MessageFns = { + encode(message: Decl_IdentDecl, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== undefined) { + Type.encode(message.type, writer.uint32(10).fork()).join(); + } + if (message.value !== undefined) { + Constant.encode(message.value, writer.uint32(18).fork()).join(); + } + if (message.doc !== "") { + writer.uint32(26).string(message.doc); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Decl_IdentDecl { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecl_IdentDecl(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.type = Type.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Constant.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.doc = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Decl_IdentDecl { + return { + type: isSet(object.type) ? Type.fromJSON(object.type) : undefined, + value: isSet(object.value) ? Constant.fromJSON(object.value) : undefined, + doc: isSet(object.doc) ? globalThis.String(object.doc) : "", + }; + }, + + toJSON(message: Decl_IdentDecl): unknown { + const obj: any = {}; + if (message.type !== undefined) { + obj.type = Type.toJSON(message.type); + } + if (message.value !== undefined) { + obj.value = Constant.toJSON(message.value); + } + if (message.doc !== "") { + obj.doc = message.doc; + } + return obj; + }, + + create(base?: DeepPartial): Decl_IdentDecl { + return Decl_IdentDecl.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Decl_IdentDecl { + const message = createBaseDecl_IdentDecl(); + message.type = (object.type !== undefined && object.type !== null) ? Type.fromPartial(object.type) : undefined; + message.value = (object.value !== undefined && object.value !== null) + ? Constant.fromPartial(object.value) + : undefined; + message.doc = object.doc ?? ""; + return message; + }, +}; + +function createBaseDecl_FunctionDecl(): Decl_FunctionDecl { + return { overloads: [] }; +} + +export const Decl_FunctionDecl: MessageFns = { + encode(message: Decl_FunctionDecl, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.overloads) { + Decl_FunctionDecl_Overload.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Decl_FunctionDecl { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecl_FunctionDecl(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.overloads.push(Decl_FunctionDecl_Overload.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Decl_FunctionDecl { + return { + overloads: globalThis.Array.isArray(object?.overloads) + ? object.overloads.map((e: any) => Decl_FunctionDecl_Overload.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Decl_FunctionDecl): unknown { + const obj: any = {}; + if (message.overloads?.length) { + obj.overloads = message.overloads.map((e) => Decl_FunctionDecl_Overload.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Decl_FunctionDecl { + return Decl_FunctionDecl.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Decl_FunctionDecl { + const message = createBaseDecl_FunctionDecl(); + message.overloads = object.overloads?.map((e) => Decl_FunctionDecl_Overload.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDecl_FunctionDecl_Overload(): Decl_FunctionDecl_Overload { + return { overloadId: "", params: [], typeParams: [], resultType: undefined, isInstanceFunction: false, doc: "" }; +} + +export const Decl_FunctionDecl_Overload: MessageFns = { + encode(message: Decl_FunctionDecl_Overload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.overloadId !== "") { + writer.uint32(10).string(message.overloadId); + } + for (const v of message.params) { + Type.encode(v!, writer.uint32(18).fork()).join(); + } + for (const v of message.typeParams) { + writer.uint32(26).string(v!); + } + if (message.resultType !== undefined) { + Type.encode(message.resultType, writer.uint32(34).fork()).join(); + } + if (message.isInstanceFunction !== false) { + writer.uint32(40).bool(message.isInstanceFunction); + } + if (message.doc !== "") { + writer.uint32(50).string(message.doc); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Decl_FunctionDecl_Overload { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDecl_FunctionDecl_Overload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.overloadId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.params.push(Type.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.typeParams.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.resultType = Type.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.isInstanceFunction = reader.bool(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.doc = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Decl_FunctionDecl_Overload { + return { + overloadId: isSet(object.overloadId) ? globalThis.String(object.overloadId) : "", + params: globalThis.Array.isArray(object?.params) ? object.params.map((e: any) => Type.fromJSON(e)) : [], + typeParams: globalThis.Array.isArray(object?.typeParams) + ? object.typeParams.map((e: any) => globalThis.String(e)) + : [], + resultType: isSet(object.resultType) ? Type.fromJSON(object.resultType) : undefined, + isInstanceFunction: isSet(object.isInstanceFunction) ? globalThis.Boolean(object.isInstanceFunction) : false, + doc: isSet(object.doc) ? globalThis.String(object.doc) : "", + }; + }, + + toJSON(message: Decl_FunctionDecl_Overload): unknown { + const obj: any = {}; + if (message.overloadId !== "") { + obj.overloadId = message.overloadId; + } + if (message.params?.length) { + obj.params = message.params.map((e) => Type.toJSON(e)); + } + if (message.typeParams?.length) { + obj.typeParams = message.typeParams; + } + if (message.resultType !== undefined) { + obj.resultType = Type.toJSON(message.resultType); + } + if (message.isInstanceFunction !== false) { + obj.isInstanceFunction = message.isInstanceFunction; + } + if (message.doc !== "") { + obj.doc = message.doc; + } + return obj; + }, + + create(base?: DeepPartial): Decl_FunctionDecl_Overload { + return Decl_FunctionDecl_Overload.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Decl_FunctionDecl_Overload { + const message = createBaseDecl_FunctionDecl_Overload(); + message.overloadId = object.overloadId ?? ""; + message.params = object.params?.map((e) => Type.fromPartial(e)) || []; + message.typeParams = object.typeParams?.map((e) => e) || []; + message.resultType = (object.resultType !== undefined && object.resultType !== null) + ? Type.fromPartial(object.resultType) + : undefined; + message.isInstanceFunction = object.isInstanceFunction ?? false; + message.doc = object.doc ?? ""; + return message; + }, +}; + +function createBaseReference(): Reference { + return { name: "", overloadId: [], value: undefined }; +} + +export const Reference: MessageFns = { + encode(message: Reference, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.overloadId) { + writer.uint32(26).string(v!); + } + if (message.value !== undefined) { + Constant.encode(message.value, writer.uint32(34).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Reference { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReference(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.overloadId.push(reader.string()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.value = Constant.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Reference { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + overloadId: globalThis.Array.isArray(object?.overloadId) + ? object.overloadId.map((e: any) => globalThis.String(e)) + : [], + value: isSet(object.value) ? Constant.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Reference): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.overloadId?.length) { + obj.overloadId = message.overloadId; + } + if (message.value !== undefined) { + obj.value = Constant.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): Reference { + return Reference.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Reference { + const message = createBaseReference(); + message.name = object.name ?? ""; + message.overloadId = object.overloadId?.map((e) => e) || []; + message.value = (object.value !== undefined && object.value !== null) + ? Constant.fromPartial(object.value) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(int64: { toString(): string }): number { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/api/expr/v1alpha1/syntax.ts b/src/grpc/generated/google/api/expr/v1alpha1/syntax.ts new file mode 100644 index 0000000..7a86b49 --- /dev/null +++ b/src/grpc/generated/google/api/expr/v1alpha1/syntax.ts @@ -0,0 +1,2539 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/api/expr/v1alpha1/syntax.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; +import { Duration } from "../../../protobuf/duration"; +import { NullValue, nullValueFromJSON, nullValueToJSON } from "../../../protobuf/struct"; +import { Timestamp } from "../../../protobuf/timestamp"; + +export const protobufPackage = "google.api.expr.v1alpha1"; + +/** An expression together with source information as returned by the parser. */ +export interface ParsedExpr { + /** The parsed expression. */ + expr: + | Expr + | undefined; + /** The source info derived from input that generated the parsed `expr`. */ + sourceInfo: SourceInfo | undefined; +} + +/** + * An abstract representation of a common expression. + * + * Expressions are abstractly represented as a collection of identifiers, + * select statements, function calls, literals, and comprehensions. All + * operators with the exception of the '.' operator are modelled as function + * calls. This makes it easy to represent new operators into the existing AST. + * + * All references within expressions must resolve to a + * [Decl][google.api.expr.v1alpha1.Decl] provided at type-check for an + * expression to be valid. A reference may either be a bare identifier `name` or + * a qualified identifier `google.api.name`. References may either refer to a + * value or a function declaration. + * + * For example, the expression `google.api.name.startsWith('expr')` references + * the declaration `google.api.name` within a + * [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and the + * function declaration `startsWith`. + */ +export interface Expr { + /** + * Required. An id assigned to this node by the parser which is unique in a + * given expression tree. This is used to associate type information and other + * attributes to a node in the parse tree. + */ + id: Long; + /** Required. Variants of expressions. */ + exprKind?: + | // + /** A literal expression. */ + { $case: "constExpr"; constExpr: Constant } + | // + /** An identifier expression. */ + { $case: "identExpr"; identExpr: Expr_Ident } + | // + /** A field selection expression, e.g. `request.auth`. */ + { $case: "selectExpr"; selectExpr: Expr_Select } + | // + /** A call expression, including calls to predefined functions and operators. */ + { $case: "callExpr"; callExpr: Expr_Call } + | // + /** A list creation expression. */ + { $case: "listExpr"; listExpr: Expr_CreateList } + | // + /** A map or message creation expression. */ + { $case: "structExpr"; structExpr: Expr_CreateStruct } + | // + /** A comprehension expression. */ + { $case: "comprehensionExpr"; comprehensionExpr: Expr_Comprehension } + | undefined; +} + +/** An identifier expression. e.g. `request`. */ +export interface Expr_Ident { + /** + * Required. Holds a single, unqualified identifier, possibly preceded by a + * '.'. + * + * Qualified names are represented by the + * [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression. + */ + name: string; +} + +/** A field selection expression. e.g. `request.auth`. */ +export interface Expr_Select { + /** + * Required. The target of the selection expression. + * + * For example, in the select expression `request.auth`, the `request` + * portion of the expression is the `operand`. + */ + operand: + | Expr + | undefined; + /** + * Required. The name of the field to select. + * + * For example, in the select expression `request.auth`, the `auth` portion + * of the expression would be the `field`. + */ + field: string; + /** + * Whether the select is to be interpreted as a field presence test. + * + * This results from the macro `has(request.auth)`. + */ + testOnly: boolean; +} + +/** + * A call expression, including calls to predefined functions and operators. + * + * For example, `value == 10`, `size(map_value)`. + */ +export interface Expr_Call { + /** + * The target of an method call-style expression. For example, `x` in + * `x.f()`. + */ + target: + | Expr + | undefined; + /** Required. The name of the function or method being called. */ + function: string; + /** The arguments. */ + args: Expr[]; +} + +/** + * A list creation expression. + * + * Lists may either be homogenous, e.g. `[1, 2, 3]`, or heterogeneous, e.g. + * `dyn([1, 'hello', 2.0])` + */ +export interface Expr_CreateList { + /** The elements part of the list. */ + elements: Expr[]; + /** + * The indices within the elements list which are marked as optional + * elements. + * + * When an optional-typed value is present, the value it contains + * is included in the list. If the optional-typed value is absent, the list + * element is omitted from the CreateList result. + */ + optionalIndices: number[]; +} + +/** + * A map or message creation expression. + * + * Maps are constructed as `{'key_name': 'value'}`. Message construction is + * similar, but prefixed with a type name and composed of field ids: + * `types.MyType{field_id: 'value'}`. + */ +export interface Expr_CreateStruct { + /** + * The type name of the message to be created, empty when creating map + * literals. + */ + messageName: string; + /** The entries in the creation expression. */ + entries: Expr_CreateStruct_Entry[]; +} + +/** Represents an entry. */ +export interface Expr_CreateStruct_Entry { + /** + * Required. An id assigned to this node by the parser which is unique + * in a given expression tree. This is used to associate type + * information and other attributes to the node. + */ + id: Long; + /** The `Entry` key kinds. */ + keyKind?: + | // + /** The field key for a message creator statement. */ + { $case: "fieldKey"; fieldKey: string } + | // + /** The key expression for a map creation statement. */ + { $case: "mapKey"; mapKey: Expr } + | undefined; + /** + * Required. The value assigned to the key. + * + * If the optional_entry field is true, the expression must resolve to an + * optional-typed value. If the optional value is present, the key will be + * set; however, if the optional value is absent, the key will be unset. + */ + value: + | Expr + | undefined; + /** Whether the key-value pair is optional. */ + optionalEntry: boolean; +} + +/** + * A comprehension expression applied to a list or map. + * + * Comprehensions are not part of the core syntax, but enabled with macros. + * A macro matches a specific call signature within a parsed AST and replaces + * the call with an alternate AST block. Macro expansion happens at parse + * time. + * + * The following macros are supported within CEL: + * + * Aggregate type macros may be applied to all elements in a list or all keys + * in a map: + * + * * `all`, `exists`, `exists_one` - test a predicate expression against + * the inputs and return `true` if the predicate is satisfied for all, + * any, or only one value `list.all(x, x < 10)`. + * * `filter` - test a predicate expression against the inputs and return + * the subset of elements which satisfy the predicate: + * `payments.filter(p, p > 1000)`. + * * `map` - apply an expression to all elements in the input and return the + * output aggregate type: `[1, 2, 3].map(i, i * i)`. + * + * The `has(m.x)` macro tests whether the property `x` is present in struct + * `m`. The semantics of this macro depend on the type of `m`. For proto2 + * messages `has(m.x)` is defined as 'defined, but not set`. For proto3, the + * macro tests whether the property is set to its default. For map and struct + * types, the macro tests whether the property `x` is defined on `m`. + * + * Comprehensions for the standard environment macros evaluation can be best + * visualized as the following pseudocode: + * + * ``` + * let `accu_var` = `accu_init` + * for (let `iter_var` in `iter_range`) { + * if (!`loop_condition`) { + * break + * } + * `accu_var` = `loop_step` + * } + * return `result` + * ``` + * + * Comprehensions for the optional V2 macros which support map-to-map + * translation differ slightly from the standard environment macros in that + * they expose both the key or index in addition to the value for each list + * or map entry: + * + * ``` + * let `accu_var` = `accu_init` + * for (let `iter_var`, `iter_var2` in `iter_range`) { + * if (!`loop_condition`) { + * break + * } + * `accu_var` = `loop_step` + * } + * return `result` + * ``` + */ +export interface Expr_Comprehension { + /** + * The name of the first iteration variable. + * When the iter_range is a list, this variable is the list element. + * When the iter_range is a map, this variable is the map entry key. + */ + iterVar: string; + /** + * The name of the second iteration variable, empty if not set. + * When the iter_range is a list, this variable is the integer index. + * When the iter_range is a map, this variable is the map entry value. + * This field is only set for comprehension v2 macros. + */ + iterVar2: string; + /** The range over which the comprehension iterates. */ + iterRange: + | Expr + | undefined; + /** The name of the variable used for accumulation of the result. */ + accuVar: string; + /** The initial value of the accumulator. */ + accuInit: + | Expr + | undefined; + /** + * An expression which can contain iter_var, iter_var2, and accu_var. + * + * Returns false when the result has been computed and may be used as + * a hint to short-circuit the remainder of the comprehension. + */ + loopCondition: + | Expr + | undefined; + /** + * An expression which can contain iter_var, iter_var2, and accu_var. + * + * Computes the next value of accu_var. + */ + loopStep: + | Expr + | undefined; + /** + * An expression which can contain accu_var. + * + * Computes the result. + */ + result: Expr | undefined; +} + +/** + * Represents a primitive literal. + * + * Named 'Constant' here for backwards compatibility. + * + * This is similar as the primitives supported in the well-known type + * `google.protobuf.Value`, but richer so it can represent CEL's full range of + * primitives. + * + * Lists and structs are not included as constants as these aggregate types may + * contain [Expr][google.api.expr.v1alpha1.Expr] elements which require + * evaluation and are thus not constant. + * + * Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, + * `true`, `null`. + */ +export interface Constant { + /** Required. The valid constant kinds. */ + constantKind?: + | // + /** null value. */ + { $case: "nullValue"; nullValue: NullValue } + | // + /** boolean value. */ + { $case: "boolValue"; boolValue: boolean } + | // + /** int64 value. */ + { $case: "int64Value"; int64Value: Long } + | // + /** uint64 value. */ + { $case: "uint64Value"; uint64Value: Long } + | // + /** double value. */ + { $case: "doubleValue"; doubleValue: number } + | // + /** string value. */ + { $case: "stringValue"; stringValue: string } + | // + /** bytes value. */ + { $case: "bytesValue"; bytesValue: Buffer } + | // + /** + * protobuf.Duration value. + * + * Deprecated: duration is no longer considered a builtin cel type. + */ + { $case: "durationValue"; durationValue: Duration } + | // + /** + * protobuf.Timestamp value. + * + * Deprecated: timestamp is no longer considered a builtin cel type. + */ + { $case: "timestampValue"; timestampValue: Date } + | undefined; +} + +/** Source information collected at parse time. */ +export interface SourceInfo { + /** The syntax version of the source, e.g. `cel1`. */ + syntaxVersion: string; + /** + * The location name. All position information attached to an expression is + * relative to this location. + * + * The location could be a file, UI element, or similar. For example, + * `acme/app/AnvilPolicy.cel`. + */ + location: string; + /** + * Monotonically increasing list of code point offsets where newlines + * `\n` appear. + * + * The line number of a given position is the index `i` where for a given + * `id` the `line_offsets[i] < id_positions[id] < line_offsets[i+1]`. The + * column may be derivd from `id_positions[id] - line_offsets[i]`. + */ + lineOffsets: number[]; + /** + * A map from the parse node id (e.g. `Expr.id`) to the code point offset + * within the source. + */ + positions: Map; + /** + * A map from the parse node id where a macro replacement was made to the + * call `Expr` that resulted in a macro expansion. + * + * For example, `has(value.field)` is a function call that is replaced by a + * `test_only` field selection in the AST. Likewise, the call + * `list.exists(e, e > 10)` translates to a comprehension expression. The key + * in the map corresponds to the expression id of the expanded macro, and the + * value is the call `Expr` that was replaced. + */ + macroCalls: Map; + /** + * A list of tags for extensions that were used while parsing or type checking + * the source expression. For example, optimizations that require special + * runtime support may be specified. + * + * These are used to check feature support between components in separate + * implementations. This can be used to either skip redundant work or + * report an error if the extension is unsupported. + */ + extensions: SourceInfo_Extension[]; +} + +/** An extension that was requested for the source expression. */ +export interface SourceInfo_Extension { + /** Identifier for the extension. Example: constant_folding */ + id: string; + /** + * If set, the listed components must understand the extension for the + * expression to evaluate correctly. + * + * This field has set semantics, repeated values should be deduplicated. + */ + affectedComponents: SourceInfo_Extension_Component[]; + /** + * Version info. May be skipped if it isn't meaningful for the extension. + * (for example constant_folding might always be v0.0). + */ + version: SourceInfo_Extension_Version | undefined; +} + +/** CEL component specifier. */ +export enum SourceInfo_Extension_Component { + /** COMPONENT_UNSPECIFIED - Unspecified, default. */ + COMPONENT_UNSPECIFIED = 0, + /** COMPONENT_PARSER - Parser. Converts a CEL string to an AST. */ + COMPONENT_PARSER = 1, + /** + * COMPONENT_TYPE_CHECKER - Type checker. Checks that references in an AST are defined and types + * agree. + */ + COMPONENT_TYPE_CHECKER = 2, + /** + * COMPONENT_RUNTIME - Runtime. Evaluates a parsed and optionally checked CEL AST against a + * context. + */ + COMPONENT_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function sourceInfo_Extension_ComponentFromJSON(object: any): SourceInfo_Extension_Component { + switch (object) { + case 0: + case "COMPONENT_UNSPECIFIED": + return SourceInfo_Extension_Component.COMPONENT_UNSPECIFIED; + case 1: + case "COMPONENT_PARSER": + return SourceInfo_Extension_Component.COMPONENT_PARSER; + case 2: + case "COMPONENT_TYPE_CHECKER": + return SourceInfo_Extension_Component.COMPONENT_TYPE_CHECKER; + case 3: + case "COMPONENT_RUNTIME": + return SourceInfo_Extension_Component.COMPONENT_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return SourceInfo_Extension_Component.UNRECOGNIZED; + } +} + +export function sourceInfo_Extension_ComponentToJSON(object: SourceInfo_Extension_Component): string { + switch (object) { + case SourceInfo_Extension_Component.COMPONENT_UNSPECIFIED: + return "COMPONENT_UNSPECIFIED"; + case SourceInfo_Extension_Component.COMPONENT_PARSER: + return "COMPONENT_PARSER"; + case SourceInfo_Extension_Component.COMPONENT_TYPE_CHECKER: + return "COMPONENT_TYPE_CHECKER"; + case SourceInfo_Extension_Component.COMPONENT_RUNTIME: + return "COMPONENT_RUNTIME"; + case SourceInfo_Extension_Component.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Version */ +export interface SourceInfo_Extension_Version { + /** + * Major version changes indicate different required support level from + * the required components. + */ + major: Long; + /** + * Minor version changes must not change the observed behavior from + * existing implementations, but may be provided informationally. + */ + minor: Long; +} + +export interface SourceInfo_PositionsEntry { + key: Long; + value: number; +} + +export interface SourceInfo_MacroCallsEntry { + key: Long; + value: Expr | undefined; +} + +/** A specific position in source. */ +export interface SourcePosition { + /** The soucre location name (e.g. file name). */ + location: string; + /** The UTF-8 code unit offset. */ + offset: number; + /** + * The 1-based index of the starting line in the source text + * where the issue occurs, or 0 if unknown. + */ + line: number; + /** + * The 0-based index of the starting position within the line of source text + * where the issue occurs. Only meaningful if line is nonzero. + */ + column: number; +} + +function createBaseParsedExpr(): ParsedExpr { + return { expr: undefined, sourceInfo: undefined }; +} + +export const ParsedExpr: MessageFns = { + encode(message: ParsedExpr, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.expr !== undefined) { + Expr.encode(message.expr, writer.uint32(18).fork()).join(); + } + if (message.sourceInfo !== undefined) { + SourceInfo.encode(message.sourceInfo, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ParsedExpr { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParsedExpr(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + + message.expr = Expr.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.sourceInfo = SourceInfo.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ParsedExpr { + return { + expr: isSet(object.expr) ? Expr.fromJSON(object.expr) : undefined, + sourceInfo: isSet(object.sourceInfo) ? SourceInfo.fromJSON(object.sourceInfo) : undefined, + }; + }, + + toJSON(message: ParsedExpr): unknown { + const obj: any = {}; + if (message.expr !== undefined) { + obj.expr = Expr.toJSON(message.expr); + } + if (message.sourceInfo !== undefined) { + obj.sourceInfo = SourceInfo.toJSON(message.sourceInfo); + } + return obj; + }, + + create(base?: DeepPartial): ParsedExpr { + return ParsedExpr.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ParsedExpr { + const message = createBaseParsedExpr(); + message.expr = (object.expr !== undefined && object.expr !== null) ? Expr.fromPartial(object.expr) : undefined; + message.sourceInfo = (object.sourceInfo !== undefined && object.sourceInfo !== null) + ? SourceInfo.fromPartial(object.sourceInfo) + : undefined; + return message; + }, +}; + +function createBaseExpr(): Expr { + return { id: Long.ZERO, exprKind: undefined }; +} + +export const Expr: MessageFns = { + encode(message: Expr, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.id.equals(Long.ZERO)) { + writer.uint32(16).int64(message.id.toString()); + } + switch (message.exprKind?.$case) { + case "constExpr": + Constant.encode(message.exprKind.constExpr, writer.uint32(26).fork()).join(); + break; + case "identExpr": + Expr_Ident.encode(message.exprKind.identExpr, writer.uint32(34).fork()).join(); + break; + case "selectExpr": + Expr_Select.encode(message.exprKind.selectExpr, writer.uint32(42).fork()).join(); + break; + case "callExpr": + Expr_Call.encode(message.exprKind.callExpr, writer.uint32(50).fork()).join(); + break; + case "listExpr": + Expr_CreateList.encode(message.exprKind.listExpr, writer.uint32(58).fork()).join(); + break; + case "structExpr": + Expr_CreateStruct.encode(message.exprKind.structExpr, writer.uint32(66).fork()).join(); + break; + case "comprehensionExpr": + Expr_Comprehension.encode(message.exprKind.comprehensionExpr, writer.uint32(74).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 16) { + break; + } + + message.id = Long.fromString(reader.int64().toString()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.exprKind = { $case: "constExpr", constExpr: Constant.decode(reader, reader.uint32()) }; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.exprKind = { $case: "identExpr", identExpr: Expr_Ident.decode(reader, reader.uint32()) }; + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.exprKind = { $case: "selectExpr", selectExpr: Expr_Select.decode(reader, reader.uint32()) }; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.exprKind = { $case: "callExpr", callExpr: Expr_Call.decode(reader, reader.uint32()) }; + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.exprKind = { $case: "listExpr", listExpr: Expr_CreateList.decode(reader, reader.uint32()) }; + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.exprKind = { $case: "structExpr", structExpr: Expr_CreateStruct.decode(reader, reader.uint32()) }; + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.exprKind = { + $case: "comprehensionExpr", + comprehensionExpr: Expr_Comprehension.decode(reader, reader.uint32()), + }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr { + return { + id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO, + exprKind: isSet(object.constExpr) + ? { $case: "constExpr", constExpr: Constant.fromJSON(object.constExpr) } + : isSet(object.identExpr) + ? { $case: "identExpr", identExpr: Expr_Ident.fromJSON(object.identExpr) } + : isSet(object.selectExpr) + ? { $case: "selectExpr", selectExpr: Expr_Select.fromJSON(object.selectExpr) } + : isSet(object.callExpr) + ? { $case: "callExpr", callExpr: Expr_Call.fromJSON(object.callExpr) } + : isSet(object.listExpr) + ? { $case: "listExpr", listExpr: Expr_CreateList.fromJSON(object.listExpr) } + : isSet(object.structExpr) + ? { $case: "structExpr", structExpr: Expr_CreateStruct.fromJSON(object.structExpr) } + : isSet(object.comprehensionExpr) + ? { $case: "comprehensionExpr", comprehensionExpr: Expr_Comprehension.fromJSON(object.comprehensionExpr) } + : undefined, + }; + }, + + toJSON(message: Expr): unknown { + const obj: any = {}; + if (!message.id.equals(Long.ZERO)) { + obj.id = (message.id || Long.ZERO).toString(); + } + if (message.exprKind?.$case === "constExpr") { + obj.constExpr = Constant.toJSON(message.exprKind.constExpr); + } else if (message.exprKind?.$case === "identExpr") { + obj.identExpr = Expr_Ident.toJSON(message.exprKind.identExpr); + } else if (message.exprKind?.$case === "selectExpr") { + obj.selectExpr = Expr_Select.toJSON(message.exprKind.selectExpr); + } else if (message.exprKind?.$case === "callExpr") { + obj.callExpr = Expr_Call.toJSON(message.exprKind.callExpr); + } else if (message.exprKind?.$case === "listExpr") { + obj.listExpr = Expr_CreateList.toJSON(message.exprKind.listExpr); + } else if (message.exprKind?.$case === "structExpr") { + obj.structExpr = Expr_CreateStruct.toJSON(message.exprKind.structExpr); + } else if (message.exprKind?.$case === "comprehensionExpr") { + obj.comprehensionExpr = Expr_Comprehension.toJSON(message.exprKind.comprehensionExpr); + } + return obj; + }, + + create(base?: DeepPartial): Expr { + return Expr.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr { + const message = createBaseExpr(); + message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.ZERO; + switch (object.exprKind?.$case) { + case "constExpr": { + if (object.exprKind?.constExpr !== undefined && object.exprKind?.constExpr !== null) { + message.exprKind = { $case: "constExpr", constExpr: Constant.fromPartial(object.exprKind.constExpr) }; + } + break; + } + case "identExpr": { + if (object.exprKind?.identExpr !== undefined && object.exprKind?.identExpr !== null) { + message.exprKind = { $case: "identExpr", identExpr: Expr_Ident.fromPartial(object.exprKind.identExpr) }; + } + break; + } + case "selectExpr": { + if (object.exprKind?.selectExpr !== undefined && object.exprKind?.selectExpr !== null) { + message.exprKind = { $case: "selectExpr", selectExpr: Expr_Select.fromPartial(object.exprKind.selectExpr) }; + } + break; + } + case "callExpr": { + if (object.exprKind?.callExpr !== undefined && object.exprKind?.callExpr !== null) { + message.exprKind = { $case: "callExpr", callExpr: Expr_Call.fromPartial(object.exprKind.callExpr) }; + } + break; + } + case "listExpr": { + if (object.exprKind?.listExpr !== undefined && object.exprKind?.listExpr !== null) { + message.exprKind = { $case: "listExpr", listExpr: Expr_CreateList.fromPartial(object.exprKind.listExpr) }; + } + break; + } + case "structExpr": { + if (object.exprKind?.structExpr !== undefined && object.exprKind?.structExpr !== null) { + message.exprKind = { + $case: "structExpr", + structExpr: Expr_CreateStruct.fromPartial(object.exprKind.structExpr), + }; + } + break; + } + case "comprehensionExpr": { + if (object.exprKind?.comprehensionExpr !== undefined && object.exprKind?.comprehensionExpr !== null) { + message.exprKind = { + $case: "comprehensionExpr", + comprehensionExpr: Expr_Comprehension.fromPartial(object.exprKind.comprehensionExpr), + }; + } + break; + } + } + return message; + }, +}; + +function createBaseExpr_Ident(): Expr_Ident { + return { name: "" }; +} + +export const Expr_Ident: MessageFns = { + encode(message: Expr_Ident, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr_Ident { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr_Ident(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr_Ident { + return { name: isSet(object.name) ? globalThis.String(object.name) : "" }; + }, + + toJSON(message: Expr_Ident): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + return obj; + }, + + create(base?: DeepPartial): Expr_Ident { + return Expr_Ident.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr_Ident { + const message = createBaseExpr_Ident(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseExpr_Select(): Expr_Select { + return { operand: undefined, field: "", testOnly: false }; +} + +export const Expr_Select: MessageFns = { + encode(message: Expr_Select, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.operand !== undefined) { + Expr.encode(message.operand, writer.uint32(10).fork()).join(); + } + if (message.field !== "") { + writer.uint32(18).string(message.field); + } + if (message.testOnly !== false) { + writer.uint32(24).bool(message.testOnly); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr_Select { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr_Select(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.operand = Expr.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.field = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.testOnly = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr_Select { + return { + operand: isSet(object.operand) ? Expr.fromJSON(object.operand) : undefined, + field: isSet(object.field) ? globalThis.String(object.field) : "", + testOnly: isSet(object.testOnly) ? globalThis.Boolean(object.testOnly) : false, + }; + }, + + toJSON(message: Expr_Select): unknown { + const obj: any = {}; + if (message.operand !== undefined) { + obj.operand = Expr.toJSON(message.operand); + } + if (message.field !== "") { + obj.field = message.field; + } + if (message.testOnly !== false) { + obj.testOnly = message.testOnly; + } + return obj; + }, + + create(base?: DeepPartial): Expr_Select { + return Expr_Select.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr_Select { + const message = createBaseExpr_Select(); + message.operand = (object.operand !== undefined && object.operand !== null) + ? Expr.fromPartial(object.operand) + : undefined; + message.field = object.field ?? ""; + message.testOnly = object.testOnly ?? false; + return message; + }, +}; + +function createBaseExpr_Call(): Expr_Call { + return { target: undefined, function: "", args: [] }; +} + +export const Expr_Call: MessageFns = { + encode(message: Expr_Call, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.target !== undefined) { + Expr.encode(message.target, writer.uint32(10).fork()).join(); + } + if (message.function !== "") { + writer.uint32(18).string(message.function); + } + for (const v of message.args) { + Expr.encode(v!, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr_Call { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr_Call(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.target = Expr.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.function = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.args.push(Expr.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr_Call { + return { + target: isSet(object.target) ? Expr.fromJSON(object.target) : undefined, + function: isSet(object.function) ? globalThis.String(object.function) : "", + args: globalThis.Array.isArray(object?.args) ? object.args.map((e: any) => Expr.fromJSON(e)) : [], + }; + }, + + toJSON(message: Expr_Call): unknown { + const obj: any = {}; + if (message.target !== undefined) { + obj.target = Expr.toJSON(message.target); + } + if (message.function !== "") { + obj.function = message.function; + } + if (message.args?.length) { + obj.args = message.args.map((e) => Expr.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Expr_Call { + return Expr_Call.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr_Call { + const message = createBaseExpr_Call(); + message.target = (object.target !== undefined && object.target !== null) + ? Expr.fromPartial(object.target) + : undefined; + message.function = object.function ?? ""; + message.args = object.args?.map((e) => Expr.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseExpr_CreateList(): Expr_CreateList { + return { elements: [], optionalIndices: [] }; +} + +export const Expr_CreateList: MessageFns = { + encode(message: Expr_CreateList, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.elements) { + Expr.encode(v!, writer.uint32(10).fork()).join(); + } + writer.uint32(18).fork(); + for (const v of message.optionalIndices) { + writer.int32(v); + } + writer.join(); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr_CreateList { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr_CreateList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.elements.push(Expr.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag === 16) { + message.optionalIndices.push(reader.int32()); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.optionalIndices.push(reader.int32()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr_CreateList { + return { + elements: globalThis.Array.isArray(object?.elements) ? object.elements.map((e: any) => Expr.fromJSON(e)) : [], + optionalIndices: globalThis.Array.isArray(object?.optionalIndices) + ? object.optionalIndices.map((e: any) => globalThis.Number(e)) + : [], + }; + }, + + toJSON(message: Expr_CreateList): unknown { + const obj: any = {}; + if (message.elements?.length) { + obj.elements = message.elements.map((e) => Expr.toJSON(e)); + } + if (message.optionalIndices?.length) { + obj.optionalIndices = message.optionalIndices.map((e) => Math.round(e)); + } + return obj; + }, + + create(base?: DeepPartial): Expr_CreateList { + return Expr_CreateList.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr_CreateList { + const message = createBaseExpr_CreateList(); + message.elements = object.elements?.map((e) => Expr.fromPartial(e)) || []; + message.optionalIndices = object.optionalIndices?.map((e) => e) || []; + return message; + }, +}; + +function createBaseExpr_CreateStruct(): Expr_CreateStruct { + return { messageName: "", entries: [] }; +} + +export const Expr_CreateStruct: MessageFns = { + encode(message: Expr_CreateStruct, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.messageName !== "") { + writer.uint32(10).string(message.messageName); + } + for (const v of message.entries) { + Expr_CreateStruct_Entry.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr_CreateStruct { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr_CreateStruct(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.messageName = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.entries.push(Expr_CreateStruct_Entry.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr_CreateStruct { + return { + messageName: isSet(object.messageName) ? globalThis.String(object.messageName) : "", + entries: globalThis.Array.isArray(object?.entries) + ? object.entries.map((e: any) => Expr_CreateStruct_Entry.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Expr_CreateStruct): unknown { + const obj: any = {}; + if (message.messageName !== "") { + obj.messageName = message.messageName; + } + if (message.entries?.length) { + obj.entries = message.entries.map((e) => Expr_CreateStruct_Entry.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Expr_CreateStruct { + return Expr_CreateStruct.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr_CreateStruct { + const message = createBaseExpr_CreateStruct(); + message.messageName = object.messageName ?? ""; + message.entries = object.entries?.map((e) => Expr_CreateStruct_Entry.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseExpr_CreateStruct_Entry(): Expr_CreateStruct_Entry { + return { id: Long.ZERO, keyKind: undefined, value: undefined, optionalEntry: false }; +} + +export const Expr_CreateStruct_Entry: MessageFns = { + encode(message: Expr_CreateStruct_Entry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.id.equals(Long.ZERO)) { + writer.uint32(8).int64(message.id.toString()); + } + switch (message.keyKind?.$case) { + case "fieldKey": + writer.uint32(18).string(message.keyKind.fieldKey); + break; + case "mapKey": + Expr.encode(message.keyKind.mapKey, writer.uint32(26).fork()).join(); + break; + } + if (message.value !== undefined) { + Expr.encode(message.value, writer.uint32(34).fork()).join(); + } + if (message.optionalEntry !== false) { + writer.uint32(40).bool(message.optionalEntry); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr_CreateStruct_Entry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr_CreateStruct_Entry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.id = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.keyKind = { $case: "fieldKey", fieldKey: reader.string() }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.keyKind = { $case: "mapKey", mapKey: Expr.decode(reader, reader.uint32()) }; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.value = Expr.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.optionalEntry = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr_CreateStruct_Entry { + return { + id: isSet(object.id) ? Long.fromValue(object.id) : Long.ZERO, + keyKind: isSet(object.fieldKey) + ? { $case: "fieldKey", fieldKey: globalThis.String(object.fieldKey) } + : isSet(object.mapKey) + ? { $case: "mapKey", mapKey: Expr.fromJSON(object.mapKey) } + : undefined, + value: isSet(object.value) ? Expr.fromJSON(object.value) : undefined, + optionalEntry: isSet(object.optionalEntry) ? globalThis.Boolean(object.optionalEntry) : false, + }; + }, + + toJSON(message: Expr_CreateStruct_Entry): unknown { + const obj: any = {}; + if (!message.id.equals(Long.ZERO)) { + obj.id = (message.id || Long.ZERO).toString(); + } + if (message.keyKind?.$case === "fieldKey") { + obj.fieldKey = message.keyKind.fieldKey; + } else if (message.keyKind?.$case === "mapKey") { + obj.mapKey = Expr.toJSON(message.keyKind.mapKey); + } + if (message.value !== undefined) { + obj.value = Expr.toJSON(message.value); + } + if (message.optionalEntry !== false) { + obj.optionalEntry = message.optionalEntry; + } + return obj; + }, + + create(base?: DeepPartial): Expr_CreateStruct_Entry { + return Expr_CreateStruct_Entry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr_CreateStruct_Entry { + const message = createBaseExpr_CreateStruct_Entry(); + message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.ZERO; + switch (object.keyKind?.$case) { + case "fieldKey": { + if (object.keyKind?.fieldKey !== undefined && object.keyKind?.fieldKey !== null) { + message.keyKind = { $case: "fieldKey", fieldKey: object.keyKind.fieldKey }; + } + break; + } + case "mapKey": { + if (object.keyKind?.mapKey !== undefined && object.keyKind?.mapKey !== null) { + message.keyKind = { $case: "mapKey", mapKey: Expr.fromPartial(object.keyKind.mapKey) }; + } + break; + } + } + message.value = (object.value !== undefined && object.value !== null) ? Expr.fromPartial(object.value) : undefined; + message.optionalEntry = object.optionalEntry ?? false; + return message; + }, +}; + +function createBaseExpr_Comprehension(): Expr_Comprehension { + return { + iterVar: "", + iterVar2: "", + iterRange: undefined, + accuVar: "", + accuInit: undefined, + loopCondition: undefined, + loopStep: undefined, + result: undefined, + }; +} + +export const Expr_Comprehension: MessageFns = { + encode(message: Expr_Comprehension, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.iterVar !== "") { + writer.uint32(10).string(message.iterVar); + } + if (message.iterVar2 !== "") { + writer.uint32(66).string(message.iterVar2); + } + if (message.iterRange !== undefined) { + Expr.encode(message.iterRange, writer.uint32(18).fork()).join(); + } + if (message.accuVar !== "") { + writer.uint32(26).string(message.accuVar); + } + if (message.accuInit !== undefined) { + Expr.encode(message.accuInit, writer.uint32(34).fork()).join(); + } + if (message.loopCondition !== undefined) { + Expr.encode(message.loopCondition, writer.uint32(42).fork()).join(); + } + if (message.loopStep !== undefined) { + Expr.encode(message.loopStep, writer.uint32(50).fork()).join(); + } + if (message.result !== undefined) { + Expr.encode(message.result, writer.uint32(58).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Expr_Comprehension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExpr_Comprehension(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.iterVar = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.iterVar2 = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.iterRange = Expr.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.accuVar = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.accuInit = Expr.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.loopCondition = Expr.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.loopStep = Expr.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.result = Expr.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Expr_Comprehension { + return { + iterVar: isSet(object.iterVar) ? globalThis.String(object.iterVar) : "", + iterVar2: isSet(object.iterVar2) ? globalThis.String(object.iterVar2) : "", + iterRange: isSet(object.iterRange) ? Expr.fromJSON(object.iterRange) : undefined, + accuVar: isSet(object.accuVar) ? globalThis.String(object.accuVar) : "", + accuInit: isSet(object.accuInit) ? Expr.fromJSON(object.accuInit) : undefined, + loopCondition: isSet(object.loopCondition) ? Expr.fromJSON(object.loopCondition) : undefined, + loopStep: isSet(object.loopStep) ? Expr.fromJSON(object.loopStep) : undefined, + result: isSet(object.result) ? Expr.fromJSON(object.result) : undefined, + }; + }, + + toJSON(message: Expr_Comprehension): unknown { + const obj: any = {}; + if (message.iterVar !== "") { + obj.iterVar = message.iterVar; + } + if (message.iterVar2 !== "") { + obj.iterVar2 = message.iterVar2; + } + if (message.iterRange !== undefined) { + obj.iterRange = Expr.toJSON(message.iterRange); + } + if (message.accuVar !== "") { + obj.accuVar = message.accuVar; + } + if (message.accuInit !== undefined) { + obj.accuInit = Expr.toJSON(message.accuInit); + } + if (message.loopCondition !== undefined) { + obj.loopCondition = Expr.toJSON(message.loopCondition); + } + if (message.loopStep !== undefined) { + obj.loopStep = Expr.toJSON(message.loopStep); + } + if (message.result !== undefined) { + obj.result = Expr.toJSON(message.result); + } + return obj; + }, + + create(base?: DeepPartial): Expr_Comprehension { + return Expr_Comprehension.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Expr_Comprehension { + const message = createBaseExpr_Comprehension(); + message.iterVar = object.iterVar ?? ""; + message.iterVar2 = object.iterVar2 ?? ""; + message.iterRange = (object.iterRange !== undefined && object.iterRange !== null) + ? Expr.fromPartial(object.iterRange) + : undefined; + message.accuVar = object.accuVar ?? ""; + message.accuInit = (object.accuInit !== undefined && object.accuInit !== null) + ? Expr.fromPartial(object.accuInit) + : undefined; + message.loopCondition = (object.loopCondition !== undefined && object.loopCondition !== null) + ? Expr.fromPartial(object.loopCondition) + : undefined; + message.loopStep = (object.loopStep !== undefined && object.loopStep !== null) + ? Expr.fromPartial(object.loopStep) + : undefined; + message.result = (object.result !== undefined && object.result !== null) + ? Expr.fromPartial(object.result) + : undefined; + return message; + }, +}; + +function createBaseConstant(): Constant { + return { constantKind: undefined }; +} + +export const Constant: MessageFns = { + encode(message: Constant, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + switch (message.constantKind?.$case) { + case "nullValue": + writer.uint32(8).int32(message.constantKind.nullValue); + break; + case "boolValue": + writer.uint32(16).bool(message.constantKind.boolValue); + break; + case "int64Value": + writer.uint32(24).int64(message.constantKind.int64Value.toString()); + break; + case "uint64Value": + writer.uint32(32).uint64(message.constantKind.uint64Value.toString()); + break; + case "doubleValue": + writer.uint32(41).double(message.constantKind.doubleValue); + break; + case "stringValue": + writer.uint32(50).string(message.constantKind.stringValue); + break; + case "bytesValue": + writer.uint32(58).bytes(message.constantKind.bytesValue); + break; + case "durationValue": + Duration.encode(message.constantKind.durationValue, writer.uint32(66).fork()).join(); + break; + case "timestampValue": + Timestamp.encode(toTimestamp(message.constantKind.timestampValue), writer.uint32(74).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Constant { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseConstant(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.constantKind = { $case: "nullValue", nullValue: reader.int32() as any }; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.constantKind = { $case: "boolValue", boolValue: reader.bool() }; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.constantKind = { $case: "int64Value", int64Value: Long.fromString(reader.int64().toString()) }; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.constantKind = { + $case: "uint64Value", + uint64Value: Long.fromString(reader.uint64().toString(), true), + }; + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.constantKind = { $case: "doubleValue", doubleValue: reader.double() }; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.constantKind = { $case: "stringValue", stringValue: reader.string() }; + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.constantKind = { $case: "bytesValue", bytesValue: Buffer.from(reader.bytes()) }; + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.constantKind = { $case: "durationValue", durationValue: Duration.decode(reader, reader.uint32()) }; + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.constantKind = { + $case: "timestampValue", + timestampValue: fromTimestamp(Timestamp.decode(reader, reader.uint32())), + }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Constant { + return { + constantKind: isSet(object.nullValue) + ? { $case: "nullValue", nullValue: nullValueFromJSON(object.nullValue) } + : isSet(object.boolValue) + ? { $case: "boolValue", boolValue: globalThis.Boolean(object.boolValue) } + : isSet(object.int64Value) + ? { $case: "int64Value", int64Value: Long.fromValue(object.int64Value) } + : isSet(object.uint64Value) + ? { $case: "uint64Value", uint64Value: Long.fromValue(object.uint64Value) } + : isSet(object.doubleValue) + ? { $case: "doubleValue", doubleValue: globalThis.Number(object.doubleValue) } + : isSet(object.stringValue) + ? { $case: "stringValue", stringValue: globalThis.String(object.stringValue) } + : isSet(object.bytesValue) + ? { $case: "bytesValue", bytesValue: Buffer.from(bytesFromBase64(object.bytesValue)) } + : isSet(object.durationValue) + ? { $case: "durationValue", durationValue: Duration.fromJSON(object.durationValue) } + : isSet(object.timestampValue) + ? { $case: "timestampValue", timestampValue: fromJsonTimestamp(object.timestampValue) } + : undefined, + }; + }, + + toJSON(message: Constant): unknown { + const obj: any = {}; + if (message.constantKind?.$case === "nullValue") { + obj.nullValue = nullValueToJSON(message.constantKind.nullValue); + } else if (message.constantKind?.$case === "boolValue") { + obj.boolValue = message.constantKind.boolValue; + } else if (message.constantKind?.$case === "int64Value") { + obj.int64Value = (message.constantKind.int64Value || Long.ZERO).toString(); + } else if (message.constantKind?.$case === "uint64Value") { + obj.uint64Value = (message.constantKind.uint64Value || Long.UZERO).toString(); + } else if (message.constantKind?.$case === "doubleValue") { + obj.doubleValue = message.constantKind.doubleValue; + } else if (message.constantKind?.$case === "stringValue") { + obj.stringValue = message.constantKind.stringValue; + } else if (message.constantKind?.$case === "bytesValue") { + obj.bytesValue = base64FromBytes(message.constantKind.bytesValue); + } else if (message.constantKind?.$case === "durationValue") { + obj.durationValue = Duration.toJSON(message.constantKind.durationValue); + } else if (message.constantKind?.$case === "timestampValue") { + obj.timestampValue = message.constantKind.timestampValue.toISOString(); + } + return obj; + }, + + create(base?: DeepPartial): Constant { + return Constant.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Constant { + const message = createBaseConstant(); + switch (object.constantKind?.$case) { + case "nullValue": { + if (object.constantKind?.nullValue !== undefined && object.constantKind?.nullValue !== null) { + message.constantKind = { $case: "nullValue", nullValue: object.constantKind.nullValue }; + } + break; + } + case "boolValue": { + if (object.constantKind?.boolValue !== undefined && object.constantKind?.boolValue !== null) { + message.constantKind = { $case: "boolValue", boolValue: object.constantKind.boolValue }; + } + break; + } + case "int64Value": { + if (object.constantKind?.int64Value !== undefined && object.constantKind?.int64Value !== null) { + message.constantKind = { $case: "int64Value", int64Value: Long.fromValue(object.constantKind.int64Value) }; + } + break; + } + case "uint64Value": { + if (object.constantKind?.uint64Value !== undefined && object.constantKind?.uint64Value !== null) { + message.constantKind = { $case: "uint64Value", uint64Value: Long.fromValue(object.constantKind.uint64Value) }; + } + break; + } + case "doubleValue": { + if (object.constantKind?.doubleValue !== undefined && object.constantKind?.doubleValue !== null) { + message.constantKind = { $case: "doubleValue", doubleValue: object.constantKind.doubleValue }; + } + break; + } + case "stringValue": { + if (object.constantKind?.stringValue !== undefined && object.constantKind?.stringValue !== null) { + message.constantKind = { $case: "stringValue", stringValue: object.constantKind.stringValue }; + } + break; + } + case "bytesValue": { + if (object.constantKind?.bytesValue !== undefined && object.constantKind?.bytesValue !== null) { + message.constantKind = { $case: "bytesValue", bytesValue: object.constantKind.bytesValue }; + } + break; + } + case "durationValue": { + if (object.constantKind?.durationValue !== undefined && object.constantKind?.durationValue !== null) { + message.constantKind = { + $case: "durationValue", + durationValue: Duration.fromPartial(object.constantKind.durationValue), + }; + } + break; + } + case "timestampValue": { + if (object.constantKind?.timestampValue !== undefined && object.constantKind?.timestampValue !== null) { + message.constantKind = { $case: "timestampValue", timestampValue: object.constantKind.timestampValue }; + } + break; + } + } + return message; + }, +}; + +function createBaseSourceInfo(): SourceInfo { + return { + syntaxVersion: "", + location: "", + lineOffsets: [], + positions: new Map(), + macroCalls: new Map(), + extensions: [], + }; +} + +export const SourceInfo: MessageFns = { + encode(message: SourceInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.syntaxVersion !== "") { + writer.uint32(10).string(message.syntaxVersion); + } + if (message.location !== "") { + writer.uint32(18).string(message.location); + } + writer.uint32(26).fork(); + for (const v of message.lineOffsets) { + writer.int32(v); + } + writer.join(); + message.positions.forEach((value, key) => { + SourceInfo_PositionsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + }); + message.macroCalls.forEach((value, key) => { + SourceInfo_MacroCallsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join(); + }); + for (const v of message.extensions) { + SourceInfo_Extension.encode(v!, writer.uint32(50).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.syntaxVersion = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.location = reader.string(); + continue; + } + case 3: { + if (tag === 24) { + message.lineOffsets.push(reader.int32()); + + continue; + } + + if (tag === 26) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.lineOffsets.push(reader.int32()); + } + + continue; + } + + break; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = SourceInfo_PositionsEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.positions.set(entry4.key, entry4.value); + } + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + const entry5 = SourceInfo_MacroCallsEntry.decode(reader, reader.uint32()); + if (entry5.value !== undefined) { + message.macroCalls.set(entry5.key, entry5.value); + } + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.extensions.push(SourceInfo_Extension.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceInfo { + return { + syntaxVersion: isSet(object.syntaxVersion) ? globalThis.String(object.syntaxVersion) : "", + location: isSet(object.location) ? globalThis.String(object.location) : "", + lineOffsets: globalThis.Array.isArray(object?.lineOffsets) + ? object.lineOffsets.map((e: any) => globalThis.Number(e)) + : [], + positions: isObject(object.positions) + ? Object.entries(object.positions).reduce>((acc, [key, value]) => { + acc.set(Long.fromValue(key), Number(value)); + return acc; + }, new Map()) + : new Map(), + macroCalls: isObject(object.macroCalls) + ? Object.entries(object.macroCalls).reduce>((acc, [key, value]) => { + acc.set(Long.fromValue(key), Expr.fromJSON(value)); + return acc; + }, new Map()) + : new Map(), + extensions: globalThis.Array.isArray(object?.extensions) + ? object.extensions.map((e: any) => SourceInfo_Extension.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SourceInfo): unknown { + const obj: any = {}; + if (message.syntaxVersion !== "") { + obj.syntaxVersion = message.syntaxVersion; + } + if (message.location !== "") { + obj.location = message.location; + } + if (message.lineOffsets?.length) { + obj.lineOffsets = message.lineOffsets.map((e) => Math.round(e)); + } + if (message.positions?.size) { + obj.positions = {}; + message.positions.forEach((v, k) => { + obj.positions[longToNumber(k)] = Math.round(v); + }); + } + if (message.macroCalls?.size) { + obj.macroCalls = {}; + message.macroCalls.forEach((v, k) => { + obj.macroCalls[longToNumber(k)] = Expr.toJSON(v); + }); + } + if (message.extensions?.length) { + obj.extensions = message.extensions.map((e) => SourceInfo_Extension.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): SourceInfo { + return SourceInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourceInfo { + const message = createBaseSourceInfo(); + message.syntaxVersion = object.syntaxVersion ?? ""; + message.location = object.location ?? ""; + message.lineOffsets = object.lineOffsets?.map((e) => e) || []; + message.positions = (() => { + const m = new Map(); + (object.positions as Map ?? new Map()).forEach((value, key) => { + if (value !== undefined) { + m.set(key, globalThis.Number(value)); + } + }); + return m; + })(); + message.macroCalls = (() => { + const m = new Map(); + (object.macroCalls as Map ?? new Map()).forEach((value, key) => { + if (value !== undefined) { + m.set(key, Expr.fromPartial(value)); + } + }); + return m; + })(); + message.extensions = object.extensions?.map((e) => SourceInfo_Extension.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseSourceInfo_Extension(): SourceInfo_Extension { + return { id: "", affectedComponents: [], version: undefined }; +} + +export const SourceInfo_Extension: MessageFns = { + encode(message: SourceInfo_Extension, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + writer.uint32(18).fork(); + for (const v of message.affectedComponents) { + writer.int32(v); + } + writer.join(); + if (message.version !== undefined) { + SourceInfo_Extension_Version.encode(message.version, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceInfo_Extension { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceInfo_Extension(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.id = reader.string(); + continue; + } + case 2: { + if (tag === 16) { + message.affectedComponents.push(reader.int32() as any); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.affectedComponents.push(reader.int32() as any); + } + + continue; + } + + break; + } + case 3: { + if (tag !== 26) { + break; + } + + message.version = SourceInfo_Extension_Version.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceInfo_Extension { + return { + id: isSet(object.id) ? globalThis.String(object.id) : "", + affectedComponents: globalThis.Array.isArray(object?.affectedComponents) + ? object.affectedComponents.map((e: any) => sourceInfo_Extension_ComponentFromJSON(e)) + : [], + version: isSet(object.version) ? SourceInfo_Extension_Version.fromJSON(object.version) : undefined, + }; + }, + + toJSON(message: SourceInfo_Extension): unknown { + const obj: any = {}; + if (message.id !== "") { + obj.id = message.id; + } + if (message.affectedComponents?.length) { + obj.affectedComponents = message.affectedComponents.map((e) => sourceInfo_Extension_ComponentToJSON(e)); + } + if (message.version !== undefined) { + obj.version = SourceInfo_Extension_Version.toJSON(message.version); + } + return obj; + }, + + create(base?: DeepPartial): SourceInfo_Extension { + return SourceInfo_Extension.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourceInfo_Extension { + const message = createBaseSourceInfo_Extension(); + message.id = object.id ?? ""; + message.affectedComponents = object.affectedComponents?.map((e) => e) || []; + message.version = (object.version !== undefined && object.version !== null) + ? SourceInfo_Extension_Version.fromPartial(object.version) + : undefined; + return message; + }, +}; + +function createBaseSourceInfo_Extension_Version(): SourceInfo_Extension_Version { + return { major: Long.ZERO, minor: Long.ZERO }; +} + +export const SourceInfo_Extension_Version: MessageFns = { + encode(message: SourceInfo_Extension_Version, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.major.equals(Long.ZERO)) { + writer.uint32(8).int64(message.major.toString()); + } + if (!message.minor.equals(Long.ZERO)) { + writer.uint32(16).int64(message.minor.toString()); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceInfo_Extension_Version { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceInfo_Extension_Version(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.major = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.minor = Long.fromString(reader.int64().toString()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceInfo_Extension_Version { + return { + major: isSet(object.major) ? Long.fromValue(object.major) : Long.ZERO, + minor: isSet(object.minor) ? Long.fromValue(object.minor) : Long.ZERO, + }; + }, + + toJSON(message: SourceInfo_Extension_Version): unknown { + const obj: any = {}; + if (!message.major.equals(Long.ZERO)) { + obj.major = (message.major || Long.ZERO).toString(); + } + if (!message.minor.equals(Long.ZERO)) { + obj.minor = (message.minor || Long.ZERO).toString(); + } + return obj; + }, + + create(base?: DeepPartial): SourceInfo_Extension_Version { + return SourceInfo_Extension_Version.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourceInfo_Extension_Version { + const message = createBaseSourceInfo_Extension_Version(); + message.major = (object.major !== undefined && object.major !== null) ? Long.fromValue(object.major) : Long.ZERO; + message.minor = (object.minor !== undefined && object.minor !== null) ? Long.fromValue(object.minor) : Long.ZERO; + return message; + }, +}; + +function createBaseSourceInfo_PositionsEntry(): SourceInfo_PositionsEntry { + return { key: Long.ZERO, value: 0 }; +} + +export const SourceInfo_PositionsEntry: MessageFns = { + encode(message: SourceInfo_PositionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.key.equals(Long.ZERO)) { + writer.uint32(8).int64(message.key.toString()); + } + if (message.value !== 0) { + writer.uint32(16).int32(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceInfo_PositionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceInfo_PositionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.key = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.value = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceInfo_PositionsEntry { + return { + key: isSet(object.key) ? Long.fromValue(object.key) : Long.ZERO, + value: isSet(object.value) ? globalThis.Number(object.value) : 0, + }; + }, + + toJSON(message: SourceInfo_PositionsEntry): unknown { + const obj: any = {}; + if (!message.key.equals(Long.ZERO)) { + obj.key = (message.key || Long.ZERO).toString(); + } + if (message.value !== 0) { + obj.value = Math.round(message.value); + } + return obj; + }, + + create(base?: DeepPartial): SourceInfo_PositionsEntry { + return SourceInfo_PositionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourceInfo_PositionsEntry { + const message = createBaseSourceInfo_PositionsEntry(); + message.key = (object.key !== undefined && object.key !== null) ? Long.fromValue(object.key) : Long.ZERO; + message.value = object.value ?? 0; + return message; + }, +}; + +function createBaseSourceInfo_MacroCallsEntry(): SourceInfo_MacroCallsEntry { + return { key: Long.ZERO, value: undefined }; +} + +export const SourceInfo_MacroCallsEntry: MessageFns = { + encode(message: SourceInfo_MacroCallsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.key.equals(Long.ZERO)) { + writer.uint32(8).int64(message.key.toString()); + } + if (message.value !== undefined) { + Expr.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceInfo_MacroCallsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceInfo_MacroCallsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.key = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Expr.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceInfo_MacroCallsEntry { + return { + key: isSet(object.key) ? Long.fromValue(object.key) : Long.ZERO, + value: isSet(object.value) ? Expr.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: SourceInfo_MacroCallsEntry): unknown { + const obj: any = {}; + if (!message.key.equals(Long.ZERO)) { + obj.key = (message.key || Long.ZERO).toString(); + } + if (message.value !== undefined) { + obj.value = Expr.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): SourceInfo_MacroCallsEntry { + return SourceInfo_MacroCallsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourceInfo_MacroCallsEntry { + const message = createBaseSourceInfo_MacroCallsEntry(); + message.key = (object.key !== undefined && object.key !== null) ? Long.fromValue(object.key) : Long.ZERO; + message.value = (object.value !== undefined && object.value !== null) ? Expr.fromPartial(object.value) : undefined; + return message; + }, +}; + +function createBaseSourcePosition(): SourcePosition { + return { location: "", offset: 0, line: 0, column: 0 }; +} + +export const SourcePosition: MessageFns = { + encode(message: SourcePosition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.location !== "") { + writer.uint32(10).string(message.location); + } + if (message.offset !== 0) { + writer.uint32(16).int32(message.offset); + } + if (message.line !== 0) { + writer.uint32(24).int32(message.line); + } + if (message.column !== 0) { + writer.uint32(32).int32(message.column); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourcePosition { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourcePosition(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.location = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.offset = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.line = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.column = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourcePosition { + return { + location: isSet(object.location) ? globalThis.String(object.location) : "", + offset: isSet(object.offset) ? globalThis.Number(object.offset) : 0, + line: isSet(object.line) ? globalThis.Number(object.line) : 0, + column: isSet(object.column) ? globalThis.Number(object.column) : 0, + }; + }, + + toJSON(message: SourcePosition): unknown { + const obj: any = {}; + if (message.location !== "") { + obj.location = message.location; + } + if (message.offset !== 0) { + obj.offset = Math.round(message.offset); + } + if (message.line !== 0) { + obj.line = Math.round(message.line); + } + if (message.column !== 0) { + obj.column = Math.round(message.column); + } + return obj; + }, + + create(base?: DeepPartial): SourcePosition { + return SourcePosition.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourcePosition { + const message = createBaseSourcePosition(); + message.location = object.location ?? ""; + message.offset = object.offset ?? 0; + message.line = object.line ?? 0; + message.column = object.column ?? 0; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(Math.trunc(date.getTime() / 1_000)); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds.toNumber() || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new globalThis.Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof globalThis.Date) { + return o; + } else if (typeof o === "string") { + return new globalThis.Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +function longToNumber(int64: { toString(): string }): number { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/api/http.ts b/src/grpc/generated/google/api/http.ts new file mode 100644 index 0000000..1a20c1b --- /dev/null +++ b/src/grpc/generated/google/api/http.ts @@ -0,0 +1,792 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/api/http.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} + +/** + * gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` + * - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: + * SubMessage(subfield: "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * The following HTTP JSON to RPC mapping is enabled: + * + * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` + * - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * - HTTP: `GET /v1/messages/123456` + * - gRPC: `GetMessage(message_id: "123456")` + * + * - HTTP: `GET /v1/users/me/messages/123456` + * - gRPC: `GetMessage(user_id: "me" message_id: "123456")` + * + * Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * The following example selects a gRPC method and applies an `HttpRule` to it: + * + * http: + * rules: + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector: string; + /** + * Determines the URL pattern is matched by this rules. This pattern can be + * used with any of the {get|put|post|delete|patch} methods. A custom method + * can be defined using the 'custom' field. + */ + pattern?: + | // + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + { $case: "get"; get: string } + | // + /** Maps to HTTP PUT. Used for replacing a resource. */ + { $case: "put"; put: string } + | // + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + { $case: "post"; post: string } + | // + /** Maps to HTTP DELETE. Used for deleting a resource. */ + { $case: "delete"; delete: string } + | // + /** Maps to HTTP PATCH. Used for updating a resource. */ + { $case: "patch"; patch: string } + | // + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + { $case: "custom"; custom: CustomHttpPattern } + | undefined; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} + +export const Http: MessageFns = { + encode(message: Http, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).join(); + } + if (message.fullyDecodeReservedExpansion !== false) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Http { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.rules.push(HttpRule.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.fullyDecodeReservedExpansion = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Http { + return { + rules: globalThis.Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromJSON(e)) : [], + fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion) + ? globalThis.Boolean(object.fullyDecodeReservedExpansion) + : false, + }; + }, + + toJSON(message: Http): unknown { + const obj: any = {}; + if (message.rules?.length) { + obj.rules = message.rules.map((e) => HttpRule.toJSON(e)); + } + if (message.fullyDecodeReservedExpansion !== false) { + obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + } + return obj; + }, + + create(base?: DeepPartial): Http { + return Http.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; + return message; + }, +}; + +function createBaseHttpRule(): HttpRule { + return { selector: "", pattern: undefined, body: "", responseBody: "", additionalBindings: [] }; +} + +export const HttpRule: MessageFns = { + encode(message: HttpRule, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + switch (message.pattern?.$case) { + case "get": + writer.uint32(18).string(message.pattern.get); + break; + case "put": + writer.uint32(26).string(message.pattern.put); + break; + case "post": + writer.uint32(34).string(message.pattern.post); + break; + case "delete": + writer.uint32(42).string(message.pattern.delete); + break; + case "patch": + writer.uint32(50).string(message.pattern.patch); + break; + case "custom": + CustomHttpPattern.encode(message.pattern.custom, writer.uint32(66).fork()).join(); + break; + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.selector = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.pattern = { $case: "get", get: reader.string() }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pattern = { $case: "put", put: reader.string() }; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.pattern = { $case: "post", post: reader.string() }; + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.pattern = { $case: "delete", delete: reader.string() }; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.pattern = { $case: "patch", patch: reader.string() }; + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.pattern = { $case: "custom", custom: CustomHttpPattern.decode(reader, reader.uint32()) }; + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.body = reader.string(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.responseBody = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HttpRule { + return { + selector: isSet(object.selector) ? globalThis.String(object.selector) : "", + pattern: isSet(object.get) + ? { $case: "get", get: globalThis.String(object.get) } + : isSet(object.put) + ? { $case: "put", put: globalThis.String(object.put) } + : isSet(object.post) + ? { $case: "post", post: globalThis.String(object.post) } + : isSet(object.delete) + ? { $case: "delete", delete: globalThis.String(object.delete) } + : isSet(object.patch) + ? { $case: "patch", patch: globalThis.String(object.patch) } + : isSet(object.custom) + ? { $case: "custom", custom: CustomHttpPattern.fromJSON(object.custom) } + : undefined, + body: isSet(object.body) ? globalThis.String(object.body) : "", + responseBody: isSet(object.responseBody) ? globalThis.String(object.responseBody) : "", + additionalBindings: globalThis.Array.isArray(object?.additionalBindings) + ? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e)) + : [], + }; + }, + + toJSON(message: HttpRule): unknown { + const obj: any = {}; + if (message.selector !== "") { + obj.selector = message.selector; + } + if (message.pattern?.$case === "get") { + obj.get = message.pattern.get; + } else if (message.pattern?.$case === "put") { + obj.put = message.pattern.put; + } else if (message.pattern?.$case === "post") { + obj.post = message.pattern.post; + } else if (message.pattern?.$case === "delete") { + obj.delete = message.pattern.delete; + } else if (message.pattern?.$case === "patch") { + obj.patch = message.pattern.patch; + } else if (message.pattern?.$case === "custom") { + obj.custom = CustomHttpPattern.toJSON(message.pattern.custom); + } + if (message.body !== "") { + obj.body = message.body; + } + if (message.responseBody !== "") { + obj.responseBody = message.responseBody; + } + if (message.additionalBindings?.length) { + obj.additionalBindings = message.additionalBindings.map((e) => HttpRule.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): HttpRule { + return HttpRule.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ""; + switch (object.pattern?.$case) { + case "get": { + if (object.pattern?.get !== undefined && object.pattern?.get !== null) { + message.pattern = { $case: "get", get: object.pattern.get }; + } + break; + } + case "put": { + if (object.pattern?.put !== undefined && object.pattern?.put !== null) { + message.pattern = { $case: "put", put: object.pattern.put }; + } + break; + } + case "post": { + if (object.pattern?.post !== undefined && object.pattern?.post !== null) { + message.pattern = { $case: "post", post: object.pattern.post }; + } + break; + } + case "delete": { + if (object.pattern?.delete !== undefined && object.pattern?.delete !== null) { + message.pattern = { $case: "delete", delete: object.pattern.delete }; + } + break; + } + case "patch": { + if (object.pattern?.patch !== undefined && object.pattern?.patch !== null) { + message.pattern = { $case: "patch", patch: object.pattern.patch }; + } + break; + } + case "custom": { + if (object.pattern?.custom !== undefined && object.pattern?.custom !== null) { + message.pattern = { $case: "custom", custom: CustomHttpPattern.fromPartial(object.pattern.custom) }; + } + break; + } + } + message.body = object.body ?? ""; + message.responseBody = object.responseBody ?? ""; + message.additionalBindings = object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} + +export const CustomHttpPattern: MessageFns = { + encode(message: CustomHttpPattern, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.kind = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.path = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CustomHttpPattern { + return { + kind: isSet(object.kind) ? globalThis.String(object.kind) : "", + path: isSet(object.path) ? globalThis.String(object.path) : "", + }; + }, + + toJSON(message: CustomHttpPattern): unknown { + const obj: any = {}; + if (message.kind !== "") { + obj.kind = message.kind; + } + if (message.path !== "") { + obj.path = message.path; + } + return obj; + }, + + create(base?: DeepPartial): CustomHttpPattern { + return CustomHttpPattern.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ""; + message.path = object.path ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/protobuf/any.ts b/src/grpc/generated/google/protobuf/any.ts new file mode 100644 index 0000000..f1a5fab --- /dev/null +++ b/src/grpc/generated/google/protobuf/any.ts @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/protobuf/any.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "google.protobuf"; + +/** + * `Any` contains an arbitrary serialized protocol buffer message along with a + * URL that describes the type of the serialized message. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * // or ... + * if (any.isSameTypeAs(Foo.getDefaultInstance())) { + * foo = any.unpack(Foo.getDefaultInstance()); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := anypb.New(foo) + * if err != nil { + * ... + * } + * ... + * foo := &pb.Foo{} + * if err := any.UnmarshalTo(foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + */ +export interface Any { + /** + * A URL/resource name that uniquely identifies the type of the serialized + * protocol buffer message. This string must contain at least + * one "/" character. The last segment of the URL's path must represent + * the fully qualified name of the type (as in + * `path/google.protobuf.Duration`). The name should be in a canonical form + * (e.g., leading "." is not accepted). + * + * In practice, teams usually precompile into the binary all types that they + * expect it to use in the context of Any. However, for URLs which use the + * scheme `http`, `https`, or no scheme, one can optionally set up a type + * server that maps type URLs to message definitions as follows: + * + * * If no scheme is provided, `https` is assumed. + * * An HTTP GET on the URL must yield a [google.protobuf.Type][] + * value in binary format, or produce an error. + * * Applications are allowed to cache lookup results based on the + * URL, or have them precompiled into a binary to avoid any + * lookup. Therefore, binary compatibility needs to be preserved + * on changes to types. (Use versioned type names to manage + * breaking changes.) + * + * Note: this functionality is not currently available in the official + * protobuf release, and it is not used for type URLs beginning with + * type.googleapis.com. As of May 2023, there are no widely used type server + * implementations and no plans to implement one. + * + * Schemes other than `http`, `https` (or the empty scheme) might be + * used with implementation specific semantics. + */ + typeUrl: string; + /** Must be a valid serialized protocol buffer of the above specified type. */ + value: Buffer; +} + +function createBaseAny(): Any { + return { typeUrl: "", value: Buffer.alloc(0) }; +} + +export const Any: MessageFns = { + encode(message: Any, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.typeUrl !== "") { + writer.uint32(10).string(message.typeUrl); + } + if (message.value.length !== 0) { + writer.uint32(18).bytes(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Any { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAny(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.typeUrl = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Buffer.from(reader.bytes()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Any { + return { + typeUrl: isSet(object.typeUrl) ? globalThis.String(object.typeUrl) : "", + value: isSet(object.value) ? Buffer.from(bytesFromBase64(object.value)) : Buffer.alloc(0), + }; + }, + + toJSON(message: Any): unknown { + const obj: any = {}; + if (message.typeUrl !== "") { + obj.typeUrl = message.typeUrl; + } + if (message.value.length !== 0) { + obj.value = base64FromBytes(message.value); + } + return obj; + }, + + create(base?: DeepPartial): Any { + return Any.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Any { + const message = createBaseAny(); + message.typeUrl = object.typeUrl ?? ""; + message.value = object.value ?? Buffer.alloc(0); + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/protobuf/descriptor.ts b/src/grpc/generated/google/protobuf/descriptor.ts new file mode 100644 index 0000000..68cd430 --- /dev/null +++ b/src/grpc/generated/google/protobuf/descriptor.ts @@ -0,0 +1,6600 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/protobuf/descriptor.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "google.protobuf"; + +/** The full set of known editions. */ +export enum Edition { + /** EDITION_UNKNOWN - A placeholder for an unknown edition value. */ + EDITION_UNKNOWN = 0, + /** + * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + */ + EDITION_LEGACY = 900, + /** + * EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like + * distinct editions. These can't be used to specify the edition of proto + * files, but feature definitions must supply proto2/proto3 defaults for + * backwards compatibility. + */ + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + /** + * EDITION_2023 - Editions that have been released. The specific values are arbitrary and + * should not be depended on, but they will always be time-ordered for easy + * comparison. + */ + EDITION_2023 = 1000, + EDITION_2024 = 1001, + /** + * EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be + * used or relyed on outside of tests. + */ + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + /** + * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only + * ever be used by plugins that can expect to never require any changes to + * support a new edition. + */ + EDITION_MAX = 2147483647, + UNRECOGNIZED = -1, +} + +export function editionFromJSON(object: any): Edition { + switch (object) { + case 0: + case "EDITION_UNKNOWN": + return Edition.EDITION_UNKNOWN; + case 900: + case "EDITION_LEGACY": + return Edition.EDITION_LEGACY; + case 998: + case "EDITION_PROTO2": + return Edition.EDITION_PROTO2; + case 999: + case "EDITION_PROTO3": + return Edition.EDITION_PROTO3; + case 1000: + case "EDITION_2023": + return Edition.EDITION_2023; + case 1001: + case "EDITION_2024": + return Edition.EDITION_2024; + case 1: + case "EDITION_1_TEST_ONLY": + return Edition.EDITION_1_TEST_ONLY; + case 2: + case "EDITION_2_TEST_ONLY": + return Edition.EDITION_2_TEST_ONLY; + case 99997: + case "EDITION_99997_TEST_ONLY": + return Edition.EDITION_99997_TEST_ONLY; + case 99998: + case "EDITION_99998_TEST_ONLY": + return Edition.EDITION_99998_TEST_ONLY; + case 99999: + case "EDITION_99999_TEST_ONLY": + return Edition.EDITION_99999_TEST_ONLY; + case 2147483647: + case "EDITION_MAX": + return Edition.EDITION_MAX; + case -1: + case "UNRECOGNIZED": + default: + return Edition.UNRECOGNIZED; + } +} + +export function editionToJSON(object: Edition): string { + switch (object) { + case Edition.EDITION_UNKNOWN: + return "EDITION_UNKNOWN"; + case Edition.EDITION_LEGACY: + return "EDITION_LEGACY"; + case Edition.EDITION_PROTO2: + return "EDITION_PROTO2"; + case Edition.EDITION_PROTO3: + return "EDITION_PROTO3"; + case Edition.EDITION_2023: + return "EDITION_2023"; + case Edition.EDITION_2024: + return "EDITION_2024"; + case Edition.EDITION_1_TEST_ONLY: + return "EDITION_1_TEST_ONLY"; + case Edition.EDITION_2_TEST_ONLY: + return "EDITION_2_TEST_ONLY"; + case Edition.EDITION_99997_TEST_ONLY: + return "EDITION_99997_TEST_ONLY"; + case Edition.EDITION_99998_TEST_ONLY: + return "EDITION_99998_TEST_ONLY"; + case Edition.EDITION_99999_TEST_ONLY: + return "EDITION_99999_TEST_ONLY"; + case Edition.EDITION_MAX: + return "EDITION_MAX"; + case Edition.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name?: + | string + | undefined; + /** e.g. "foo", "foo.bar", etc. */ + package?: + | string + | undefined; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: + | FileOptions + | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: + | SourceCodeInfo + | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + */ + syntax?: + | string + | undefined; + /** The edition of the proto file. */ + edition?: Edition | undefined; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name?: string | undefined; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions | undefined; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start?: + | number + | undefined; + /** Exclusive. */ + end?: number | undefined; + options?: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start?: + | number + | undefined; + /** Exclusive. */ + end?: number | undefined; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; + /** + * For external users: DO NOT USE. We are in the process of open sourcing + * extension declaration and executing internal cleanups before it can be + * used externally. + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + */ + verification?: ExtensionRangeOptions_VerificationState | undefined; +} + +/** The verification state of the extension range. */ +export enum ExtensionRangeOptions_VerificationState { + /** DECLARATION - All the extensions of the range must be declared. */ + DECLARATION = 0, + UNVERIFIED = 1, + UNRECOGNIZED = -1, +} + +export function extensionRangeOptions_VerificationStateFromJSON(object: any): ExtensionRangeOptions_VerificationState { + switch (object) { + case 0: + case "DECLARATION": + return ExtensionRangeOptions_VerificationState.DECLARATION; + case 1: + case "UNVERIFIED": + return ExtensionRangeOptions_VerificationState.UNVERIFIED; + case -1: + case "UNRECOGNIZED": + default: + return ExtensionRangeOptions_VerificationState.UNRECOGNIZED; + } +} + +export function extensionRangeOptions_VerificationStateToJSON(object: ExtensionRangeOptions_VerificationState): string { + switch (object) { + case ExtensionRangeOptions_VerificationState.DECLARATION: + return "DECLARATION"; + case ExtensionRangeOptions_VerificationState.UNVERIFIED: + return "UNVERIFIED"; + case ExtensionRangeOptions_VerificationState.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface ExtensionRangeOptions_Declaration { + /** The extension number declared within the extension range. */ + number?: + | number + | undefined; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + */ + fullName?: + | string + | undefined; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + */ + type?: + | string + | undefined; + /** + * If true, indicates that the number is reserved in the extension range, + * and any extension field with the number will fail to compile. Set this + * when a declared extension field is deleted. + */ + reserved?: + | boolean + | undefined; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + */ + repeated?: boolean | undefined; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name?: string | undefined; + number?: number | undefined; + label?: + | FieldDescriptorProto_Label + | undefined; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type?: + | FieldDescriptorProto_Type + | undefined; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName?: + | string + | undefined; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee?: + | string + | undefined; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + */ + defaultValue?: + | string + | undefined; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex?: + | number + | undefined; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName?: string | undefined; + options?: + | FieldOptions + | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must belong to a oneof to signal + * to old proto3 clients that presence is tracked for this field. This oneof + * is known as a "synthetic" oneof, and this field must be its sole member + * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + * exist in the descriptor only, and do not generate any API. Synthetic oneofs + * must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional?: boolean | undefined; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported after google.protobuf. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. In Editions, the group wire format + * can be enabled via the `message_encoding` feature. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON(object: any): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON(object: FieldDescriptorProto_Type): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + /** + * LABEL_REQUIRED - The required label is only allowed in google.protobuf. In proto3 and Editions + * it's explicitly prohibited. In Editions, the `field_presence` feature + * can be used to get this behavior. + */ + LABEL_REQUIRED = 2, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON(object: any): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON(object: FieldDescriptorProto_Label): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name?: string | undefined; + options?: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name?: string | undefined; + value: EnumValueDescriptorProto[]; + options?: + | EnumOptions + | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start?: + | number + | undefined; + /** Inclusive. */ + end?: number | undefined; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name?: string | undefined; + number?: number | undefined; + options?: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name?: string | undefined; + method: MethodDescriptorProto[]; + options?: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name?: + | string + | undefined; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType?: string | undefined; + outputType?: string | undefined; + options?: + | MethodOptions + | undefined; + /** Identifies if client streams multiple client messages */ + clientStreaming?: + | boolean + | undefined; + /** Identifies if server streams multiple server messages */ + serverStreaming?: boolean | undefined; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage?: + | string + | undefined; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + javaOuterClassname?: + | string + | undefined; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles?: + | boolean + | undefined; + /** + * This option does nothing. + * + * @deprecated + */ + javaGenerateEqualsAndHash?: + | boolean + | undefined; + /** + * A proto2 file can set this to true to opt in to UTF-8 checking for Java, + * which will throw an exception if invalid UTF-8 is parsed from the wire or + * assigned to a string field. + * + * TODO: clarify exactly what kinds of field types this option + * applies to, and update these docs accordingly. + * + * Proto3 files already perform these checks. Setting the option explicitly to + * false has no effect: it cannot be used to opt proto3 files out of UTF-8 + * checks. + */ + javaStringCheckUtf8?: boolean | undefined; + optimizeFor?: + | FileOptions_OptimizeMode + | undefined; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage?: + | string + | undefined; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices?: boolean | undefined; + javaGenericServices?: boolean | undefined; + pyGenericServices?: + | boolean + | undefined; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated?: + | boolean + | undefined; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas?: + | boolean + | undefined; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix?: + | string + | undefined; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace?: + | string + | undefined; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix?: + | string + | undefined; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix?: + | string + | undefined; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace?: + | string + | undefined; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace?: + | string + | undefined; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage?: + | string + | undefined; + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON(object: any): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON(object: FileOptions_OptimizeMode): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat?: + | boolean + | undefined; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor?: + | boolean + | undefined; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated?: + | boolean + | undefined; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry?: + | boolean + | undefined; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: + | boolean + | undefined; + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is only implemented to support use of + * [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + * type "bytes" in the open source release -- sorry, we'll try to include + * other types in a future version! + */ + ctype?: + | FieldOptions_CType + | undefined; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. This option is prohibited in + * Editions, but the `repeated_field_encoding` feature can be used to control + * the behavior. + */ + packed?: + | boolean + | undefined; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype?: + | FieldOptions_JSType + | undefined; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that lazy message fields are still eagerly verified to check + * ill-formed wireformat or missing required fields. Calling IsInitialized() + * on the outer message would fail if the inner message has missing required + * fields. Failed verification would result in parsing failure (except when + * uninitialized messages are acceptable). + */ + lazy?: + | boolean + | undefined; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverifiedLazy?: + | boolean + | undefined; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated?: + | boolean + | undefined; + /** For Google-internal migration only. Do not use. */ + weak?: + | boolean + | undefined; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debugRedact?: boolean | undefined; + retention?: FieldOptions_OptionRetention | undefined; + targets: FieldOptions_OptionTargetType[]; + editionDefaults: FieldOptions_EditionDefault[]; + /** Any features defined in the specific edition. */ + features?: FeatureSet | undefined; + featureSupport?: + | FieldOptions_FeatureSupport + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + /** + * CORD - The option [ctype=CORD] may be applied to a non-repeated field of type + * "bytes". It indicates that in C++, the data should be stored in a Cord + * instead of a string. For very large strings, this may reduce memory + * fragmentation. It may also allow better performance when parsing from a + * Cord, or when parsing with aliasing enabled, as the parsed Cord may then + * alias the original buffer. + */ + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * Note: as of January 2023, support for this is in progress and does not yet + * have an effect (b/264593489). + */ +export enum FieldOptions_OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_OptionRetentionFromJSON(object: any): FieldOptions_OptionRetention { + switch (object) { + case 0: + case "RETENTION_UNKNOWN": + return FieldOptions_OptionRetention.RETENTION_UNKNOWN; + case 1: + case "RETENTION_RUNTIME": + return FieldOptions_OptionRetention.RETENTION_RUNTIME; + case 2: + case "RETENTION_SOURCE": + return FieldOptions_OptionRetention.RETENTION_SOURCE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionRetention.UNRECOGNIZED; + } +} + +export function fieldOptions_OptionRetentionToJSON(object: FieldOptions_OptionRetention): string { + switch (object) { + case FieldOptions_OptionRetention.RETENTION_UNKNOWN: + return "RETENTION_UNKNOWN"; + case FieldOptions_OptionRetention.RETENTION_RUNTIME: + return "RETENTION_RUNTIME"; + case FieldOptions_OptionRetention.RETENTION_SOURCE: + return "RETENTION_SOURCE"; + case FieldOptions_OptionRetention.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. Note: as of January 2023, support for this is + * in progress and does not yet have an effect (b/264593489). + */ +export enum FieldOptions_OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9, + UNRECOGNIZED = -1, +} + +export function fieldOptions_OptionTargetTypeFromJSON(object: any): FieldOptions_OptionTargetType { + switch (object) { + case 0: + case "TARGET_TYPE_UNKNOWN": + return FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN; + case 1: + case "TARGET_TYPE_FILE": + return FieldOptions_OptionTargetType.TARGET_TYPE_FILE; + case 2: + case "TARGET_TYPE_EXTENSION_RANGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE; + case 3: + case "TARGET_TYPE_MESSAGE": + return FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE; + case 4: + case "TARGET_TYPE_FIELD": + return FieldOptions_OptionTargetType.TARGET_TYPE_FIELD; + case 5: + case "TARGET_TYPE_ONEOF": + return FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF; + case 6: + case "TARGET_TYPE_ENUM": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM; + case 7: + case "TARGET_TYPE_ENUM_ENTRY": + return FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY; + case 8: + case "TARGET_TYPE_SERVICE": + return FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE; + case 9: + case "TARGET_TYPE_METHOD": + return FieldOptions_OptionTargetType.TARGET_TYPE_METHOD; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_OptionTargetType.UNRECOGNIZED; + } +} + +export function fieldOptions_OptionTargetTypeToJSON(object: FieldOptions_OptionTargetType): string { + switch (object) { + case FieldOptions_OptionTargetType.TARGET_TYPE_UNKNOWN: + return "TARGET_TYPE_UNKNOWN"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FILE: + return "TARGET_TYPE_FILE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_EXTENSION_RANGE: + return "TARGET_TYPE_EXTENSION_RANGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_MESSAGE: + return "TARGET_TYPE_MESSAGE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_FIELD: + return "TARGET_TYPE_FIELD"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ONEOF: + return "TARGET_TYPE_ONEOF"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM: + return "TARGET_TYPE_ENUM"; + case FieldOptions_OptionTargetType.TARGET_TYPE_ENUM_ENTRY: + return "TARGET_TYPE_ENUM_ENTRY"; + case FieldOptions_OptionTargetType.TARGET_TYPE_SERVICE: + return "TARGET_TYPE_SERVICE"; + case FieldOptions_OptionTargetType.TARGET_TYPE_METHOD: + return "TARGET_TYPE_METHOD"; + case FieldOptions_OptionTargetType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface FieldOptions_EditionDefault { + edition?: + | Edition + | undefined; + /** Textproto value. */ + value?: string | undefined; +} + +/** Information about the support window of a feature. */ +export interface FieldOptions_FeatureSupport { + /** + * The edition that this feature was first available in. In editions + * earlier than this one, the default assigned to EDITION_LEGACY will be + * used, and proto files will not be able to override it. + */ + editionIntroduced?: + | Edition + | undefined; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + */ + editionDeprecated?: + | Edition + | undefined; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + */ + deprecationWarning?: + | string + | undefined; + /** + * The edition this feature is no longer available in. In editions after + * this one, the last default assigned will be used, and proto files will + * not be able to override it. + */ + editionRemoved?: Edition | undefined; +} + +export interface OneofOptions { + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias?: + | boolean + | undefined; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated?: + | boolean + | undefined; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts?: + | boolean + | undefined; + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated?: + | boolean + | undefined; + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** + * Indicate that fields annotated with this enum value should not be printed + * out when using debug formats, e.g. when the field contains sensitive + * credentials. + */ + debugRedact?: + | boolean + | undefined; + /** Information about the support window of a feature value. */ + featureSupport?: + | FieldOptions_FeatureSupport + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated?: + | boolean + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated?: boolean | undefined; + idempotencyLevel?: + | MethodOptions_IdempotencyLevel + | undefined; + /** Any features defined in the specific edition. */ + features?: + | FeatureSet + | undefined; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON(object: any): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_IdempotencyLevel): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue?: string | undefined; + positiveIntValue?: Long | undefined; + negativeIntValue?: Long | undefined; + doubleValue?: number | undefined; + stringValue?: Buffer | undefined; + aggregateValue?: string | undefined; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} + +/** + * TODO Enums in C++ gencode (and potentially other languages) are + * not well scoped. This means that each of the feature enums below can clash + * with each other. The short names we've chosen maximize call-site + * readability, but leave us very open to this scenario. A future feature will + * be designed and implemented to handle this, hopefully before we ever hit a + * conflict here. + */ +export interface FeatureSet { + fieldPresence?: FeatureSet_FieldPresence | undefined; + enumType?: FeatureSet_EnumType | undefined; + repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding | undefined; + utf8Validation?: FeatureSet_Utf8Validation | undefined; + messageEncoding?: FeatureSet_MessageEncoding | undefined; + jsonFormat?: FeatureSet_JsonFormat | undefined; +} + +export enum FeatureSet_FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0, + EXPLICIT = 1, + IMPLICIT = 2, + LEGACY_REQUIRED = 3, + UNRECOGNIZED = -1, +} + +export function featureSet_FieldPresenceFromJSON(object: any): FeatureSet_FieldPresence { + switch (object) { + case 0: + case "FIELD_PRESENCE_UNKNOWN": + return FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN; + case 1: + case "EXPLICIT": + return FeatureSet_FieldPresence.EXPLICIT; + case 2: + case "IMPLICIT": + return FeatureSet_FieldPresence.IMPLICIT; + case 3: + case "LEGACY_REQUIRED": + return FeatureSet_FieldPresence.LEGACY_REQUIRED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_FieldPresence.UNRECOGNIZED; + } +} + +export function featureSet_FieldPresenceToJSON(object: FeatureSet_FieldPresence): string { + switch (object) { + case FeatureSet_FieldPresence.FIELD_PRESENCE_UNKNOWN: + return "FIELD_PRESENCE_UNKNOWN"; + case FeatureSet_FieldPresence.EXPLICIT: + return "EXPLICIT"; + case FeatureSet_FieldPresence.IMPLICIT: + return "IMPLICIT"; + case FeatureSet_FieldPresence.LEGACY_REQUIRED: + return "LEGACY_REQUIRED"; + case FeatureSet_FieldPresence.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_EnumType { + ENUM_TYPE_UNKNOWN = 0, + OPEN = 1, + CLOSED = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_EnumTypeFromJSON(object: any): FeatureSet_EnumType { + switch (object) { + case 0: + case "ENUM_TYPE_UNKNOWN": + return FeatureSet_EnumType.ENUM_TYPE_UNKNOWN; + case 1: + case "OPEN": + return FeatureSet_EnumType.OPEN; + case 2: + case "CLOSED": + return FeatureSet_EnumType.CLOSED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_EnumType.UNRECOGNIZED; + } +} + +export function featureSet_EnumTypeToJSON(object: FeatureSet_EnumType): string { + switch (object) { + case FeatureSet_EnumType.ENUM_TYPE_UNKNOWN: + return "ENUM_TYPE_UNKNOWN"; + case FeatureSet_EnumType.OPEN: + return "OPEN"; + case FeatureSet_EnumType.CLOSED: + return "CLOSED"; + case FeatureSet_EnumType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + PACKED = 1, + EXPANDED = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_RepeatedFieldEncodingFromJSON(object: any): FeatureSet_RepeatedFieldEncoding { + switch (object) { + case 0: + case "REPEATED_FIELD_ENCODING_UNKNOWN": + return FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN; + case 1: + case "PACKED": + return FeatureSet_RepeatedFieldEncoding.PACKED; + case 2: + case "EXPANDED": + return FeatureSet_RepeatedFieldEncoding.EXPANDED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED; + } +} + +export function featureSet_RepeatedFieldEncodingToJSON(object: FeatureSet_RepeatedFieldEncoding): string { + switch (object) { + case FeatureSet_RepeatedFieldEncoding.REPEATED_FIELD_ENCODING_UNKNOWN: + return "REPEATED_FIELD_ENCODING_UNKNOWN"; + case FeatureSet_RepeatedFieldEncoding.PACKED: + return "PACKED"; + case FeatureSet_RepeatedFieldEncoding.EXPANDED: + return "EXPANDED"; + case FeatureSet_RepeatedFieldEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0, + VERIFY = 2, + NONE = 3, + UNRECOGNIZED = -1, +} + +export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Validation { + switch (object) { + case 0: + case "UTF8_VALIDATION_UNKNOWN": + return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN; + case 2: + case "VERIFY": + return FeatureSet_Utf8Validation.VERIFY; + case 3: + case "NONE": + return FeatureSet_Utf8Validation.NONE; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_Utf8Validation.UNRECOGNIZED; + } +} + +export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validation): string { + switch (object) { + case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN: + return "UTF8_VALIDATION_UNKNOWN"; + case FeatureSet_Utf8Validation.VERIFY: + return "VERIFY"; + case FeatureSet_Utf8Validation.NONE: + return "NONE"; + case FeatureSet_Utf8Validation.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0, + LENGTH_PREFIXED = 1, + DELIMITED = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_MessageEncodingFromJSON(object: any): FeatureSet_MessageEncoding { + switch (object) { + case 0: + case "MESSAGE_ENCODING_UNKNOWN": + return FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN; + case 1: + case "LENGTH_PREFIXED": + return FeatureSet_MessageEncoding.LENGTH_PREFIXED; + case 2: + case "DELIMITED": + return FeatureSet_MessageEncoding.DELIMITED; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_MessageEncoding.UNRECOGNIZED; + } +} + +export function featureSet_MessageEncodingToJSON(object: FeatureSet_MessageEncoding): string { + switch (object) { + case FeatureSet_MessageEncoding.MESSAGE_ENCODING_UNKNOWN: + return "MESSAGE_ENCODING_UNKNOWN"; + case FeatureSet_MessageEncoding.LENGTH_PREFIXED: + return "LENGTH_PREFIXED"; + case FeatureSet_MessageEncoding.DELIMITED: + return "DELIMITED"; + case FeatureSet_MessageEncoding.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FeatureSet_JsonFormat { + JSON_FORMAT_UNKNOWN = 0, + ALLOW = 1, + LEGACY_BEST_EFFORT = 2, + UNRECOGNIZED = -1, +} + +export function featureSet_JsonFormatFromJSON(object: any): FeatureSet_JsonFormat { + switch (object) { + case 0: + case "JSON_FORMAT_UNKNOWN": + return FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN; + case 1: + case "ALLOW": + return FeatureSet_JsonFormat.ALLOW; + case 2: + case "LEGACY_BEST_EFFORT": + return FeatureSet_JsonFormat.LEGACY_BEST_EFFORT; + case -1: + case "UNRECOGNIZED": + default: + return FeatureSet_JsonFormat.UNRECOGNIZED; + } +} + +export function featureSet_JsonFormatToJSON(object: FeatureSet_JsonFormat): string { + switch (object) { + case FeatureSet_JsonFormat.JSON_FORMAT_UNKNOWN: + return "JSON_FORMAT_UNKNOWN"; + case FeatureSet_JsonFormat.ALLOW: + return "ALLOW"; + case FeatureSet_JsonFormat.LEGACY_BEST_EFFORT: + return "LEGACY_BEST_EFFORT"; + case FeatureSet_JsonFormat.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * A compiled specification for the defaults of a set of features. These + * messages are generated from FeatureSet extensions and can be used to seed + * feature resolution. The resolution with this object becomes a simple search + * for the closest matching edition, followed by proto merges. + */ +export interface FeatureSetDefaults { + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + */ + minimumEdition?: + | Edition + | undefined; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + */ + maximumEdition?: Edition | undefined; +} + +/** + * A map from every known edition with a unique set of defaults to its + * defaults. Not all editions may be contained here. For a given edition, + * the defaults at the closest matching edition ordered at or before it should + * be used. This field must be in strict ascending order by edition. + */ +export interface FeatureSetDefaults_FeatureSetEditionDefault { + edition?: + | Edition + | undefined; + /** Defaults of features that can be overridden in this edition. */ + overridableFeatures?: + | FeatureSet + | undefined; + /** Defaults of features that can't be overridden in this edition. */ + fixedFeatures?: FeatureSet | undefined; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition appears. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments?: string | undefined; + trailingComments?: string | undefined; + leadingDetachedComments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile?: + | string + | undefined; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin?: + | number + | undefined; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end?: number | undefined; + semantic?: GeneratedCodeInfo_Annotation_Semantic | undefined; +} + +/** + * Represents the identified object's effect on the element in the original + * .proto file. + */ +export enum GeneratedCodeInfo_Annotation_Semantic { + /** NONE - There is no effect or the effect is indescribable. */ + NONE = 0, + /** SET - The element is set or otherwise mutated. */ + SET = 1, + /** ALIAS - An alias to the element is returned. */ + ALIAS = 2, + UNRECOGNIZED = -1, +} + +export function generatedCodeInfo_Annotation_SemanticFromJSON(object: any): GeneratedCodeInfo_Annotation_Semantic { + switch (object) { + case 0: + case "NONE": + return GeneratedCodeInfo_Annotation_Semantic.NONE; + case 1: + case "SET": + return GeneratedCodeInfo_Annotation_Semantic.SET; + case 2: + case "ALIAS": + return GeneratedCodeInfo_Annotation_Semantic.ALIAS; + case -1: + case "UNRECOGNIZED": + default: + return GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED; + } +} + +export function generatedCodeInfo_Annotation_SemanticToJSON(object: GeneratedCodeInfo_Annotation_Semantic): string { + switch (object) { + case GeneratedCodeInfo_Annotation_Semantic.NONE: + return "NONE"; + case GeneratedCodeInfo_Annotation_Semantic.SET: + return "SET"; + case GeneratedCodeInfo_Annotation_Semantic.ALIAS: + return "ALIAS"; + case GeneratedCodeInfo_Annotation_Semantic.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} + +export const FileDescriptorSet: MessageFns = { + encode(message: FileDescriptorSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + return { + file: globalThis.Array.isArray(object?.file) ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) : [], + }; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file?.length) { + obj.file = message.file.map((e) => FileDescriptorProto.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): FileDescriptorSet { + return FileDescriptorSet.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: "", + package: "", + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: "", + edition: 0, + }; +} + +export const FileDescriptorProto: MessageFns = { + encode(message: FileDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== undefined && message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + for (const v of message.publicDependency) { + writer.uint32(80).int32(v!); + } + for (const v of message.weakDependency) { + writer.uint32(88).int32(v!); + } + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).join(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).join(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).join(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).join(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).join(); + } + if (message.syntax !== undefined && message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + if (message.edition !== undefined && message.edition !== 0) { + writer.uint32(112).int32(message.edition); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.package = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.dependency.push(reader.string()); + continue; + } + case 10: { + if (tag === 80) { + message.publicDependency.push(reader.int32()); + + continue; + } + + if (tag === 82) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + + continue; + } + + break; + } + case 11: { + if (tag === 88) { + message.weakDependency.push(reader.int32()); + + continue; + } + + if (tag === 90) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + + continue; + } + + break; + } + case 4: { + if (tag !== 34) { + break; + } + + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.options = FileOptions.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.syntax = reader.string(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.edition = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + package: isSet(object.package) ? globalThis.String(object.package) : "", + dependency: globalThis.Array.isArray(object?.dependency) + ? object.dependency.map((e: any) => globalThis.String(e)) + : [], + publicDependency: globalThis.Array.isArray(object?.publicDependency) + ? object.publicDependency.map((e: any) => globalThis.Number(e)) + : [], + weakDependency: globalThis.Array.isArray(object?.weakDependency) + ? object.weakDependency.map((e: any) => globalThis.Number(e)) + : [], + messageType: globalThis.Array.isArray(object?.messageType) + ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: globalThis.Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + service: globalThis.Array.isArray(object?.service) + ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) + : [], + extension: globalThis.Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? FileOptions.fromJSON(object.options) : undefined, + sourceCodeInfo: isSet(object.sourceCodeInfo) ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) : undefined, + syntax: isSet(object.syntax) ? globalThis.String(object.syntax) : "", + edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, + }; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.package !== undefined && message.package !== "") { + obj.package = message.package; + } + if (message.dependency?.length) { + obj.dependency = message.dependency; + } + if (message.publicDependency?.length) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); + } + if (message.weakDependency?.length) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); + } + if (message.messageType?.length) { + obj.messageType = message.messageType.map((e) => DescriptorProto.toJSON(e)); + } + if (message.enumType?.length) { + obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + } + if (message.service?.length) { + obj.service = message.service.map((e) => ServiceDescriptorProto.toJSON(e)); + } + if (message.extension?.length) { + obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = FileOptions.toJSON(message.options); + } + if (message.sourceCodeInfo !== undefined) { + obj.sourceCodeInfo = SourceCodeInfo.toJSON(message.sourceCodeInfo); + } + if (message.syntax !== undefined && message.syntax !== "") { + obj.syntax = message.syntax; + } + if (message.edition !== undefined && message.edition !== 0) { + obj.edition = editionToJSON(message.edition); + } + return obj; + }, + + create(base?: DeepPartial): FileDescriptorProto { + return FileDescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ""; + message.package = object.package ?? ""; + message.dependency = object.dependency?.map((e) => e) || []; + message.publicDependency = object.publicDependency?.map((e) => e) || []; + message.weakDependency = object.weakDependency?.map((e) => e) || []; + message.messageType = object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.service = object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? FileOptions.fromPartial(object.options) + : undefined; + message.sourceCodeInfo = (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) + ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) + : undefined; + message.syntax = object.syntax ?? ""; + message.edition = object.edition ?? 0; + return message; + }, +}; + +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} + +export const DescriptorProto: MessageFns = { + encode(message: DescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).join(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).join(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).join(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).join(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).join(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).join(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.options = MessageOptions.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + field: globalThis.Array.isArray(object?.field) + ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + extension: globalThis.Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + nestedType: globalThis.Array.isArray(object?.nestedType) + ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: globalThis.Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + extensionRange: globalThis.Array.isArray(object?.extensionRange) + ? object.extensionRange.map((e: any) => DescriptorProto_ExtensionRange.fromJSON(e)) + : [], + oneofDecl: globalThis.Array.isArray(object?.oneofDecl) + ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? MessageOptions.fromJSON(object.options) : undefined, + reservedRange: globalThis.Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => DescriptorProto_ReservedRange.fromJSON(e)) + : [], + reservedName: globalThis.Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.field?.length) { + obj.field = message.field.map((e) => FieldDescriptorProto.toJSON(e)); + } + if (message.extension?.length) { + obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); + } + if (message.nestedType?.length) { + obj.nestedType = message.nestedType.map((e) => DescriptorProto.toJSON(e)); + } + if (message.enumType?.length) { + obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + } + if (message.extensionRange?.length) { + obj.extensionRange = message.extensionRange.map((e) => DescriptorProto_ExtensionRange.toJSON(e)); + } + if (message.oneofDecl?.length) { + obj.oneofDecl = message.oneofDecl.map((e) => OneofDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = MessageOptions.toJSON(message.options); + } + if (message.reservedRange?.length) { + obj.reservedRange = message.reservedRange.map((e) => DescriptorProto_ReservedRange.toJSON(e)); + } + if (message.reservedName?.length) { + obj.reservedName = message.reservedName; + } + return obj; + }, + + create(base?: DeepPartial): DescriptorProto { + return DescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ""; + message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = object.extensionRange?.map((e) => DescriptorProto_ExtensionRange.fromPartial(e)) || []; + message.oneofDecl = object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? MessageOptions.fromPartial(object.options) + : undefined; + message.reservedRange = object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} + +export const DescriptorProto_ExtensionRange: MessageFns = { + encode(message: DescriptorProto_ExtensionRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + return { + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + options: isSet(object.options) ? ExtensionRangeOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + if (message.options !== undefined) { + obj.options = ExtensionRangeOptions.toJSON(message.options); + } + return obj; + }, + + create(base?: DeepPartial): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = (object.options !== undefined && object.options !== null) + ? ExtensionRangeOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} + +export const DescriptorProto_ReservedRange: MessageFns = { + encode(message: DescriptorProto_ReservedRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + return { + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + }; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + return obj; + }, + + create(base?: DeepPartial): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [], declaration: [], features: undefined, verification: 1 }; +} + +export const ExtensionRangeOptions: MessageFns = { + encode(message: ExtensionRangeOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + for (const v of message.declaration) { + ExtensionRangeOptions_Declaration.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).join(); + } + if (message.verification !== undefined && message.verification !== 1) { + writer.uint32(24).int32(message.verification); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.declaration.push(ExtensionRangeOptions_Declaration.decode(reader, reader.uint32())); + continue; + } + case 50: { + if (tag !== 402) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.verification = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + return { + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + declaration: globalThis.Array.isArray(object?.declaration) + ? object.declaration.map((e: any) => ExtensionRangeOptions_Declaration.fromJSON(e)) + : [], + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + verification: isSet(object.verification) + ? extensionRangeOptions_VerificationStateFromJSON(object.verification) + : 1, + }; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + if (message.declaration?.length) { + obj.declaration = message.declaration.map((e) => ExtensionRangeOptions_Declaration.toJSON(e)); + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.verification !== undefined && message.verification !== 1) { + obj.verification = extensionRangeOptions_VerificationStateToJSON(message.verification); + } + return obj; + }, + + create(base?: DeepPartial): ExtensionRangeOptions { + return ExtensionRangeOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + message.declaration = object.declaration?.map((e) => ExtensionRangeOptions_Declaration.fromPartial(e)) || []; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.verification = object.verification ?? 1; + return message; + }, +}; + +function createBaseExtensionRangeOptions_Declaration(): ExtensionRangeOptions_Declaration { + return { number: 0, fullName: "", type: "", reserved: false, repeated: false }; +} + +export const ExtensionRangeOptions_Declaration: MessageFns = { + encode(message: ExtensionRangeOptions_Declaration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.number !== undefined && message.number !== 0) { + writer.uint32(8).int32(message.number); + } + if (message.fullName !== undefined && message.fullName !== "") { + writer.uint32(18).string(message.fullName); + } + if (message.type !== undefined && message.type !== "") { + writer.uint32(26).string(message.type); + } + if (message.reserved !== undefined && message.reserved !== false) { + writer.uint32(40).bool(message.reserved); + } + if (message.repeated !== undefined && message.repeated !== false) { + writer.uint32(48).bool(message.repeated); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExtensionRangeOptions_Declaration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions_Declaration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.number = reader.int32(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fullName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.type = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.reserved = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.repeated = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions_Declaration { + return { + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + fullName: isSet(object.fullName) ? globalThis.String(object.fullName) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + reserved: isSet(object.reserved) ? globalThis.Boolean(object.reserved) : false, + repeated: isSet(object.repeated) ? globalThis.Boolean(object.repeated) : false, + }; + }, + + toJSON(message: ExtensionRangeOptions_Declaration): unknown { + const obj: any = {}; + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.fullName !== undefined && message.fullName !== "") { + obj.fullName = message.fullName; + } + if (message.type !== undefined && message.type !== "") { + obj.type = message.type; + } + if (message.reserved !== undefined && message.reserved !== false) { + obj.reserved = message.reserved; + } + if (message.repeated !== undefined && message.repeated !== false) { + obj.repeated = message.repeated; + } + return obj; + }, + + create(base?: DeepPartial): ExtensionRangeOptions_Declaration { + return ExtensionRangeOptions_Declaration.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExtensionRangeOptions_Declaration { + const message = createBaseExtensionRangeOptions_Declaration(); + message.number = object.number ?? 0; + message.fullName = object.fullName ?? ""; + message.type = object.type ?? ""; + message.reserved = object.reserved ?? false; + message.repeated = object.repeated ?? false; + return message; + }, +}; + +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + options: undefined, + proto3Optional: false, + }; +} + +export const FieldDescriptorProto: MessageFns = { + encode(message: FieldDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== undefined && message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== undefined && message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== undefined && message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== undefined && message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== undefined && message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== undefined && message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== undefined && message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).join(); + } + if (message.proto3Optional !== undefined && message.proto3Optional !== false) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.number = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.label = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.type = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.typeName = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.extendee = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.defaultValue = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.oneofIndex = reader.int32(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.jsonName = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.options = FieldOptions.decode(reader, reader.uint32()); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.proto3Optional = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + label: isSet(object.label) ? fieldDescriptorProto_LabelFromJSON(object.label) : 1, + type: isSet(object.type) ? fieldDescriptorProto_TypeFromJSON(object.type) : 1, + typeName: isSet(object.typeName) ? globalThis.String(object.typeName) : "", + extendee: isSet(object.extendee) ? globalThis.String(object.extendee) : "", + defaultValue: isSet(object.defaultValue) ? globalThis.String(object.defaultValue) : "", + oneofIndex: isSet(object.oneofIndex) ? globalThis.Number(object.oneofIndex) : 0, + jsonName: isSet(object.jsonName) ? globalThis.String(object.jsonName) : "", + options: isSet(object.options) ? FieldOptions.fromJSON(object.options) : undefined, + proto3Optional: isSet(object.proto3Optional) ? globalThis.Boolean(object.proto3Optional) : false, + }; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.label !== undefined && message.label !== 1) { + obj.label = fieldDescriptorProto_LabelToJSON(message.label); + } + if (message.type !== undefined && message.type !== 1) { + obj.type = fieldDescriptorProto_TypeToJSON(message.type); + } + if (message.typeName !== undefined && message.typeName !== "") { + obj.typeName = message.typeName; + } + if (message.extendee !== undefined && message.extendee !== "") { + obj.extendee = message.extendee; + } + if (message.defaultValue !== undefined && message.defaultValue !== "") { + obj.defaultValue = message.defaultValue; + } + if (message.oneofIndex !== undefined && message.oneofIndex !== 0) { + obj.oneofIndex = Math.round(message.oneofIndex); + } + if (message.jsonName !== undefined && message.jsonName !== "") { + obj.jsonName = message.jsonName; + } + if (message.options !== undefined) { + obj.options = FieldOptions.toJSON(message.options); + } + if (message.proto3Optional !== undefined && message.proto3Optional !== false) { + obj.proto3Optional = message.proto3Optional; + } + return obj; + }, + + create(base?: DeepPartial): FieldDescriptorProto { + return FieldDescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ""; + message.extendee = object.extendee ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? FieldOptions.fromPartial(object.options) + : undefined; + message.proto3Optional = object.proto3Optional ?? false; + return message; + }, +}; + +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} + +export const OneofDescriptorProto: MessageFns = { + encode(message: OneofDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.options = OneofOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + options: isSet(object.options) ? OneofOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.options !== undefined) { + obj.options = OneofOptions.toJSON(message.options); + } + return obj; + }, + + create(base?: DeepPartial): OneofDescriptorProto { + return OneofDescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? OneofOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} + +export const EnumDescriptorProto: MessageFns = { + encode(message: EnumDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).join(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = EnumOptions.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + value: globalThis.Array.isArray(object?.value) + ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? EnumOptions.fromJSON(object.options) : undefined, + reservedRange: globalThis.Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => EnumDescriptorProto_EnumReservedRange.fromJSON(e)) + : [], + reservedName: globalThis.Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.value?.length) { + obj.value = message.value.map((e) => EnumValueDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = EnumOptions.toJSON(message.options); + } + if (message.reservedRange?.length) { + obj.reservedRange = message.reservedRange.map((e) => EnumDescriptorProto_EnumReservedRange.toJSON(e)); + } + if (message.reservedName?.length) { + obj.reservedName = message.reservedName; + } + return obj; + }, + + create(base?: DeepPartial): EnumDescriptorProto { + return EnumDescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ""; + message.value = object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? EnumOptions.fromPartial(object.options) + : undefined; + message.reservedRange = object.reservedRange?.map((e) => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || + []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} + +export const EnumDescriptorProto_EnumReservedRange: MessageFns = { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.start !== undefined && message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + return { + start: isSet(object.start) ? globalThis.Number(object.start) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + }; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + if (message.start !== undefined && message.start !== 0) { + obj.start = Math.round(message.start); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + return obj; + }, + + create(base?: DeepPartial): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} + +export const EnumValueDescriptorProto: MessageFns = { + encode(message: EnumValueDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== undefined && message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.number = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = EnumValueOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + number: isSet(object.number) ? globalThis.Number(object.number) : 0, + options: isSet(object.options) ? EnumValueOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.number !== undefined && message.number !== 0) { + obj.number = Math.round(message.number); + } + if (message.options !== undefined) { + obj.options = EnumValueOptions.toJSON(message.options); + } + return obj; + }, + + create(base?: DeepPartial): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.options = (object.options !== undefined && object.options !== null) + ? EnumValueOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} + +export const ServiceDescriptorProto: MessageFns = { + encode(message: ServiceDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.options = ServiceOptions.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + method: globalThis.Array.isArray(object?.method) + ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) ? ServiceOptions.fromJSON(object.options) : undefined, + }; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.method?.length) { + obj.method = message.method.map((e) => MethodDescriptorProto.toJSON(e)); + } + if (message.options !== undefined) { + obj.options = ServiceOptions.toJSON(message.options); + } + return obj; + }, + + create(base?: DeepPartial): ServiceDescriptorProto { + return ServiceDescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ""; + message.method = object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? ServiceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} + +export const MethodDescriptorProto: MessageFns = { + encode(message: MethodDescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== undefined && message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== undefined && message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== undefined && message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).join(); + } + if (message.clientStreaming !== undefined && message.clientStreaming !== false) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming !== undefined && message.serverStreaming !== false) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.inputType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.outputType = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.options = MethodOptions.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.clientStreaming = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.serverStreaming = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + inputType: isSet(object.inputType) ? globalThis.String(object.inputType) : "", + outputType: isSet(object.outputType) ? globalThis.String(object.outputType) : "", + options: isSet(object.options) ? MethodOptions.fromJSON(object.options) : undefined, + clientStreaming: isSet(object.clientStreaming) ? globalThis.Boolean(object.clientStreaming) : false, + serverStreaming: isSet(object.serverStreaming) ? globalThis.Boolean(object.serverStreaming) : false, + }; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + if (message.name !== undefined && message.name !== "") { + obj.name = message.name; + } + if (message.inputType !== undefined && message.inputType !== "") { + obj.inputType = message.inputType; + } + if (message.outputType !== undefined && message.outputType !== "") { + obj.outputType = message.outputType; + } + if (message.options !== undefined) { + obj.options = MethodOptions.toJSON(message.options); + } + if (message.clientStreaming !== undefined && message.clientStreaming !== false) { + obj.clientStreaming = message.clientStreaming; + } + if (message.serverStreaming !== undefined && message.serverStreaming !== false) { + obj.serverStreaming = message.serverStreaming; + } + return obj; + }, + + create(base?: DeepPartial): MethodDescriptorProto { + return MethodDescriptorProto.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ""; + message.inputType = object.inputType ?? ""; + message.outputType = object.outputType ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? MethodOptions.fromPartial(object.options) + : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, +}; + +function createBaseFileOptions(): FileOptions { + return { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + deprecated: false, + ccEnableArenas: true, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", + features: undefined, + uninterpretedOption: [], + }; +} + +export const FileOptions: MessageFns = { + encode(message: FileOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.javaPackage !== undefined && message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== undefined && message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== undefined && message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== undefined && message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== undefined && message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(402).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.javaPackage = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.javaOuterClassname = reader.string(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.javaMultipleFiles = reader.bool(); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.javaGenerateEqualsAndHash = reader.bool(); + continue; + } + case 27: { + if (tag !== 216) { + break; + } + + message.javaStringCheckUtf8 = reader.bool(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.optimizeFor = reader.int32() as any; + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.goPackage = reader.string(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.ccGenericServices = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.javaGenericServices = reader.bool(); + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.pyGenericServices = reader.bool(); + continue; + } + case 23: { + if (tag !== 184) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 31: { + if (tag !== 248) { + break; + } + + message.ccEnableArenas = reader.bool(); + continue; + } + case 36: { + if (tag !== 290) { + break; + } + + message.objcClassPrefix = reader.string(); + continue; + } + case 37: { + if (tag !== 298) { + break; + } + + message.csharpNamespace = reader.string(); + continue; + } + case 39: { + if (tag !== 314) { + break; + } + + message.swiftPrefix = reader.string(); + continue; + } + case 40: { + if (tag !== 322) { + break; + } + + message.phpClassPrefix = reader.string(); + continue; + } + case 41: { + if (tag !== 330) { + break; + } + + message.phpNamespace = reader.string(); + continue; + } + case 44: { + if (tag !== 354) { + break; + } + + message.phpMetadataNamespace = reader.string(); + continue; + } + case 45: { + if (tag !== 362) { + break; + } + + message.rubyPackage = reader.string(); + continue; + } + case 50: { + if (tag !== 402) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FileOptions { + return { + javaPackage: isSet(object.javaPackage) ? globalThis.String(object.javaPackage) : "", + javaOuterClassname: isSet(object.javaOuterClassname) ? globalThis.String(object.javaOuterClassname) : "", + javaMultipleFiles: isSet(object.javaMultipleFiles) ? globalThis.Boolean(object.javaMultipleFiles) : false, + javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) + ? globalThis.Boolean(object.javaGenerateEqualsAndHash) + : false, + javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) ? globalThis.Boolean(object.javaStringCheckUtf8) : false, + optimizeFor: isSet(object.optimizeFor) ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) : 1, + goPackage: isSet(object.goPackage) ? globalThis.String(object.goPackage) : "", + ccGenericServices: isSet(object.ccGenericServices) ? globalThis.Boolean(object.ccGenericServices) : false, + javaGenericServices: isSet(object.javaGenericServices) ? globalThis.Boolean(object.javaGenericServices) : false, + pyGenericServices: isSet(object.pyGenericServices) ? globalThis.Boolean(object.pyGenericServices) : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + ccEnableArenas: isSet(object.ccEnableArenas) ? globalThis.Boolean(object.ccEnableArenas) : true, + objcClassPrefix: isSet(object.objcClassPrefix) ? globalThis.String(object.objcClassPrefix) : "", + csharpNamespace: isSet(object.csharpNamespace) ? globalThis.String(object.csharpNamespace) : "", + swiftPrefix: isSet(object.swiftPrefix) ? globalThis.String(object.swiftPrefix) : "", + phpClassPrefix: isSet(object.phpClassPrefix) ? globalThis.String(object.phpClassPrefix) : "", + phpNamespace: isSet(object.phpNamespace) ? globalThis.String(object.phpNamespace) : "", + phpMetadataNamespace: isSet(object.phpMetadataNamespace) ? globalThis.String(object.phpMetadataNamespace) : "", + rubyPackage: isSet(object.rubyPackage) ? globalThis.String(object.rubyPackage) : "", + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + if (message.javaPackage !== undefined && message.javaPackage !== "") { + obj.javaPackage = message.javaPackage; + } + if (message.javaOuterClassname !== undefined && message.javaOuterClassname !== "") { + obj.javaOuterClassname = message.javaOuterClassname; + } + if (message.javaMultipleFiles !== undefined && message.javaMultipleFiles !== false) { + obj.javaMultipleFiles = message.javaMultipleFiles; + } + if (message.javaGenerateEqualsAndHash !== undefined && message.javaGenerateEqualsAndHash !== false) { + obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + } + if (message.javaStringCheckUtf8 !== undefined && message.javaStringCheckUtf8 !== false) { + obj.javaStringCheckUtf8 = message.javaStringCheckUtf8; + } + if (message.optimizeFor !== undefined && message.optimizeFor !== 1) { + obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor); + } + if (message.goPackage !== undefined && message.goPackage !== "") { + obj.goPackage = message.goPackage; + } + if (message.ccGenericServices !== undefined && message.ccGenericServices !== false) { + obj.ccGenericServices = message.ccGenericServices; + } + if (message.javaGenericServices !== undefined && message.javaGenericServices !== false) { + obj.javaGenericServices = message.javaGenericServices; + } + if (message.pyGenericServices !== undefined && message.pyGenericServices !== false) { + obj.pyGenericServices = message.pyGenericServices; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.ccEnableArenas !== undefined && message.ccEnableArenas !== true) { + obj.ccEnableArenas = message.ccEnableArenas; + } + if (message.objcClassPrefix !== undefined && message.objcClassPrefix !== "") { + obj.objcClassPrefix = message.objcClassPrefix; + } + if (message.csharpNamespace !== undefined && message.csharpNamespace !== "") { + obj.csharpNamespace = message.csharpNamespace; + } + if (message.swiftPrefix !== undefined && message.swiftPrefix !== "") { + obj.swiftPrefix = message.swiftPrefix; + } + if (message.phpClassPrefix !== undefined && message.phpClassPrefix !== "") { + obj.phpClassPrefix = message.phpClassPrefix; + } + if (message.phpNamespace !== undefined && message.phpNamespace !== "") { + obj.phpNamespace = message.phpNamespace; + } + if (message.phpMetadataNamespace !== undefined && message.phpMetadataNamespace !== "") { + obj.phpMetadataNamespace = message.phpMetadataNamespace; + } + if (message.rubyPackage !== undefined && message.rubyPackage !== "") { + obj.rubyPackage = message.rubyPackage; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): FileOptions { + return FileOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ""; + message.javaOuterClassname = object.javaOuterClassname ?? ""; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ""; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? true; + message.objcClassPrefix = object.objcClassPrefix ?? ""; + message.csharpNamespace = object.csharpNamespace ?? ""; + message.swiftPrefix = object.swiftPrefix ?? ""; + message.phpClassPrefix = object.phpClassPrefix ?? ""; + message.phpNamespace = object.phpNamespace ?? ""; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; + message.rubyPackage = object.rubyPackage ?? ""; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [], + }; +} + +export const MessageOptions: MessageFns = { + encode(message: MessageOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry !== undefined && message.mapEntry !== false) { + writer.uint32(56).bool(message.mapEntry); + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(98).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.messageSetWireFormat = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.noStandardDescriptorAccessor = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.mapEntry = reader.bool(); + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MessageOptions { + return { + messageSetWireFormat: isSet(object.messageSetWireFormat) + ? globalThis.Boolean(object.messageSetWireFormat) + : false, + noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) + ? globalThis.Boolean(object.noStandardDescriptorAccessor) + : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + mapEntry: isSet(object.mapEntry) ? globalThis.Boolean(object.mapEntry) : false, + deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) + ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) + : false, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + if (message.messageSetWireFormat !== undefined && message.messageSetWireFormat !== false) { + obj.messageSetWireFormat = message.messageSetWireFormat; + } + if (message.noStandardDescriptorAccessor !== undefined && message.noStandardDescriptorAccessor !== false) { + obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.mapEntry !== undefined && message.mapEntry !== false) { + obj.mapEntry = message.mapEntry; + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): MessageOptions { + return MessageOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + debugRedact: false, + retention: 0, + targets: [], + editionDefaults: [], + features: undefined, + featureSupport: undefined, + uninterpretedOption: [], + }; +} + +export const FieldOptions: MessageFns = { + encode(message: FieldOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.ctype !== undefined && message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed !== undefined && message.packed !== false) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== undefined && message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy !== undefined && message.lazy !== false) { + writer.uint32(40).bool(message.lazy); + } + if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) { + writer.uint32(120).bool(message.unverifiedLazy); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak !== undefined && message.weak !== false) { + writer.uint32(80).bool(message.weak); + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + writer.uint32(128).bool(message.debugRedact); + } + if (message.retention !== undefined && message.retention !== 0) { + writer.uint32(136).int32(message.retention); + } + for (const v of message.targets) { + writer.uint32(152).int32(v!); + } + for (const v of message.editionDefaults) { + FieldOptions_EditionDefault.encode(v!, writer.uint32(162).fork()).join(); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(170).fork()).join(); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.ctype = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.packed = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.jstype = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.lazy = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.unverifiedLazy = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.weak = reader.bool(); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.debugRedact = reader.bool(); + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.retention = reader.int32() as any; + continue; + } + case 19: { + if (tag === 152) { + message.targets.push(reader.int32() as any); + + continue; + } + + if (tag === 154) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.targets.push(reader.int32() as any); + } + + continue; + } + + break; + } + case 20: { + if (tag !== 162) { + break; + } + + message.editionDefaults.push(FieldOptions_EditionDefault.decode(reader, reader.uint32())); + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 22: { + if (tag !== 178) { + break; + } + + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldOptions { + return { + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + packed: isSet(object.packed) ? globalThis.Boolean(object.packed) : false, + jstype: isSet(object.jstype) ? fieldOptions_JSTypeFromJSON(object.jstype) : 0, + lazy: isSet(object.lazy) ? globalThis.Boolean(object.lazy) : false, + unverifiedLazy: isSet(object.unverifiedLazy) ? globalThis.Boolean(object.unverifiedLazy) : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + weak: isSet(object.weak) ? globalThis.Boolean(object.weak) : false, + debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, + retention: isSet(object.retention) ? fieldOptions_OptionRetentionFromJSON(object.retention) : 0, + targets: globalThis.Array.isArray(object?.targets) + ? object.targets.map((e: any) => fieldOptions_OptionTargetTypeFromJSON(e)) + : [], + editionDefaults: globalThis.Array.isArray(object?.editionDefaults) + ? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e)) + : [], + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + featureSupport: isSet(object.featureSupport) + ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport) + : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + if (message.ctype !== undefined && message.ctype !== 0) { + obj.ctype = fieldOptions_CTypeToJSON(message.ctype); + } + if (message.packed !== undefined && message.packed !== false) { + obj.packed = message.packed; + } + if (message.jstype !== undefined && message.jstype !== 0) { + obj.jstype = fieldOptions_JSTypeToJSON(message.jstype); + } + if (message.lazy !== undefined && message.lazy !== false) { + obj.lazy = message.lazy; + } + if (message.unverifiedLazy !== undefined && message.unverifiedLazy !== false) { + obj.unverifiedLazy = message.unverifiedLazy; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.weak !== undefined && message.weak !== false) { + obj.weak = message.weak; + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + obj.debugRedact = message.debugRedact; + } + if (message.retention !== undefined && message.retention !== 0) { + obj.retention = fieldOptions_OptionRetentionToJSON(message.retention); + } + if (message.targets?.length) { + obj.targets = message.targets.map((e) => fieldOptions_OptionTargetTypeToJSON(e)); + } + if (message.editionDefaults?.length) { + obj.editionDefaults = message.editionDefaults.map((e) => FieldOptions_EditionDefault.toJSON(e)); + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.featureSupport !== undefined) { + obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): FieldOptions { + return FieldOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 0; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 0; + message.lazy = object.lazy ?? false; + message.unverifiedLazy = object.unverifiedLazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.debugRedact = object.debugRedact ?? false; + message.retention = object.retention ?? 0; + message.targets = object.targets?.map((e) => e) || []; + message.editionDefaults = object.editionDefaults?.map((e) => FieldOptions_EditionDefault.fromPartial(e)) || []; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null) + ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFieldOptions_EditionDefault(): FieldOptions_EditionDefault { + return { edition: 0, value: "" }; +} + +export const FieldOptions_EditionDefault: MessageFns = { + encode(message: FieldOptions_EditionDefault, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.edition !== undefined && message.edition !== 0) { + writer.uint32(24).int32(message.edition); + } + if (message.value !== undefined && message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_EditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_EditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 24) { + break; + } + + message.edition = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldOptions_EditionDefault { + return { + edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: FieldOptions_EditionDefault): unknown { + const obj: any = {}; + if (message.edition !== undefined && message.edition !== 0) { + obj.edition = editionToJSON(message.edition); + } + if (message.value !== undefined && message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): FieldOptions_EditionDefault { + return FieldOptions_EditionDefault.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FieldOptions_EditionDefault { + const message = createBaseFieldOptions_EditionDefault(); + message.edition = object.edition ?? 0; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport { + return { editionIntroduced: 0, editionDeprecated: 0, deprecationWarning: "", editionRemoved: 0 }; +} + +export const FieldOptions_FeatureSupport: MessageFns = { + encode(message: FieldOptions_FeatureSupport, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.editionIntroduced !== undefined && message.editionIntroduced !== 0) { + writer.uint32(8).int32(message.editionIntroduced); + } + if (message.editionDeprecated !== undefined && message.editionDeprecated !== 0) { + writer.uint32(16).int32(message.editionDeprecated); + } + if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") { + writer.uint32(26).string(message.deprecationWarning); + } + if (message.editionRemoved !== undefined && message.editionRemoved !== 0) { + writer.uint32(32).int32(message.editionRemoved); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldOptions_FeatureSupport { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions_FeatureSupport(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.editionIntroduced = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.editionDeprecated = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.deprecationWarning = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.editionRemoved = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldOptions_FeatureSupport { + return { + editionIntroduced: isSet(object.editionIntroduced) ? editionFromJSON(object.editionIntroduced) : 0, + editionDeprecated: isSet(object.editionDeprecated) ? editionFromJSON(object.editionDeprecated) : 0, + deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "", + editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : 0, + }; + }, + + toJSON(message: FieldOptions_FeatureSupport): unknown { + const obj: any = {}; + if (message.editionIntroduced !== undefined && message.editionIntroduced !== 0) { + obj.editionIntroduced = editionToJSON(message.editionIntroduced); + } + if (message.editionDeprecated !== undefined && message.editionDeprecated !== 0) { + obj.editionDeprecated = editionToJSON(message.editionDeprecated); + } + if (message.deprecationWarning !== undefined && message.deprecationWarning !== "") { + obj.deprecationWarning = message.deprecationWarning; + } + if (message.editionRemoved !== undefined && message.editionRemoved !== 0) { + obj.editionRemoved = editionToJSON(message.editionRemoved); + } + return obj; + }, + + create(base?: DeepPartial): FieldOptions_FeatureSupport { + return FieldOptions_FeatureSupport.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FieldOptions_FeatureSupport { + const message = createBaseFieldOptions_FeatureSupport(); + message.editionIntroduced = object.editionIntroduced ?? 0; + message.editionDeprecated = object.editionDeprecated ?? 0; + message.deprecationWarning = object.deprecationWarning ?? ""; + message.editionRemoved = object.editionRemoved ?? 0; + return message; + }, +}; + +function createBaseOneofOptions(): OneofOptions { + return { features: undefined, uninterpretedOption: [] }; +} + +export const OneofOptions: MessageFns = { + encode(message: OneofOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(10).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): OneofOptions { + return { + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): OneofOptions { + return OneofOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): OneofOptions { + const message = createBaseOneofOptions(); + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEnumOptions(): EnumOptions { + return { + allowAlias: false, + deprecated: false, + deprecatedLegacyJsonFieldConflicts: false, + features: undefined, + uninterpretedOption: [], + }; +} + +export const EnumOptions: MessageFns = { + encode(message: EnumOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.allowAlias !== undefined && message.allowAlias !== false) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(24).bool(message.deprecated); + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(58).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 16) { + break; + } + + message.allowAlias = reader.bool(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumOptions { + return { + allowAlias: isSet(object.allowAlias) ? globalThis.Boolean(object.allowAlias) : false, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + deprecatedLegacyJsonFieldConflicts: isSet(object.deprecatedLegacyJsonFieldConflicts) + ? globalThis.Boolean(object.deprecatedLegacyJsonFieldConflicts) + : false, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + if (message.allowAlias !== undefined && message.allowAlias !== false) { + obj.allowAlias = message.allowAlias; + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if ( + message.deprecatedLegacyJsonFieldConflicts !== undefined && message.deprecatedLegacyJsonFieldConflicts !== false + ) { + obj.deprecatedLegacyJsonFieldConflicts = message.deprecatedLegacyJsonFieldConflicts; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): EnumOptions { + return EnumOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEnumValueOptions(): EnumValueOptions { + return { + deprecated: false, + features: undefined, + debugRedact: false, + featureSupport: undefined, + uninterpretedOption: [], + }; +} + +export const EnumValueOptions: MessageFns = { + encode(message: EnumValueOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(8).bool(message.deprecated); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(18).fork()).join(); + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + writer.uint32(24).bool(message.debugRedact); + } + if (message.featureSupport !== undefined) { + FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(34).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.debugRedact = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + return { + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + debugRedact: isSet(object.debugRedact) ? globalThis.Boolean(object.debugRedact) : false, + featureSupport: isSet(object.featureSupport) + ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport) + : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.debugRedact !== undefined && message.debugRedact !== false) { + obj.debugRedact = message.debugRedact; + } + if (message.featureSupport !== undefined) { + obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): EnumValueOptions { + return EnumValueOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.debugRedact = object.debugRedact ?? false; + message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null) + ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseServiceOptions(): ServiceOptions { + return { features: undefined, deprecated: false, uninterpretedOption: [] }; +} + +export const ServiceOptions: MessageFns = { + encode(message: ServiceOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(274).fork()).join(); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 34: { + if (tag !== 274) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 33: { + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + return { + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ServiceOptions { + return ServiceOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ServiceOptions { + const message = createBaseServiceOptions(); + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, features: undefined, uninterpretedOption: [] }; +} + +export const MethodOptions: MessageFns = { + encode(message: MethodOptions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.deprecated !== undefined && message.deprecated !== false) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); + } + if (message.features !== undefined) { + FeatureSet.encode(message.features, writer.uint32(282).fork()).join(); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 34: { + if (tag !== 272) { + break; + } + + message.idempotencyLevel = reader.int32() as any; + continue; + } + case 35: { + if (tag !== 282) { + break; + } + + message.features = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 999: { + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MethodOptions { + return { + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + idempotencyLevel: isSet(object.idempotencyLevel) + ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) + : 0, + features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined, + uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)) + : [], + }; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + if (message.deprecated !== undefined && message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.idempotencyLevel !== undefined && message.idempotencyLevel !== 0) { + obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON(message.idempotencyLevel); + } + if (message.features !== undefined) { + obj.features = FeatureSet.toJSON(message.features); + } + if (message.uninterpretedOption?.length) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): MethodOptions { + return MethodOptions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 0; + message.features = (object.features !== undefined && object.features !== null) + ? FeatureSet.fromPartial(object.features) + : undefined; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: Long.UZERO, + negativeIntValue: Long.ZERO, + doubleValue: 0, + stringValue: Buffer.alloc(0), + aggregateValue: "", + }; +} + +export const UninterpretedOption: MessageFns = { + encode(message: UninterpretedOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.identifierValue !== undefined && message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (message.positiveIntValue !== undefined && !message.positiveIntValue.equals(Long.UZERO)) { + writer.uint32(32).uint64(message.positiveIntValue.toString()); + } + if (message.negativeIntValue !== undefined && !message.negativeIntValue.equals(Long.ZERO)) { + writer.uint32(40).int64(message.negativeIntValue.toString()); + } + if (message.doubleValue !== undefined && message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue !== undefined && message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== undefined && message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (tag !== 18) { + break; + } + + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.identifierValue = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.positiveIntValue = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.negativeIntValue = Long.fromString(reader.int64().toString()); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.doubleValue = reader.double(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.stringValue = Buffer.from(reader.bytes()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.aggregateValue = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + return { + name: globalThis.Array.isArray(object?.name) + ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) + : [], + identifierValue: isSet(object.identifierValue) ? globalThis.String(object.identifierValue) : "", + positiveIntValue: isSet(object.positiveIntValue) ? Long.fromValue(object.positiveIntValue) : Long.UZERO, + negativeIntValue: isSet(object.negativeIntValue) ? Long.fromValue(object.negativeIntValue) : Long.ZERO, + doubleValue: isSet(object.doubleValue) ? globalThis.Number(object.doubleValue) : 0, + stringValue: isSet(object.stringValue) ? Buffer.from(bytesFromBase64(object.stringValue)) : Buffer.alloc(0), + aggregateValue: isSet(object.aggregateValue) ? globalThis.String(object.aggregateValue) : "", + }; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name?.length) { + obj.name = message.name.map((e) => UninterpretedOption_NamePart.toJSON(e)); + } + if (message.identifierValue !== undefined && message.identifierValue !== "") { + obj.identifierValue = message.identifierValue; + } + if (message.positiveIntValue !== undefined && !message.positiveIntValue.equals(Long.UZERO)) { + obj.positiveIntValue = (message.positiveIntValue || Long.UZERO).toString(); + } + if (message.negativeIntValue !== undefined && !message.negativeIntValue.equals(Long.ZERO)) { + obj.negativeIntValue = (message.negativeIntValue || Long.ZERO).toString(); + } + if (message.doubleValue !== undefined && message.doubleValue !== 0) { + obj.doubleValue = message.doubleValue; + } + if (message.stringValue !== undefined && message.stringValue.length !== 0) { + obj.stringValue = base64FromBytes(message.stringValue); + } + if (message.aggregateValue !== undefined && message.aggregateValue !== "") { + obj.aggregateValue = message.aggregateValue; + } + return obj; + }, + + create(base?: DeepPartial): UninterpretedOption { + return UninterpretedOption.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || []; + message.identifierValue = object.identifierValue ?? ""; + message.positiveIntValue = (object.positiveIntValue !== undefined && object.positiveIntValue !== null) + ? Long.fromValue(object.positiveIntValue) + : Long.UZERO; + message.negativeIntValue = (object.negativeIntValue !== undefined && object.negativeIntValue !== null) + ? Long.fromValue(object.negativeIntValue) + : Long.ZERO; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? Buffer.alloc(0); + message.aggregateValue = object.aggregateValue ?? ""; + return message; + }, +}; + +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} + +export const UninterpretedOption_NamePart: MessageFns = { + encode(message: UninterpretedOption_NamePart, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension !== false) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.namePart = reader.string(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.isExtension = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + return { + namePart: isSet(object.namePart) ? globalThis.String(object.namePart) : "", + isExtension: isSet(object.isExtension) ? globalThis.Boolean(object.isExtension) : false, + }; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + if (message.namePart !== "") { + obj.namePart = message.namePart; + } + if (message.isExtension !== false) { + obj.isExtension = message.isExtension; + } + return obj; + }, + + create(base?: DeepPartial): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; + return message; + }, +}; + +function createBaseFeatureSet(): FeatureSet { + return { + fieldPresence: 0, + enumType: 0, + repeatedFieldEncoding: 0, + utf8Validation: 0, + messageEncoding: 0, + jsonFormat: 0, + }; +} + +export const FeatureSet: MessageFns = { + encode(message: FeatureSet, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { + writer.uint32(8).int32(message.fieldPresence); + } + if (message.enumType !== undefined && message.enumType !== 0) { + writer.uint32(16).int32(message.enumType); + } + if (message.repeatedFieldEncoding !== undefined && message.repeatedFieldEncoding !== 0) { + writer.uint32(24).int32(message.repeatedFieldEncoding); + } + if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { + writer.uint32(32).int32(message.utf8Validation); + } + if (message.messageEncoding !== undefined && message.messageEncoding !== 0) { + writer.uint32(40).int32(message.messageEncoding); + } + if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { + writer.uint32(48).int32(message.jsonFormat); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.fieldPresence = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.enumType = reader.int32() as any; + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.repeatedFieldEncoding = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.utf8Validation = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.messageEncoding = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.jsonFormat = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FeatureSet { + return { + fieldPresence: isSet(object.fieldPresence) ? featureSet_FieldPresenceFromJSON(object.fieldPresence) : 0, + enumType: isSet(object.enumType) ? featureSet_EnumTypeFromJSON(object.enumType) : 0, + repeatedFieldEncoding: isSet(object.repeatedFieldEncoding) + ? featureSet_RepeatedFieldEncodingFromJSON(object.repeatedFieldEncoding) + : 0, + utf8Validation: isSet(object.utf8Validation) ? featureSet_Utf8ValidationFromJSON(object.utf8Validation) : 0, + messageEncoding: isSet(object.messageEncoding) ? featureSet_MessageEncodingFromJSON(object.messageEncoding) : 0, + jsonFormat: isSet(object.jsonFormat) ? featureSet_JsonFormatFromJSON(object.jsonFormat) : 0, + }; + }, + + toJSON(message: FeatureSet): unknown { + const obj: any = {}; + if (message.fieldPresence !== undefined && message.fieldPresence !== 0) { + obj.fieldPresence = featureSet_FieldPresenceToJSON(message.fieldPresence); + } + if (message.enumType !== undefined && message.enumType !== 0) { + obj.enumType = featureSet_EnumTypeToJSON(message.enumType); + } + if (message.repeatedFieldEncoding !== undefined && message.repeatedFieldEncoding !== 0) { + obj.repeatedFieldEncoding = featureSet_RepeatedFieldEncodingToJSON(message.repeatedFieldEncoding); + } + if (message.utf8Validation !== undefined && message.utf8Validation !== 0) { + obj.utf8Validation = featureSet_Utf8ValidationToJSON(message.utf8Validation); + } + if (message.messageEncoding !== undefined && message.messageEncoding !== 0) { + obj.messageEncoding = featureSet_MessageEncodingToJSON(message.messageEncoding); + } + if (message.jsonFormat !== undefined && message.jsonFormat !== 0) { + obj.jsonFormat = featureSet_JsonFormatToJSON(message.jsonFormat); + } + return obj; + }, + + create(base?: DeepPartial): FeatureSet { + return FeatureSet.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FeatureSet { + const message = createBaseFeatureSet(); + message.fieldPresence = object.fieldPresence ?? 0; + message.enumType = object.enumType ?? 0; + message.repeatedFieldEncoding = object.repeatedFieldEncoding ?? 0; + message.utf8Validation = object.utf8Validation ?? 0; + message.messageEncoding = object.messageEncoding ?? 0; + message.jsonFormat = object.jsonFormat ?? 0; + return message; + }, +}; + +function createBaseFeatureSetDefaults(): FeatureSetDefaults { + return { defaults: [], minimumEdition: 0, maximumEdition: 0 }; +} + +export const FeatureSetDefaults: MessageFns = { + encode(message: FeatureSetDefaults, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.defaults) { + FeatureSetDefaults_FeatureSetEditionDefault.encode(v!, writer.uint32(10).fork()).join(); + } + if (message.minimumEdition !== undefined && message.minimumEdition !== 0) { + writer.uint32(32).int32(message.minimumEdition); + } + if (message.maximumEdition !== undefined && message.maximumEdition !== 0) { + writer.uint32(40).int32(message.maximumEdition); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.minimumEdition = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.maximumEdition = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FeatureSetDefaults { + return { + defaults: globalThis.Array.isArray(object?.defaults) + ? object.defaults.map((e: any) => FeatureSetDefaults_FeatureSetEditionDefault.fromJSON(e)) + : [], + minimumEdition: isSet(object.minimumEdition) ? editionFromJSON(object.minimumEdition) : 0, + maximumEdition: isSet(object.maximumEdition) ? editionFromJSON(object.maximumEdition) : 0, + }; + }, + + toJSON(message: FeatureSetDefaults): unknown { + const obj: any = {}; + if (message.defaults?.length) { + obj.defaults = message.defaults.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.toJSON(e)); + } + if (message.minimumEdition !== undefined && message.minimumEdition !== 0) { + obj.minimumEdition = editionToJSON(message.minimumEdition); + } + if (message.maximumEdition !== undefined && message.maximumEdition !== 0) { + obj.maximumEdition = editionToJSON(message.maximumEdition); + } + return obj; + }, + + create(base?: DeepPartial): FeatureSetDefaults { + return FeatureSetDefaults.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FeatureSetDefaults { + const message = createBaseFeatureSetDefaults(); + message.defaults = object.defaults?.map((e) => FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(e)) || []; + message.minimumEdition = object.minimumEdition ?? 0; + message.maximumEdition = object.maximumEdition ?? 0; + return message; + }, +}; + +function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault { + return { edition: 0, overridableFeatures: undefined, fixedFeatures: undefined }; +} + +export const FeatureSetDefaults_FeatureSetEditionDefault: MessageFns = { + encode( + message: FeatureSetDefaults_FeatureSetEditionDefault, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.edition !== undefined && message.edition !== 0) { + writer.uint32(24).int32(message.edition); + } + if (message.overridableFeatures !== undefined) { + FeatureSet.encode(message.overridableFeatures, writer.uint32(34).fork()).join(); + } + if (message.fixedFeatures !== undefined) { + FeatureSet.encode(message.fixedFeatures, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FeatureSetDefaults_FeatureSetEditionDefault { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 24) { + break; + } + + message.edition = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.overridableFeatures = FeatureSet.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.fixedFeatures = FeatureSet.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FeatureSetDefaults_FeatureSetEditionDefault { + return { + edition: isSet(object.edition) ? editionFromJSON(object.edition) : 0, + overridableFeatures: isSet(object.overridableFeatures) + ? FeatureSet.fromJSON(object.overridableFeatures) + : undefined, + fixedFeatures: isSet(object.fixedFeatures) ? FeatureSet.fromJSON(object.fixedFeatures) : undefined, + }; + }, + + toJSON(message: FeatureSetDefaults_FeatureSetEditionDefault): unknown { + const obj: any = {}; + if (message.edition !== undefined && message.edition !== 0) { + obj.edition = editionToJSON(message.edition); + } + if (message.overridableFeatures !== undefined) { + obj.overridableFeatures = FeatureSet.toJSON(message.overridableFeatures); + } + if (message.fixedFeatures !== undefined) { + obj.fixedFeatures = FeatureSet.toJSON(message.fixedFeatures); + } + return obj; + }, + + create(base?: DeepPartial): FeatureSetDefaults_FeatureSetEditionDefault { + return FeatureSetDefaults_FeatureSetEditionDefault.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): FeatureSetDefaults_FeatureSetEditionDefault { + const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault(); + message.edition = object.edition ?? 0; + message.overridableFeatures = (object.overridableFeatures !== undefined && object.overridableFeatures !== null) + ? FeatureSet.fromPartial(object.overridableFeatures) + : undefined; + message.fixedFeatures = (object.fixedFeatures !== undefined && object.fixedFeatures !== null) + ? FeatureSet.fromPartial(object.fixedFeatures) + : undefined; + return message; + }, +}; + +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} + +export const SourceCodeInfo: MessageFns = { + encode(message: SourceCodeInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + return { + location: globalThis.Array.isArray(object?.location) + ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location?.length) { + obj.location = message.location.map((e) => SourceCodeInfo_Location.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): SourceCodeInfo { + return SourceCodeInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} + +export const SourceCodeInfo_Location: MessageFns = { + encode(message: SourceCodeInfo_Location, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.join(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.join(); + if (message.leadingComments !== undefined && message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== undefined && message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + } + case 2: { + if (tag === 16) { + message.span.push(reader.int32()); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + + continue; + } + + break; + } + case 3: { + if (tag !== 26) { + break; + } + + message.leadingComments = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.trailingComments = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.leadingDetachedComments.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + return { + path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.Number(e)) : [], + span: globalThis.Array.isArray(object?.span) ? object.span.map((e: any) => globalThis.Number(e)) : [], + leadingComments: isSet(object.leadingComments) ? globalThis.String(object.leadingComments) : "", + trailingComments: isSet(object.trailingComments) ? globalThis.String(object.trailingComments) : "", + leadingDetachedComments: globalThis.Array.isArray(object?.leadingDetachedComments) + ? object.leadingDetachedComments.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path?.length) { + obj.path = message.path.map((e) => Math.round(e)); + } + if (message.span?.length) { + obj.span = message.span.map((e) => Math.round(e)); + } + if (message.leadingComments !== undefined && message.leadingComments !== "") { + obj.leadingComments = message.leadingComments; + } + if (message.trailingComments !== undefined && message.trailingComments !== "") { + obj.trailingComments = message.trailingComments; + } + if (message.leadingDetachedComments?.length) { + obj.leadingDetachedComments = message.leadingDetachedComments; + } + return obj; + }, + + create(base?: DeepPartial): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map((e) => e) || []; + message.span = object.span?.map((e) => e) || []; + message.leadingComments = object.leadingComments ?? ""; + message.trailingComments = object.trailingComments ?? ""; + message.leadingDetachedComments = object.leadingDetachedComments?.map((e) => e) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} + +export const GeneratedCodeInfo: MessageFns = { + encode(message: GeneratedCodeInfo, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + return { + annotation: globalThis.Array.isArray(object?.annotation) + ? object.annotation.map((e: any) => GeneratedCodeInfo_Annotation.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation?.length) { + obj.annotation = message.annotation.map((e) => GeneratedCodeInfo_Annotation.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): GeneratedCodeInfo { + return GeneratedCodeInfo.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 }; +} + +export const GeneratedCodeInfo_Annotation: MessageFns = { + encode(message: GeneratedCodeInfo_Annotation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.join(); + if (message.sourceFile !== undefined && message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== undefined && message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== undefined && message.end !== 0) { + writer.uint32(32).int32(message.end); + } + if (message.semantic !== undefined && message.semantic !== 0) { + writer.uint32(40).int32(message.semantic); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + } + case 2: { + if (tag !== 18) { + break; + } + + message.sourceFile = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.begin = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.end = reader.int32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.semantic = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + return { + path: globalThis.Array.isArray(object?.path) ? object.path.map((e: any) => globalThis.Number(e)) : [], + sourceFile: isSet(object.sourceFile) ? globalThis.String(object.sourceFile) : "", + begin: isSet(object.begin) ? globalThis.Number(object.begin) : 0, + end: isSet(object.end) ? globalThis.Number(object.end) : 0, + semantic: isSet(object.semantic) ? generatedCodeInfo_Annotation_SemanticFromJSON(object.semantic) : 0, + }; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path?.length) { + obj.path = message.path.map((e) => Math.round(e)); + } + if (message.sourceFile !== undefined && message.sourceFile !== "") { + obj.sourceFile = message.sourceFile; + } + if (message.begin !== undefined && message.begin !== 0) { + obj.begin = Math.round(message.begin); + } + if (message.end !== undefined && message.end !== 0) { + obj.end = Math.round(message.end); + } + if (message.semantic !== undefined && message.semantic !== 0) { + obj.semantic = generatedCodeInfo_Annotation_SemanticToJSON(message.semantic); + } + return obj; + }, + + create(base?: DeepPartial): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map((e) => e) || []; + message.sourceFile = object.sourceFile ?? ""; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + message.semantic = object.semantic ?? 0; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/protobuf/duration.ts b/src/grpc/generated/google/protobuf/duration.ts new file mode 100644 index 0000000..b4c5aeb --- /dev/null +++ b/src/grpc/generated/google/protobuf/duration.ts @@ -0,0 +1,189 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/protobuf/duration.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: Long; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} + +function createBaseDuration(): Duration { + return { seconds: Long.ZERO, nanos: 0 }; +} + +export const Duration: MessageFns = { + encode(message: Duration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.seconds.equals(Long.ZERO)) { + writer.uint32(8).int64(message.seconds.toString()); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Duration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.seconds = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.nanos = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Duration { + return { + seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, + nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0, + }; + }, + + toJSON(message: Duration): unknown { + const obj: any = {}; + if (!message.seconds.equals(Long.ZERO)) { + obj.seconds = (message.seconds || Long.ZERO).toString(); + } + if (message.nanos !== 0) { + obj.nanos = Math.round(message.nanos); + } + return obj; + }, + + create(base?: DeepPartial): Duration { + return Duration.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Duration { + const message = createBaseDuration(); + message.seconds = (object.seconds !== undefined && object.seconds !== null) + ? Long.fromValue(object.seconds) + : Long.ZERO; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/protobuf/empty.ts b/src/grpc/generated/google/protobuf/empty.ts new file mode 100644 index 0000000..94d498c --- /dev/null +++ b/src/grpc/generated/google/protobuf/empty.ts @@ -0,0 +1,84 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/protobuf/empty.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "google.protobuf"; + +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + */ +export interface Empty { +} + +function createBaseEmpty(): Empty { + return {}; +} + +export const Empty: MessageFns = { + encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Empty { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEmpty(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): Empty { + return {}; + }, + + toJSON(_: Empty): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): Empty { + return Empty.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): Empty { + const message = createBaseEmpty(); + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/google/protobuf/struct.ts b/src/grpc/generated/google/protobuf/struct.ts new file mode 100644 index 0000000..9de517e --- /dev/null +++ b/src/grpc/generated/google/protobuf/struct.ts @@ -0,0 +1,615 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/protobuf/struct.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "google.protobuf"; + +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + */ +export enum NullValue { + /** NULL_VALUE - Null value. */ + NULL_VALUE = 0, + UNRECOGNIZED = -1, +} + +export function nullValueFromJSON(object: any): NullValue { + switch (object) { + case 0: + case "NULL_VALUE": + return NullValue.NULL_VALUE; + case -1: + case "UNRECOGNIZED": + default: + return NullValue.UNRECOGNIZED; + } +} + +export function nullValueToJSON(object: NullValue): string { + switch (object) { + case NullValue.NULL_VALUE: + return "NULL_VALUE"; + case NullValue.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * `Struct` represents a structured data value, consisting of fields + * which map to dynamically typed values. In some languages, `Struct` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + */ +export interface Struct { + /** Unordered map of dynamically typed values. */ + fields: { [key: string]: any | undefined }; +} + +export interface Struct_FieldsEntry { + key: string; + value: any | undefined; +} + +/** + * `Value` represents a dynamically typed value which can be either + * null, a number, a string, a boolean, a recursive struct value, or a + * list of values. A producer of value is expected to set one of these + * variants. Absence of any variant indicates an error. + * + * The JSON representation for `Value` is JSON value. + */ +export interface Value { + /** The kind of value. */ + kind?: + | // + /** Represents a null value. */ + { $case: "nullValue"; nullValue: NullValue } + | // + /** Represents a double value. */ + { $case: "numberValue"; numberValue: number } + | // + /** Represents a string value. */ + { $case: "stringValue"; stringValue: string } + | // + /** Represents a boolean value. */ + { $case: "boolValue"; boolValue: boolean } + | // + /** Represents a structured value. */ + { $case: "structValue"; structValue: { [key: string]: any } | undefined } + | // + /** Represents a repeated `Value`. */ + { $case: "listValue"; listValue: Array | undefined } + | undefined; +} + +/** + * `ListValue` is a wrapper around a repeated field of values. + * + * The JSON representation for `ListValue` is JSON array. + */ +export interface ListValue { + /** Repeated field of dynamically typed values. */ + values: any[]; +} + +function createBaseStruct(): Struct { + return { fields: {} }; +} + +export const Struct: MessageFns & StructWrapperFns = { + encode(message: Struct, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.fields).forEach(([key, value]) => { + if (value !== undefined) { + Struct_FieldsEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Struct { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = Struct_FieldsEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.fields[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Struct { + return { + fields: isObject(object.fields) + ? Object.entries(object.fields).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Struct): unknown { + const obj: any = {}; + if (message.fields) { + const entries = Object.entries(message.fields); + if (entries.length > 0) { + obj.fields = {}; + entries.forEach(([k, v]) => { + obj.fields[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): Struct { + return Struct.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Struct { + const message = createBaseStruct(); + message.fields = Object.entries(object.fields ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, + + wrap(object: { [key: string]: any } | undefined): Struct { + const struct = createBaseStruct(); + + if (object !== undefined) { + for (const key of Object.keys(object)) { + struct.fields[key] = object[key]; + } + } + return struct; + }, + + unwrap(message: Struct): { [key: string]: any } { + const object: { [key: string]: any } = {}; + if (message.fields) { + for (const key of Object.keys(message.fields)) { + object[key] = message.fields[key]; + } + } + return object; + }, +}; + +function createBaseStruct_FieldsEntry(): Struct_FieldsEntry { + return { key: "", value: undefined }; +} + +export const Struct_FieldsEntry: MessageFns = { + encode(message: Struct_FieldsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Struct_FieldsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStruct_FieldsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Struct_FieldsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: Struct_FieldsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Struct_FieldsEntry { + return Struct_FieldsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Struct_FieldsEntry { + const message = createBaseStruct_FieldsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseValue(): Value { + return { kind: undefined }; +} + +export const Value: MessageFns & AnyValueWrapperFns = { + encode(message: Value, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + switch (message.kind?.$case) { + case "nullValue": + writer.uint32(8).int32(message.kind.nullValue); + break; + case "numberValue": + writer.uint32(17).double(message.kind.numberValue); + break; + case "stringValue": + writer.uint32(26).string(message.kind.stringValue); + break; + case "boolValue": + writer.uint32(32).bool(message.kind.boolValue); + break; + case "structValue": + Struct.encode(Struct.wrap(message.kind.structValue), writer.uint32(42).fork()).join(); + break; + case "listValue": + ListValue.encode(ListValue.wrap(message.kind.listValue), writer.uint32(50).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Value { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.kind = { $case: "nullValue", nullValue: reader.int32() as any }; + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.kind = { $case: "numberValue", numberValue: reader.double() }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.kind = { $case: "stringValue", stringValue: reader.string() }; + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.kind = { $case: "boolValue", boolValue: reader.bool() }; + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.kind = { $case: "structValue", structValue: Struct.unwrap(Struct.decode(reader, reader.uint32())) }; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.kind = { $case: "listValue", listValue: ListValue.unwrap(ListValue.decode(reader, reader.uint32())) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Value { + return { + kind: isSet(object.nullValue) + ? { $case: "nullValue", nullValue: nullValueFromJSON(object.nullValue) } + : isSet(object.numberValue) + ? { $case: "numberValue", numberValue: globalThis.Number(object.numberValue) } + : isSet(object.stringValue) + ? { $case: "stringValue", stringValue: globalThis.String(object.stringValue) } + : isSet(object.boolValue) + ? { $case: "boolValue", boolValue: globalThis.Boolean(object.boolValue) } + : isSet(object.structValue) + ? { $case: "structValue", structValue: object.structValue } + : isSet(object.listValue) + ? { $case: "listValue", listValue: [...object.listValue] } + : undefined, + }; + }, + + toJSON(message: Value): unknown { + const obj: any = {}; + if (message.kind?.$case === "nullValue") { + obj.nullValue = nullValueToJSON(message.kind.nullValue); + } else if (message.kind?.$case === "numberValue") { + obj.numberValue = message.kind.numberValue; + } else if (message.kind?.$case === "stringValue") { + obj.stringValue = message.kind.stringValue; + } else if (message.kind?.$case === "boolValue") { + obj.boolValue = message.kind.boolValue; + } else if (message.kind?.$case === "structValue") { + obj.structValue = message.kind.structValue; + } else if (message.kind?.$case === "listValue") { + obj.listValue = message.kind.listValue; + } + return obj; + }, + + create(base?: DeepPartial): Value { + return Value.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Value { + const message = createBaseValue(); + switch (object.kind?.$case) { + case "nullValue": { + if (object.kind?.nullValue !== undefined && object.kind?.nullValue !== null) { + message.kind = { $case: "nullValue", nullValue: object.kind.nullValue }; + } + break; + } + case "numberValue": { + if (object.kind?.numberValue !== undefined && object.kind?.numberValue !== null) { + message.kind = { $case: "numberValue", numberValue: object.kind.numberValue }; + } + break; + } + case "stringValue": { + if (object.kind?.stringValue !== undefined && object.kind?.stringValue !== null) { + message.kind = { $case: "stringValue", stringValue: object.kind.stringValue }; + } + break; + } + case "boolValue": { + if (object.kind?.boolValue !== undefined && object.kind?.boolValue !== null) { + message.kind = { $case: "boolValue", boolValue: object.kind.boolValue }; + } + break; + } + case "structValue": { + if (object.kind?.structValue !== undefined && object.kind?.structValue !== null) { + message.kind = { $case: "structValue", structValue: object.kind.structValue }; + } + break; + } + case "listValue": { + if (object.kind?.listValue !== undefined && object.kind?.listValue !== null) { + message.kind = { $case: "listValue", listValue: object.kind.listValue }; + } + break; + } + } + return message; + }, + + wrap(value: any): Value { + const result = createBaseValue(); + if (value === null) { + result.kind = { $case: "nullValue", nullValue: NullValue.NULL_VALUE }; + } else if (typeof value === "boolean") { + result.kind = { $case: "boolValue", boolValue: value }; + } else if (typeof value === "number") { + result.kind = { $case: "numberValue", numberValue: value }; + } else if (typeof value === "string") { + result.kind = { $case: "stringValue", stringValue: value }; + } else if (globalThis.Array.isArray(value)) { + result.kind = { $case: "listValue", listValue: value }; + } else if (typeof value === "object") { + result.kind = { $case: "structValue", structValue: value }; + } else if (typeof value !== "undefined") { + throw new globalThis.Error("Unsupported any value type: " + typeof value); + } + return result; + }, + + unwrap(message: Value): string | number | boolean | Object | null | Array | undefined { + if (message.kind?.$case === "nullValue") { + return null; + } else if (message.kind?.$case === "numberValue") { + return message.kind?.numberValue; + } else if (message.kind?.$case === "stringValue") { + return message.kind?.stringValue; + } else if (message.kind?.$case === "boolValue") { + return message.kind?.boolValue; + } else if (message.kind?.$case === "structValue") { + return message.kind?.structValue; + } else if (message.kind?.$case === "listValue") { + return message.kind?.listValue; + } else { + return undefined; + } + }, +}; + +function createBaseListValue(): ListValue { + return { values: [] }; +} + +export const ListValue: MessageFns & ListValueWrapperFns = { + encode(message: ListValue, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.values) { + Value.encode(Value.wrap(v!), writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.values.push(Value.unwrap(Value.decode(reader, reader.uint32()))); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListValue { + return { values: globalThis.Array.isArray(object?.values) ? [...object.values] : [] }; + }, + + toJSON(message: ListValue): unknown { + const obj: any = {}; + if (message.values?.length) { + obj.values = message.values; + } + return obj; + }, + + create(base?: DeepPartial): ListValue { + return ListValue.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListValue { + const message = createBaseListValue(); + message.values = object.values?.map((e) => e) || []; + return message; + }, + + wrap(array: Array | undefined): ListValue { + const result = createBaseListValue(); + result.values = array ?? []; + return result; + }, + + unwrap(message: ListValue): Array { + if (message?.hasOwnProperty("values") && globalThis.Array.isArray(message.values)) { + return message.values; + } else { + return message as any; + } + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} + +export interface StructWrapperFns { + wrap(object: { [key: string]: any } | undefined): Struct; + unwrap(message: Struct): { [key: string]: any }; +} + +export interface AnyValueWrapperFns { + wrap(value: any): Value; + unwrap(message: any): string | number | boolean | Object | null | Array | undefined; +} + +export interface ListValueWrapperFns { + wrap(array: Array | undefined): ListValue; + unwrap(message: ListValue): Array; +} diff --git a/src/grpc/generated/google/protobuf/timestamp.ts b/src/grpc/generated/google/protobuf/timestamp.ts new file mode 100644 index 0000000..a3fef43 --- /dev/null +++ b/src/grpc/generated/google/protobuf/timestamp.ts @@ -0,0 +1,218 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: google/protobuf/timestamp.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: Long; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} + +function createBaseTimestamp(): Timestamp { + return { seconds: Long.ZERO, nanos: 0 }; +} + +export const Timestamp: MessageFns = { + encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (!message.seconds.equals(Long.ZERO)) { + writer.uint32(8).int64(message.seconds.toString()); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.seconds = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.nanos = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Timestamp { + return { + seconds: isSet(object.seconds) ? Long.fromValue(object.seconds) : Long.ZERO, + nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0, + }; + }, + + toJSON(message: Timestamp): unknown { + const obj: any = {}; + if (!message.seconds.equals(Long.ZERO)) { + obj.seconds = (message.seconds || Long.ZERO).toString(); + } + if (message.nanos !== 0) { + obj.nanos = Math.round(message.nanos); + } + return obj; + }, + + create(base?: DeepPartial): Timestamp { + return Timestamp.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Timestamp { + const message = createBaseTimestamp(); + message.seconds = (object.seconds !== undefined && object.seconds !== null) + ? Long.fromValue(object.seconds) + : Long.ZERO; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/protoc-gen-openapiv2/options/annotations.ts b/src/grpc/generated/protoc-gen-openapiv2/options/annotations.ts new file mode 100644 index 0000000..ead77e9 --- /dev/null +++ b/src/grpc/generated/protoc-gen-openapiv2/options/annotations.ts @@ -0,0 +1,9 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: protoc-gen-openapiv2/options/annotations.proto + +/* eslint-disable */ + +export const protobufPackage = "grpc.gateway.protoc_gen_openapiv2.options"; diff --git a/src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts b/src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts new file mode 100644 index 0000000..7f1ed0b --- /dev/null +++ b/src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts @@ -0,0 +1,5606 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: protoc-gen-openapiv2/options/openapiv2.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; +import { Value } from "../../google/protobuf/struct"; + +export const protobufPackage = "grpc.gateway.protoc_gen_openapiv2.options"; + +/** + * Scheme describes the schemes supported by the OpenAPI Swagger + * and Operation objects. + */ +export enum Scheme { + UNKNOWN = 0, + HTTP = 1, + HTTPS = 2, + WS = 3, + WSS = 4, + UNRECOGNIZED = -1, +} + +export function schemeFromJSON(object: any): Scheme { + switch (object) { + case 0: + case "UNKNOWN": + return Scheme.UNKNOWN; + case 1: + case "HTTP": + return Scheme.HTTP; + case 2: + case "HTTPS": + return Scheme.HTTPS; + case 3: + case "WS": + return Scheme.WS; + case 4: + case "WSS": + return Scheme.WSS; + case -1: + case "UNRECOGNIZED": + default: + return Scheme.UNRECOGNIZED; + } +} + +export function schemeToJSON(object: Scheme): string { + switch (object) { + case Scheme.UNKNOWN: + return "UNKNOWN"; + case Scheme.HTTP: + return "HTTP"; + case Scheme.HTTPS: + return "HTTPS"; + case Scheme.WS: + return "WS"; + case Scheme.WSS: + return "WSS"; + case Scheme.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * `Swagger` is a representation of OpenAPI v2 specification's Swagger object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: ""; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE"; + * }; + * }; + * schemes: HTTPS; + * consumes: "application/json"; + * produces: "application/json"; + * }; + */ +export interface Swagger { + /** + * Specifies the OpenAPI Specification version being used. It can be + * used by the OpenAPI UI and other clients to interpret the API listing. The + * value MUST be "2.0". + */ + swagger: string; + /** + * Provides metadata about the API. The metadata can be used by the + * clients if needed. + */ + info: + | Info + | undefined; + /** + * The host (name or ip) serving the API. This MUST be the host only and does + * not include the scheme nor sub-paths. It MAY include a port. If the host is + * not included, the host serving the documentation is to be used (including + * the port). The host does not support path templating. + */ + host: string; + /** + * The base path on which the API is served, which is relative to the host. If + * it is not included, the API is served directly under the host. The value + * MUST start with a leading slash (/). The basePath does not support path + * templating. + * Note that using `base_path` does not change the endpoint paths that are + * generated in the resulting OpenAPI file. If you wish to use `base_path` + * with relatively generated OpenAPI paths, the `base_path` prefix must be + * manually removed from your `google.api.http` paths and your code changed to + * serve the API from the `base_path`. + */ + basePath: string; + /** + * The transfer protocol of the API. Values MUST be from the list: "http", + * "https", "ws", "wss". If the schemes is not included, the default scheme to + * be used is the one used to access the OpenAPI definition itself. + */ + schemes: Scheme[]; + /** + * A list of MIME types the APIs can consume. This is global to all APIs but + * can be overridden on specific API calls. Value MUST be as described under + * Mime Types. + */ + consumes: string[]; + /** + * A list of MIME types the APIs can produce. This is global to all APIs but + * can be overridden on specific API calls. Value MUST be as described under + * Mime Types. + */ + produces: string[]; + /** + * An object to hold responses that can be used across operations. This + * property does not define global responses for all operations. + */ + responses: { [key: string]: Response }; + /** Security scheme definitions that can be used across the specification. */ + securityDefinitions: + | SecurityDefinitions + | undefined; + /** + * A declaration of which security schemes are applied for the API as a whole. + * The list of values describes alternative security schemes that can be used + * (that is, there is a logical OR between the security requirements). + * Individual operations can override this definition. + */ + security: SecurityRequirement[]; + /** + * A list of tags for API documentation control. Tags can be used for logical + * grouping of operations by resources or any other qualifier. + */ + tags: Tag[]; + /** Additional external documentation. */ + externalDocs: + | ExternalDocumentation + | undefined; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; +} + +export interface Swagger_ResponsesEntry { + key: string; + value: Response | undefined; +} + +export interface Swagger_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `Operation` is a representation of OpenAPI v2 specification's Operation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject + * + * Example: + * + * service EchoService { + * rpc Echo(SimpleMessage) returns (SimpleMessage) { + * option (google.api.http) = { + * get: "/v1/example/echo/{id}" + * }; + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + * summary: "Get a message."; + * operation_id: "getMessage"; + * tags: "echo"; + * responses: { + * key: "200" + * value: { + * description: "OK"; + * } + * } + * }; + * } + * } + */ +export interface Operation { + /** + * A list of tags for API documentation control. Tags can be used for logical + * grouping of operations by resources or any other qualifier. + */ + tags: string[]; + /** + * A short summary of what the operation does. For maximum readability in the + * swagger-ui, this field SHOULD be less than 120 characters. + */ + summary: string; + /** + * A verbose explanation of the operation behavior. GFM syntax can be used for + * rich text representation. + */ + description: string; + /** Additional external documentation for this operation. */ + externalDocs: + | ExternalDocumentation + | undefined; + /** + * Unique string used to identify the operation. The id MUST be unique among + * all operations described in the API. Tools and libraries MAY use the + * operationId to uniquely identify an operation, therefore, it is recommended + * to follow common programming naming conventions. + */ + operationId: string; + /** + * A list of MIME types the operation can consume. This overrides the consumes + * definition at the OpenAPI Object. An empty value MAY be used to clear the + * global definition. Value MUST be as described under Mime Types. + */ + consumes: string[]; + /** + * A list of MIME types the operation can produce. This overrides the produces + * definition at the OpenAPI Object. An empty value MAY be used to clear the + * global definition. Value MUST be as described under Mime Types. + */ + produces: string[]; + /** + * The list of possible responses as they are returned from executing this + * operation. + */ + responses: { [key: string]: Response }; + /** + * The transfer protocol for the operation. Values MUST be from the list: + * "http", "https", "ws", "wss". The value overrides the OpenAPI Object + * schemes definition. + */ + schemes: Scheme[]; + /** + * Declares this operation to be deprecated. Usage of the declared operation + * should be refrained. Default value is false. + */ + deprecated: boolean; + /** + * A declaration of which security schemes are applied for this operation. The + * list of values describes alternative security schemes that can be used + * (that is, there is a logical OR between the security requirements). This + * definition overrides any declared top-level security. To remove a top-level + * security declaration, an empty array can be used. + */ + security: SecurityRequirement[]; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; + /** + * Custom parameters such as HTTP request headers. + * See: https://swagger.io/docs/specification/2-0/describing-parameters/ + * and https://swagger.io/specification/v2/#parameter-object. + */ + parameters: Parameters | undefined; +} + +export interface Operation_ResponsesEntry { + key: string; + value: Response | undefined; +} + +export interface Operation_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `Parameters` is a representation of OpenAPI v2 specification's parameters object. + * Note: This technically breaks compatibility with the OpenAPI 2 definition structure as we only + * allow header parameters to be set here since we do not want users specifying custom non-header + * parameters beyond those inferred from the Protobuf schema. + * See: https://swagger.io/specification/v2/#parameter-object + */ +export interface Parameters { + /** + * `Headers` is one or more HTTP header parameter. + * See: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters + */ + headers: HeaderParameter[]; +} + +/** + * `HeaderParameter` a HTTP header parameter. + * See: https://swagger.io/specification/v2/#parameter-object + */ +export interface HeaderParameter { + /** `Name` is the header name. */ + name: string; + /** `Description` is a short description of the header. */ + description: string; + /** + * `Type` is the type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. + * See: https://swagger.io/specification/v2/#parameterType. + */ + type: HeaderParameter_Type; + /** `Format` The extending format for the previously mentioned type. */ + format: string; + /** `Required` indicates if the header is optional */ + required: boolean; +} + +/** + * `Type` is a supported HTTP header type. + * See https://swagger.io/specification/v2/#parameterType. + */ +export enum HeaderParameter_Type { + UNKNOWN = 0, + STRING = 1, + NUMBER = 2, + INTEGER = 3, + BOOLEAN = 4, + UNRECOGNIZED = -1, +} + +export function headerParameter_TypeFromJSON(object: any): HeaderParameter_Type { + switch (object) { + case 0: + case "UNKNOWN": + return HeaderParameter_Type.UNKNOWN; + case 1: + case "STRING": + return HeaderParameter_Type.STRING; + case 2: + case "NUMBER": + return HeaderParameter_Type.NUMBER; + case 3: + case "INTEGER": + return HeaderParameter_Type.INTEGER; + case 4: + case "BOOLEAN": + return HeaderParameter_Type.BOOLEAN; + case -1: + case "UNRECOGNIZED": + default: + return HeaderParameter_Type.UNRECOGNIZED; + } +} + +export function headerParameter_TypeToJSON(object: HeaderParameter_Type): string { + switch (object) { + case HeaderParameter_Type.UNKNOWN: + return "UNKNOWN"; + case HeaderParameter_Type.STRING: + return "STRING"; + case HeaderParameter_Type.NUMBER: + return "NUMBER"; + case HeaderParameter_Type.INTEGER: + return "INTEGER"; + case HeaderParameter_Type.BOOLEAN: + return "BOOLEAN"; + case HeaderParameter_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * `Header` is a representation of OpenAPI v2 specification's Header object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject + */ +export interface Header { + /** `Description` is a short description of the header. */ + description: string; + /** The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. */ + type: string; + /** `Format` The extending format for the previously mentioned type. */ + format: string; + /** + * `Default` Declares the value of the header that the server will use if none is provided. + * See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. + * Unlike JSON Schema this value MUST conform to the defined type for the header. + */ + default: string; + /** 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. */ + pattern: string; +} + +/** + * `Response` is a representation of OpenAPI v2 specification's Response object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject + */ +export interface Response { + /** + * `Description` is a short description of the response. + * GFM syntax can be used for rich text representation. + */ + description: string; + /** + * `Schema` optionally defines the structure of the response. + * If `Schema` is not provided, it means there is no content to the response. + */ + schema: + | Schema + | undefined; + /** + * `Headers` A list of headers that are sent with the response. + * `Header` name is expected to be a string in the canonical format of the MIME header key + * See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey + */ + headers: { [key: string]: Header }; + /** + * `Examples` gives per-mimetype response examples. + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object + */ + examples: { [key: string]: string }; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; +} + +export interface Response_HeadersEntry { + key: string; + value: Header | undefined; +} + +export interface Response_ExamplesEntry { + key: string; + value: string; +} + +export interface Response_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `Info` is a representation of OpenAPI v2 specification's Info object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * title: "Echo API"; + * version: "1.0"; + * description: ""; + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE"; + * }; + * }; + * ... + * }; + */ +export interface Info { + /** The title of the application. */ + title: string; + /** + * A short description of the application. GFM syntax can be used for rich + * text representation. + */ + description: string; + /** The Terms of Service for the API. */ + termsOfService: string; + /** The contact information for the exposed API. */ + contact: + | Contact + | undefined; + /** The license information for the exposed API. */ + license: + | License + | undefined; + /** + * Provides the version of the application API (not to be confused + * with the specification version). + */ + version: string; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; +} + +export interface Info_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `Contact` is a representation of OpenAPI v2 specification's Contact object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * contact: { + * name: "gRPC-Gateway project"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * email: "none@example.com"; + * }; + * ... + * }; + * ... + * }; + */ +export interface Contact { + /** The identifying name of the contact person/organization. */ + name: string; + /** + * The URL pointing to the contact information. MUST be in the format of a + * URL. + */ + url: string; + /** + * The email address of the contact person/organization. MUST be in the format + * of an email address. + */ + email: string; +} + +/** + * `License` is a representation of OpenAPI v2 specification's License object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * info: { + * ... + * license: { + * name: "BSD 3-Clause License"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE"; + * }; + * ... + * }; + * ... + * }; + */ +export interface License { + /** The license name used for the API. */ + name: string; + /** A URL to the license used for the API. MUST be in the format of a URL. */ + url: string; +} + +/** + * `ExternalDocumentation` is a representation of OpenAPI v2 specification's + * ExternalDocumentation object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { + * ... + * external_docs: { + * description: "More about gRPC-Gateway"; + * url: "https://github.com/grpc-ecosystem/grpc-gateway"; + * } + * ... + * }; + */ +export interface ExternalDocumentation { + /** + * A short description of the target documentation. GFM syntax can be used for + * rich text representation. + */ + description: string; + /** + * The URL for the target documentation. Value MUST be in the format + * of a URL. + */ + url: string; +} + +/** + * `Schema` is a representation of OpenAPI v2 specification's Schema object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + */ +export interface Schema { + jsonSchema: + | JSONSchema + | undefined; + /** + * Adds support for polymorphism. The discriminator is the schema property + * name that is used to differentiate between other schema that inherit this + * schema. The property name used MUST be defined at this schema and it MUST + * be in the required property list. When used, the value MUST be the name of + * this schema or any schema that inherits it. + */ + discriminator: string; + /** + * Relevant only for Schema "properties" definitions. Declares the property as + * "read only". This means that it MAY be sent as part of a response but MUST + * NOT be sent as part of the request. Properties marked as readOnly being + * true SHOULD NOT be in the required list of the defined schema. Default + * value is false. + */ + readOnly: boolean; + /** Additional external documentation for this schema. */ + externalDocs: + | ExternalDocumentation + | undefined; + /** + * A free-form property to include an example of an instance for this schema in JSON. + * This is copied verbatim to the output. + */ + example: string; +} + +/** + * `EnumSchema` is subset of fields from the OpenAPI v2 specification's Schema object. + * Only fields that are applicable to Enums are included + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + * + * Example: + * + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_enum) = { + * ... + * title: "MyEnum"; + * description:"This is my nice enum"; + * example: "ZERO"; + * required: true; + * ... + * }; + */ +export interface EnumSchema { + /** A short description of the schema. */ + description: string; + default: string; + /** The title of the schema. */ + title: string; + required: boolean; + readOnly: boolean; + /** Additional external documentation for this schema. */ + externalDocs: ExternalDocumentation | undefined; + example: string; + /** + * Ref is used to define an external reference to include in the message. + * This could be a fully qualified proto message reference, and that type must + * be imported into the protofile. If no message is identified, the Ref will + * be used verbatim in the output. + * For example: + * `ref: ".google.protobuf.Timestamp"`. + */ + ref: string; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; +} + +export interface EnumSchema_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `JSONSchema` represents properties from JSON Schema taken, and as used, in + * the OpenAPI v2 spec. + * + * This includes changes made by OpenAPI v2. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + * + * See also: https://cswr.github.io/JsonSchema/spec/basic_types/, + * https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json + * + * Example: + * + * message SimpleMessage { + * option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { + * json_schema: { + * title: "SimpleMessage" + * description: "A simple message." + * required: ["id"] + * } + * }; + * + * // Id represents the message identifier. + * string id = 1; [ + * (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { + * description: "The unique identifier of the simple message." + * }]; + * } + */ +export interface JSONSchema { + /** + * Ref is used to define an external reference to include in the message. + * This could be a fully qualified proto message reference, and that type must + * be imported into the protofile. If no message is identified, the Ref will + * be used verbatim in the output. + * For example: + * `ref: ".google.protobuf.Timestamp"`. + */ + ref: string; + /** The title of the schema. */ + title: string; + /** A short description of the schema. */ + description: string; + default: string; + readOnly: boolean; + /** + * A free-form property to include a JSON example of this field. This is copied + * verbatim to the output swagger.json. Quotes must be escaped. + * This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject + */ + example: string; + multipleOf: number; + /** + * Maximum represents an inclusive upper limit for a numeric instance. The + * value of MUST be a number, + */ + maximum: number; + exclusiveMaximum: boolean; + /** + * minimum represents an inclusive lower limit for a numeric instance. The + * value of MUST be a number, + */ + minimum: number; + exclusiveMinimum: boolean; + maxLength: Long; + minLength: Long; + pattern: string; + maxItems: Long; + minItems: Long; + uniqueItems: boolean; + maxProperties: Long; + minProperties: Long; + required: string[]; + /** Items in 'array' must be unique. */ + array: string[]; + type: JSONSchema_JSONSchemaSimpleTypes[]; + /** `Format` */ + format: string; + /** Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 */ + enum: string[]; + /** Additional field level properties used when generating the OpenAPI v2 file. */ + fieldConfiguration: + | JSONSchema_FieldConfiguration + | undefined; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; +} + +export enum JSONSchema_JSONSchemaSimpleTypes { + UNKNOWN = 0, + ARRAY = 1, + BOOLEAN = 2, + INTEGER = 3, + NULL = 4, + NUMBER = 5, + OBJECT = 6, + STRING = 7, + UNRECOGNIZED = -1, +} + +export function jSONSchema_JSONSchemaSimpleTypesFromJSON(object: any): JSONSchema_JSONSchemaSimpleTypes { + switch (object) { + case 0: + case "UNKNOWN": + return JSONSchema_JSONSchemaSimpleTypes.UNKNOWN; + case 1: + case "ARRAY": + return JSONSchema_JSONSchemaSimpleTypes.ARRAY; + case 2: + case "BOOLEAN": + return JSONSchema_JSONSchemaSimpleTypes.BOOLEAN; + case 3: + case "INTEGER": + return JSONSchema_JSONSchemaSimpleTypes.INTEGER; + case 4: + case "NULL": + return JSONSchema_JSONSchemaSimpleTypes.NULL; + case 5: + case "NUMBER": + return JSONSchema_JSONSchemaSimpleTypes.NUMBER; + case 6: + case "OBJECT": + return JSONSchema_JSONSchemaSimpleTypes.OBJECT; + case 7: + case "STRING": + return JSONSchema_JSONSchemaSimpleTypes.STRING; + case -1: + case "UNRECOGNIZED": + default: + return JSONSchema_JSONSchemaSimpleTypes.UNRECOGNIZED; + } +} + +export function jSONSchema_JSONSchemaSimpleTypesToJSON(object: JSONSchema_JSONSchemaSimpleTypes): string { + switch (object) { + case JSONSchema_JSONSchemaSimpleTypes.UNKNOWN: + return "UNKNOWN"; + case JSONSchema_JSONSchemaSimpleTypes.ARRAY: + return "ARRAY"; + case JSONSchema_JSONSchemaSimpleTypes.BOOLEAN: + return "BOOLEAN"; + case JSONSchema_JSONSchemaSimpleTypes.INTEGER: + return "INTEGER"; + case JSONSchema_JSONSchemaSimpleTypes.NULL: + return "NULL"; + case JSONSchema_JSONSchemaSimpleTypes.NUMBER: + return "NUMBER"; + case JSONSchema_JSONSchemaSimpleTypes.OBJECT: + return "OBJECT"; + case JSONSchema_JSONSchemaSimpleTypes.STRING: + return "STRING"; + case JSONSchema_JSONSchemaSimpleTypes.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * 'FieldConfiguration' provides additional field level properties used when generating the OpenAPI v2 file. + * These properties are not defined by OpenAPIv2, but they are used to control the generation. + */ +export interface JSONSchema_FieldConfiguration { + /** + * Alternative parameter name when used as path parameter. If set, this will + * be used as the complete parameter name when this field is used as a path + * parameter. Use this to avoid having auto generated path parameter names + * for overlapping paths. + */ + pathParamName: string; +} + +export interface JSONSchema_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `Tag` is a representation of OpenAPI v2 specification's Tag object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject + */ +export interface Tag { + /** + * The name of the tag. Use it to allow override of the name of a + * global Tag object, then use that name to reference the tag throughout the + * OpenAPI file. + */ + name: string; + /** + * A short description for the tag. GFM syntax can be used for rich text + * representation. + */ + description: string; + /** Additional external documentation for this tag. */ + externalDocs: + | ExternalDocumentation + | undefined; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; +} + +export interface Tag_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `SecurityDefinitions` is a representation of OpenAPI v2 specification's + * Security Definitions object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject + * + * A declaration of the security schemes available to be used in the + * specification. This does not enforce the security schemes on the operations + * and only serves to provide the relevant details for each scheme. + */ +export interface SecurityDefinitions { + /** + * A single security scheme definition, mapping a "name" to the scheme it + * defines. + */ + security: { [key: string]: SecurityScheme }; +} + +export interface SecurityDefinitions_SecurityEntry { + key: string; + value: SecurityScheme | undefined; +} + +/** + * `SecurityScheme` is a representation of OpenAPI v2 specification's + * Security Scheme object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject + * + * Allows the definition of a security scheme that can be used by the + * operations. Supported schemes are basic authentication, an API key (either as + * a header or as a query parameter) and OAuth2's common flows (implicit, + * password, application and access code). + */ +export interface SecurityScheme { + /** + * The type of the security scheme. Valid values are "basic", + * "apiKey" or "oauth2". + */ + type: SecurityScheme_Type; + /** A short description for security scheme. */ + description: string; + /** + * The name of the header or query parameter to be used. + * Valid for apiKey. + */ + name: string; + /** + * The location of the API key. Valid values are "query" or + * "header". + * Valid for apiKey. + */ + in: SecurityScheme_In; + /** + * The flow used by the OAuth2 security scheme. Valid values are + * "implicit", "password", "application" or "accessCode". + * Valid for oauth2. + */ + flow: SecurityScheme_Flow; + /** + * The authorization URL to be used for this flow. This SHOULD be in + * the form of a URL. + * Valid for oauth2/implicit and oauth2/accessCode. + */ + authorizationUrl: string; + /** + * The token URL to be used for this flow. This SHOULD be in the + * form of a URL. + * Valid for oauth2/password, oauth2/application and oauth2/accessCode. + */ + tokenUrl: string; + /** + * The available scopes for the OAuth2 security scheme. + * Valid for oauth2. + */ + scopes: + | Scopes + | undefined; + /** + * Custom properties that start with "x-" such as "x-foo" used to describe + * extra functionality that is not covered by the standard OpenAPI Specification. + * See: https://swagger.io/docs/specification/2-0/swagger-extensions/ + */ + extensions: { [key: string]: any | undefined }; +} + +/** + * The type of the security scheme. Valid values are "basic", + * "apiKey" or "oauth2". + */ +export enum SecurityScheme_Type { + TYPE_INVALID = 0, + TYPE_BASIC = 1, + TYPE_API_KEY = 2, + TYPE_OAUTH2 = 3, + UNRECOGNIZED = -1, +} + +export function securityScheme_TypeFromJSON(object: any): SecurityScheme_Type { + switch (object) { + case 0: + case "TYPE_INVALID": + return SecurityScheme_Type.TYPE_INVALID; + case 1: + case "TYPE_BASIC": + return SecurityScheme_Type.TYPE_BASIC; + case 2: + case "TYPE_API_KEY": + return SecurityScheme_Type.TYPE_API_KEY; + case 3: + case "TYPE_OAUTH2": + return SecurityScheme_Type.TYPE_OAUTH2; + case -1: + case "UNRECOGNIZED": + default: + return SecurityScheme_Type.UNRECOGNIZED; + } +} + +export function securityScheme_TypeToJSON(object: SecurityScheme_Type): string { + switch (object) { + case SecurityScheme_Type.TYPE_INVALID: + return "TYPE_INVALID"; + case SecurityScheme_Type.TYPE_BASIC: + return "TYPE_BASIC"; + case SecurityScheme_Type.TYPE_API_KEY: + return "TYPE_API_KEY"; + case SecurityScheme_Type.TYPE_OAUTH2: + return "TYPE_OAUTH2"; + case SecurityScheme_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** The location of the API key. Valid values are "query" or "header". */ +export enum SecurityScheme_In { + IN_INVALID = 0, + IN_QUERY = 1, + IN_HEADER = 2, + UNRECOGNIZED = -1, +} + +export function securityScheme_InFromJSON(object: any): SecurityScheme_In { + switch (object) { + case 0: + case "IN_INVALID": + return SecurityScheme_In.IN_INVALID; + case 1: + case "IN_QUERY": + return SecurityScheme_In.IN_QUERY; + case 2: + case "IN_HEADER": + return SecurityScheme_In.IN_HEADER; + case -1: + case "UNRECOGNIZED": + default: + return SecurityScheme_In.UNRECOGNIZED; + } +} + +export function securityScheme_InToJSON(object: SecurityScheme_In): string { + switch (object) { + case SecurityScheme_In.IN_INVALID: + return "IN_INVALID"; + case SecurityScheme_In.IN_QUERY: + return "IN_QUERY"; + case SecurityScheme_In.IN_HEADER: + return "IN_HEADER"; + case SecurityScheme_In.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * The flow used by the OAuth2 security scheme. Valid values are + * "implicit", "password", "application" or "accessCode". + */ +export enum SecurityScheme_Flow { + FLOW_INVALID = 0, + FLOW_IMPLICIT = 1, + FLOW_PASSWORD = 2, + FLOW_APPLICATION = 3, + FLOW_ACCESS_CODE = 4, + UNRECOGNIZED = -1, +} + +export function securityScheme_FlowFromJSON(object: any): SecurityScheme_Flow { + switch (object) { + case 0: + case "FLOW_INVALID": + return SecurityScheme_Flow.FLOW_INVALID; + case 1: + case "FLOW_IMPLICIT": + return SecurityScheme_Flow.FLOW_IMPLICIT; + case 2: + case "FLOW_PASSWORD": + return SecurityScheme_Flow.FLOW_PASSWORD; + case 3: + case "FLOW_APPLICATION": + return SecurityScheme_Flow.FLOW_APPLICATION; + case 4: + case "FLOW_ACCESS_CODE": + return SecurityScheme_Flow.FLOW_ACCESS_CODE; + case -1: + case "UNRECOGNIZED": + default: + return SecurityScheme_Flow.UNRECOGNIZED; + } +} + +export function securityScheme_FlowToJSON(object: SecurityScheme_Flow): string { + switch (object) { + case SecurityScheme_Flow.FLOW_INVALID: + return "FLOW_INVALID"; + case SecurityScheme_Flow.FLOW_IMPLICIT: + return "FLOW_IMPLICIT"; + case SecurityScheme_Flow.FLOW_PASSWORD: + return "FLOW_PASSWORD"; + case SecurityScheme_Flow.FLOW_APPLICATION: + return "FLOW_APPLICATION"; + case SecurityScheme_Flow.FLOW_ACCESS_CODE: + return "FLOW_ACCESS_CODE"; + case SecurityScheme_Flow.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface SecurityScheme_ExtensionsEntry { + key: string; + value: any | undefined; +} + +/** + * `SecurityRequirement` is a representation of OpenAPI v2 specification's + * Security Requirement object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject + * + * Lists the required security schemes to execute this operation. The object can + * have multiple security schemes declared in it which are all required (that + * is, there is a logical AND between the schemes). + * + * The name used for each property MUST correspond to a security scheme + * declared in the Security Definitions. + */ +export interface SecurityRequirement { + /** + * Each name must correspond to a security scheme which is declared in + * the Security Definitions. If the security scheme is of type "oauth2", + * then the value is a list of scope names required for the execution. + * For other security scheme types, the array MUST be empty. + */ + securityRequirement: { [key: string]: SecurityRequirement_SecurityRequirementValue }; +} + +/** + * If the security scheme is of type "oauth2", then the value is a list of + * scope names required for the execution. For other security scheme types, + * the array MUST be empty. + */ +export interface SecurityRequirement_SecurityRequirementValue { + scope: string[]; +} + +export interface SecurityRequirement_SecurityRequirementEntry { + key: string; + value: SecurityRequirement_SecurityRequirementValue | undefined; +} + +/** + * `Scopes` is a representation of OpenAPI v2 specification's Scopes object. + * + * See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject + * + * Lists the available scopes for an OAuth2 security scheme. + */ +export interface Scopes { + /** + * Maps between a name of a scope to a short description of it (as the value + * of the property). + */ + scope: { [key: string]: string }; +} + +export interface Scopes_ScopeEntry { + key: string; + value: string; +} + +function createBaseSwagger(): Swagger { + return { + swagger: "", + info: undefined, + host: "", + basePath: "", + schemes: [], + consumes: [], + produces: [], + responses: {}, + securityDefinitions: undefined, + security: [], + tags: [], + externalDocs: undefined, + extensions: {}, + }; +} + +export const Swagger: MessageFns = { + encode(message: Swagger, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.swagger !== "") { + writer.uint32(10).string(message.swagger); + } + if (message.info !== undefined) { + Info.encode(message.info, writer.uint32(18).fork()).join(); + } + if (message.host !== "") { + writer.uint32(26).string(message.host); + } + if (message.basePath !== "") { + writer.uint32(34).string(message.basePath); + } + writer.uint32(42).fork(); + for (const v of message.schemes) { + writer.int32(v); + } + writer.join(); + for (const v of message.consumes) { + writer.uint32(50).string(v!); + } + for (const v of message.produces) { + writer.uint32(58).string(v!); + } + Object.entries(message.responses).forEach(([key, value]) => { + Swagger_ResponsesEntry.encode({ key: key as any, value }, writer.uint32(82).fork()).join(); + }); + if (message.securityDefinitions !== undefined) { + SecurityDefinitions.encode(message.securityDefinitions, writer.uint32(90).fork()).join(); + } + for (const v of message.security) { + SecurityRequirement.encode(v!, writer.uint32(98).fork()).join(); + } + for (const v of message.tags) { + Tag.encode(v!, writer.uint32(106).fork()).join(); + } + if (message.externalDocs !== undefined) { + ExternalDocumentation.encode(message.externalDocs, writer.uint32(114).fork()).join(); + } + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + Swagger_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(122).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Swagger { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSwagger(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.swagger = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.info = Info.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.host = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.basePath = reader.string(); + continue; + } + case 5: { + if (tag === 40) { + message.schemes.push(reader.int32() as any); + + continue; + } + + if (tag === 42) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.schemes.push(reader.int32() as any); + } + + continue; + } + + break; + } + case 6: { + if (tag !== 50) { + break; + } + + message.consumes.push(reader.string()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.produces.push(reader.string()); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + const entry10 = Swagger_ResponsesEntry.decode(reader, reader.uint32()); + if (entry10.value !== undefined) { + message.responses[entry10.key] = entry10.value; + } + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.securityDefinitions = SecurityDefinitions.decode(reader, reader.uint32()); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.security.push(SecurityRequirement.decode(reader, reader.uint32())); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.tags.push(Tag.decode(reader, reader.uint32())); + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.externalDocs = ExternalDocumentation.decode(reader, reader.uint32()); + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + const entry15 = Swagger_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry15.value !== undefined) { + message.extensions[entry15.key] = entry15.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Swagger { + return { + swagger: isSet(object.swagger) ? globalThis.String(object.swagger) : "", + info: isSet(object.info) ? Info.fromJSON(object.info) : undefined, + host: isSet(object.host) ? globalThis.String(object.host) : "", + basePath: isSet(object.basePath) ? globalThis.String(object.basePath) : "", + schemes: globalThis.Array.isArray(object?.schemes) ? object.schemes.map((e: any) => schemeFromJSON(e)) : [], + consumes: globalThis.Array.isArray(object?.consumes) ? object.consumes.map((e: any) => globalThis.String(e)) : [], + produces: globalThis.Array.isArray(object?.produces) ? object.produces.map((e: any) => globalThis.String(e)) : [], + responses: isObject(object.responses) + ? Object.entries(object.responses).reduce<{ [key: string]: Response }>((acc, [key, value]) => { + acc[key] = Response.fromJSON(value); + return acc; + }, {}) + : {}, + securityDefinitions: isSet(object.securityDefinitions) + ? SecurityDefinitions.fromJSON(object.securityDefinitions) + : undefined, + security: globalThis.Array.isArray(object?.security) + ? object.security.map((e: any) => SecurityRequirement.fromJSON(e)) + : [], + tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e: any) => Tag.fromJSON(e)) : [], + externalDocs: isSet(object.externalDocs) ? ExternalDocumentation.fromJSON(object.externalDocs) : undefined, + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Swagger): unknown { + const obj: any = {}; + if (message.swagger !== "") { + obj.swagger = message.swagger; + } + if (message.info !== undefined) { + obj.info = Info.toJSON(message.info); + } + if (message.host !== "") { + obj.host = message.host; + } + if (message.basePath !== "") { + obj.basePath = message.basePath; + } + if (message.schemes?.length) { + obj.schemes = message.schemes.map((e) => schemeToJSON(e)); + } + if (message.consumes?.length) { + obj.consumes = message.consumes; + } + if (message.produces?.length) { + obj.produces = message.produces; + } + if (message.responses) { + const entries = Object.entries(message.responses); + if (entries.length > 0) { + obj.responses = {}; + entries.forEach(([k, v]) => { + obj.responses[k] = Response.toJSON(v); + }); + } + } + if (message.securityDefinitions !== undefined) { + obj.securityDefinitions = SecurityDefinitions.toJSON(message.securityDefinitions); + } + if (message.security?.length) { + obj.security = message.security.map((e) => SecurityRequirement.toJSON(e)); + } + if (message.tags?.length) { + obj.tags = message.tags.map((e) => Tag.toJSON(e)); + } + if (message.externalDocs !== undefined) { + obj.externalDocs = ExternalDocumentation.toJSON(message.externalDocs); + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): Swagger { + return Swagger.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Swagger { + const message = createBaseSwagger(); + message.swagger = object.swagger ?? ""; + message.info = (object.info !== undefined && object.info !== null) ? Info.fromPartial(object.info) : undefined; + message.host = object.host ?? ""; + message.basePath = object.basePath ?? ""; + message.schemes = object.schemes?.map((e) => e) || []; + message.consumes = object.consumes?.map((e) => e) || []; + message.produces = object.produces?.map((e) => e) || []; + message.responses = Object.entries(object.responses ?? {}).reduce<{ [key: string]: Response }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Response.fromPartial(value); + } + return acc; + }, + {}, + ); + message.securityDefinitions = (object.securityDefinitions !== undefined && object.securityDefinitions !== null) + ? SecurityDefinitions.fromPartial(object.securityDefinitions) + : undefined; + message.security = object.security?.map((e) => SecurityRequirement.fromPartial(e)) || []; + message.tags = object.tags?.map((e) => Tag.fromPartial(e)) || []; + message.externalDocs = (object.externalDocs !== undefined && object.externalDocs !== null) + ? ExternalDocumentation.fromPartial(object.externalDocs) + : undefined; + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseSwagger_ResponsesEntry(): Swagger_ResponsesEntry { + return { key: "", value: undefined }; +} + +export const Swagger_ResponsesEntry: MessageFns = { + encode(message: Swagger_ResponsesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Response.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Swagger_ResponsesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSwagger_ResponsesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Response.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Swagger_ResponsesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Response.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Swagger_ResponsesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Response.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): Swagger_ResponsesEntry { + return Swagger_ResponsesEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Swagger_ResponsesEntry { + const message = createBaseSwagger_ResponsesEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? Response.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseSwagger_ExtensionsEntry(): Swagger_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const Swagger_ExtensionsEntry: MessageFns = { + encode(message: Swagger_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Swagger_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSwagger_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Swagger_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: Swagger_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Swagger_ExtensionsEntry { + return Swagger_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Swagger_ExtensionsEntry { + const message = createBaseSwagger_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseOperation(): Operation { + return { + tags: [], + summary: "", + description: "", + externalDocs: undefined, + operationId: "", + consumes: [], + produces: [], + responses: {}, + schemes: [], + deprecated: false, + security: [], + extensions: {}, + parameters: undefined, + }; +} + +export const Operation: MessageFns = { + encode(message: Operation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.tags) { + writer.uint32(10).string(v!); + } + if (message.summary !== "") { + writer.uint32(18).string(message.summary); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.externalDocs !== undefined) { + ExternalDocumentation.encode(message.externalDocs, writer.uint32(34).fork()).join(); + } + if (message.operationId !== "") { + writer.uint32(42).string(message.operationId); + } + for (const v of message.consumes) { + writer.uint32(50).string(v!); + } + for (const v of message.produces) { + writer.uint32(58).string(v!); + } + Object.entries(message.responses).forEach(([key, value]) => { + Operation_ResponsesEntry.encode({ key: key as any, value }, writer.uint32(74).fork()).join(); + }); + writer.uint32(82).fork(); + for (const v of message.schemes) { + writer.int32(v); + } + writer.join(); + if (message.deprecated !== false) { + writer.uint32(88).bool(message.deprecated); + } + for (const v of message.security) { + SecurityRequirement.encode(v!, writer.uint32(98).fork()).join(); + } + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + Operation_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(106).fork()).join(); + } + }); + if (message.parameters !== undefined) { + Parameters.encode(message.parameters, writer.uint32(114).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Operation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOperation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.tags.push(reader.string()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.summary = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.description = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.externalDocs = ExternalDocumentation.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.operationId = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.consumes.push(reader.string()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.produces.push(reader.string()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + const entry9 = Operation_ResponsesEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.responses[entry9.key] = entry9.value; + } + continue; + } + case 10: { + if (tag === 80) { + message.schemes.push(reader.int32() as any); + + continue; + } + + if (tag === 82) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.schemes.push(reader.int32() as any); + } + + continue; + } + + break; + } + case 11: { + if (tag !== 88) { + break; + } + + message.deprecated = reader.bool(); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.security.push(SecurityRequirement.decode(reader, reader.uint32())); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + const entry13 = Operation_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry13.value !== undefined) { + message.extensions[entry13.key] = entry13.value; + } + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.parameters = Parameters.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Operation { + return { + tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e: any) => globalThis.String(e)) : [], + summary: isSet(object.summary) ? globalThis.String(object.summary) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + externalDocs: isSet(object.externalDocs) ? ExternalDocumentation.fromJSON(object.externalDocs) : undefined, + operationId: isSet(object.operationId) ? globalThis.String(object.operationId) : "", + consumes: globalThis.Array.isArray(object?.consumes) ? object.consumes.map((e: any) => globalThis.String(e)) : [], + produces: globalThis.Array.isArray(object?.produces) ? object.produces.map((e: any) => globalThis.String(e)) : [], + responses: isObject(object.responses) + ? Object.entries(object.responses).reduce<{ [key: string]: Response }>((acc, [key, value]) => { + acc[key] = Response.fromJSON(value); + return acc; + }, {}) + : {}, + schemes: globalThis.Array.isArray(object?.schemes) ? object.schemes.map((e: any) => schemeFromJSON(e)) : [], + deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false, + security: globalThis.Array.isArray(object?.security) + ? object.security.map((e: any) => SecurityRequirement.fromJSON(e)) + : [], + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + parameters: isSet(object.parameters) ? Parameters.fromJSON(object.parameters) : undefined, + }; + }, + + toJSON(message: Operation): unknown { + const obj: any = {}; + if (message.tags?.length) { + obj.tags = message.tags; + } + if (message.summary !== "") { + obj.summary = message.summary; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.externalDocs !== undefined) { + obj.externalDocs = ExternalDocumentation.toJSON(message.externalDocs); + } + if (message.operationId !== "") { + obj.operationId = message.operationId; + } + if (message.consumes?.length) { + obj.consumes = message.consumes; + } + if (message.produces?.length) { + obj.produces = message.produces; + } + if (message.responses) { + const entries = Object.entries(message.responses); + if (entries.length > 0) { + obj.responses = {}; + entries.forEach(([k, v]) => { + obj.responses[k] = Response.toJSON(v); + }); + } + } + if (message.schemes?.length) { + obj.schemes = message.schemes.map((e) => schemeToJSON(e)); + } + if (message.deprecated !== false) { + obj.deprecated = message.deprecated; + } + if (message.security?.length) { + obj.security = message.security.map((e) => SecurityRequirement.toJSON(e)); + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + if (message.parameters !== undefined) { + obj.parameters = Parameters.toJSON(message.parameters); + } + return obj; + }, + + create(base?: DeepPartial): Operation { + return Operation.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Operation { + const message = createBaseOperation(); + message.tags = object.tags?.map((e) => e) || []; + message.summary = object.summary ?? ""; + message.description = object.description ?? ""; + message.externalDocs = (object.externalDocs !== undefined && object.externalDocs !== null) + ? ExternalDocumentation.fromPartial(object.externalDocs) + : undefined; + message.operationId = object.operationId ?? ""; + message.consumes = object.consumes?.map((e) => e) || []; + message.produces = object.produces?.map((e) => e) || []; + message.responses = Object.entries(object.responses ?? {}).reduce<{ [key: string]: Response }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Response.fromPartial(value); + } + return acc; + }, + {}, + ); + message.schemes = object.schemes?.map((e) => e) || []; + message.deprecated = object.deprecated ?? false; + message.security = object.security?.map((e) => SecurityRequirement.fromPartial(e)) || []; + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + message.parameters = (object.parameters !== undefined && object.parameters !== null) + ? Parameters.fromPartial(object.parameters) + : undefined; + return message; + }, +}; + +function createBaseOperation_ResponsesEntry(): Operation_ResponsesEntry { + return { key: "", value: undefined }; +} + +export const Operation_ResponsesEntry: MessageFns = { + encode(message: Operation_ResponsesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Response.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Operation_ResponsesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOperation_ResponsesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Response.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Operation_ResponsesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Response.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Operation_ResponsesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Response.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): Operation_ResponsesEntry { + return Operation_ResponsesEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Operation_ResponsesEntry { + const message = createBaseOperation_ResponsesEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? Response.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseOperation_ExtensionsEntry(): Operation_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const Operation_ExtensionsEntry: MessageFns = { + encode(message: Operation_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Operation_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOperation_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Operation_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: Operation_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Operation_ExtensionsEntry { + return Operation_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Operation_ExtensionsEntry { + const message = createBaseOperation_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseParameters(): Parameters { + return { headers: [] }; +} + +export const Parameters: MessageFns = { + encode(message: Parameters, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.headers) { + HeaderParameter.encode(v!, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Parameters { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseParameters(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.headers.push(HeaderParameter.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Parameters { + return { + headers: globalThis.Array.isArray(object?.headers) + ? object.headers.map((e: any) => HeaderParameter.fromJSON(e)) + : [], + }; + }, + + toJSON(message: Parameters): unknown { + const obj: any = {}; + if (message.headers?.length) { + obj.headers = message.headers.map((e) => HeaderParameter.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): Parameters { + return Parameters.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Parameters { + const message = createBaseParameters(); + message.headers = object.headers?.map((e) => HeaderParameter.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseHeaderParameter(): HeaderParameter { + return { name: "", description: "", type: 0, format: "", required: false }; +} + +export const HeaderParameter: MessageFns = { + encode(message: HeaderParameter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.type !== 0) { + writer.uint32(24).int32(message.type); + } + if (message.format !== "") { + writer.uint32(34).string(message.format); + } + if (message.required !== false) { + writer.uint32(40).bool(message.required); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): HeaderParameter { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeaderParameter(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.type = reader.int32() as any; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.format = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.required = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): HeaderParameter { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + type: isSet(object.type) ? headerParameter_TypeFromJSON(object.type) : 0, + format: isSet(object.format) ? globalThis.String(object.format) : "", + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + }; + }, + + toJSON(message: HeaderParameter): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.type !== 0) { + obj.type = headerParameter_TypeToJSON(message.type); + } + if (message.format !== "") { + obj.format = message.format; + } + if (message.required !== false) { + obj.required = message.required; + } + return obj; + }, + + create(base?: DeepPartial): HeaderParameter { + return HeaderParameter.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): HeaderParameter { + const message = createBaseHeaderParameter(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.type = object.type ?? 0; + message.format = object.format ?? ""; + message.required = object.required ?? false; + return message; + }, +}; + +function createBaseHeader(): Header { + return { description: "", type: "", format: "", default: "", pattern: "" }; +} + +export const Header: MessageFns
= { + encode(message: Header, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + if (message.type !== "") { + writer.uint32(18).string(message.type); + } + if (message.format !== "") { + writer.uint32(26).string(message.format); + } + if (message.default !== "") { + writer.uint32(50).string(message.default); + } + if (message.pattern !== "") { + writer.uint32(106).string(message.pattern); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Header { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHeader(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.description = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.type = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.format = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.default = reader.string(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.pattern = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Header { + return { + description: isSet(object.description) ? globalThis.String(object.description) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + format: isSet(object.format) ? globalThis.String(object.format) : "", + default: isSet(object.default) ? globalThis.String(object.default) : "", + pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", + }; + }, + + toJSON(message: Header): unknown { + const obj: any = {}; + if (message.description !== "") { + obj.description = message.description; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.format !== "") { + obj.format = message.format; + } + if (message.default !== "") { + obj.default = message.default; + } + if (message.pattern !== "") { + obj.pattern = message.pattern; + } + return obj; + }, + + create(base?: DeepPartial
): Header { + return Header.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial
): Header { + const message = createBaseHeader(); + message.description = object.description ?? ""; + message.type = object.type ?? ""; + message.format = object.format ?? ""; + message.default = object.default ?? ""; + message.pattern = object.pattern ?? ""; + return message; + }, +}; + +function createBaseResponse(): Response { + return { description: "", schema: undefined, headers: {}, examples: {}, extensions: {} }; +} + +export const Response: MessageFns = { + encode(message: Response, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + if (message.schema !== undefined) { + Schema.encode(message.schema, writer.uint32(18).fork()).join(); + } + Object.entries(message.headers).forEach(([key, value]) => { + Response_HeadersEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + Object.entries(message.examples).forEach(([key, value]) => { + Response_ExamplesEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + }); + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + Response_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(42).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Response { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.description = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.schema = Schema.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + const entry3 = Response_HeadersEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.headers[entry3.key] = entry3.value; + } + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = Response_ExamplesEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.examples[entry4.key] = entry4.value; + } + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + const entry5 = Response_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry5.value !== undefined) { + message.extensions[entry5.key] = entry5.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Response { + return { + description: isSet(object.description) ? globalThis.String(object.description) : "", + schema: isSet(object.schema) ? Schema.fromJSON(object.schema) : undefined, + headers: isObject(object.headers) + ? Object.entries(object.headers).reduce<{ [key: string]: Header }>((acc, [key, value]) => { + acc[key] = Header.fromJSON(value); + return acc; + }, {}) + : {}, + examples: isObject(object.examples) + ? Object.entries(object.examples).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Response): unknown { + const obj: any = {}; + if (message.description !== "") { + obj.description = message.description; + } + if (message.schema !== undefined) { + obj.schema = Schema.toJSON(message.schema); + } + if (message.headers) { + const entries = Object.entries(message.headers); + if (entries.length > 0) { + obj.headers = {}; + entries.forEach(([k, v]) => { + obj.headers[k] = Header.toJSON(v); + }); + } + } + if (message.examples) { + const entries = Object.entries(message.examples); + if (entries.length > 0) { + obj.examples = {}; + entries.forEach(([k, v]) => { + obj.examples[k] = v; + }); + } + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): Response { + return Response.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Response { + const message = createBaseResponse(); + message.description = object.description ?? ""; + message.schema = (object.schema !== undefined && object.schema !== null) + ? Schema.fromPartial(object.schema) + : undefined; + message.headers = Object.entries(object.headers ?? {}).reduce<{ [key: string]: Header }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = Header.fromPartial(value); + } + return acc; + }, {}); + message.examples = Object.entries(object.examples ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseResponse_HeadersEntry(): Response_HeadersEntry { + return { key: "", value: undefined }; +} + +export const Response_HeadersEntry: MessageFns = { + encode(message: Response_HeadersEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Header.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Response_HeadersEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse_HeadersEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Header.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Response_HeadersEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? Header.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: Response_HeadersEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = Header.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): Response_HeadersEntry { + return Response_HeadersEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Response_HeadersEntry { + const message = createBaseResponse_HeadersEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? Header.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseResponse_ExamplesEntry(): Response_ExamplesEntry { + return { key: "", value: "" }; +} + +export const Response_ExamplesEntry: MessageFns = { + encode(message: Response_ExamplesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Response_ExamplesEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse_ExamplesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Response_ExamplesEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Response_ExamplesEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Response_ExamplesEntry { + return Response_ExamplesEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Response_ExamplesEntry { + const message = createBaseResponse_ExamplesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseResponse_ExtensionsEntry(): Response_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const Response_ExtensionsEntry: MessageFns = { + encode(message: Response_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Response_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResponse_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Response_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: Response_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Response_ExtensionsEntry { + return Response_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Response_ExtensionsEntry { + const message = createBaseResponse_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseInfo(): Info { + return { + title: "", + description: "", + termsOfService: "", + contact: undefined, + license: undefined, + version: "", + extensions: {}, + }; +} + +export const Info: MessageFns = { + encode(message: Info, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.title !== "") { + writer.uint32(10).string(message.title); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.termsOfService !== "") { + writer.uint32(26).string(message.termsOfService); + } + if (message.contact !== undefined) { + Contact.encode(message.contact, writer.uint32(34).fork()).join(); + } + if (message.license !== undefined) { + License.encode(message.license, writer.uint32(42).fork()).join(); + } + if (message.version !== "") { + writer.uint32(50).string(message.version); + } + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + Info_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(58).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Info { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.title = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.termsOfService = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.contact = Contact.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.license = License.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.version = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + const entry7 = Info_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry7.value !== undefined) { + message.extensions[entry7.key] = entry7.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Info { + return { + title: isSet(object.title) ? globalThis.String(object.title) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + termsOfService: isSet(object.termsOfService) ? globalThis.String(object.termsOfService) : "", + contact: isSet(object.contact) ? Contact.fromJSON(object.contact) : undefined, + license: isSet(object.license) ? License.fromJSON(object.license) : undefined, + version: isSet(object.version) ? globalThis.String(object.version) : "", + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Info): unknown { + const obj: any = {}; + if (message.title !== "") { + obj.title = message.title; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.termsOfService !== "") { + obj.termsOfService = message.termsOfService; + } + if (message.contact !== undefined) { + obj.contact = Contact.toJSON(message.contact); + } + if (message.license !== undefined) { + obj.license = License.toJSON(message.license); + } + if (message.version !== "") { + obj.version = message.version; + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): Info { + return Info.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Info { + const message = createBaseInfo(); + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.termsOfService = object.termsOfService ?? ""; + message.contact = (object.contact !== undefined && object.contact !== null) + ? Contact.fromPartial(object.contact) + : undefined; + message.license = (object.license !== undefined && object.license !== null) + ? License.fromPartial(object.license) + : undefined; + message.version = object.version ?? ""; + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseInfo_ExtensionsEntry(): Info_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const Info_ExtensionsEntry: MessageFns = { + encode(message: Info_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Info_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInfo_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Info_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: Info_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Info_ExtensionsEntry { + return Info_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Info_ExtensionsEntry { + const message = createBaseInfo_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseContact(): Contact { + return { name: "", url: "", email: "" }; +} + +export const Contact: MessageFns = { + encode(message: Contact, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + if (message.email !== "") { + writer.uint32(26).string(message.email); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Contact { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContact(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.url = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.email = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Contact { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + email: isSet(object.email) ? globalThis.String(object.email) : "", + }; + }, + + toJSON(message: Contact): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.url !== "") { + obj.url = message.url; + } + if (message.email !== "") { + obj.email = message.email; + } + return obj; + }, + + create(base?: DeepPartial): Contact { + return Contact.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Contact { + const message = createBaseContact(); + message.name = object.name ?? ""; + message.url = object.url ?? ""; + message.email = object.email ?? ""; + return message; + }, +}; + +function createBaseLicense(): License { + return { name: "", url: "" }; +} + +export const License: MessageFns = { + encode(message: License, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): License { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLicense(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.url = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): License { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + + toJSON(message: License): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + + create(base?: DeepPartial): License { + return License.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): License { + const message = createBaseLicense(); + message.name = object.name ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; + +function createBaseExternalDocumentation(): ExternalDocumentation { + return { description: "", url: "" }; +} + +export const ExternalDocumentation: MessageFns = { + encode(message: ExternalDocumentation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExternalDocumentation { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExternalDocumentation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.description = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.url = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExternalDocumentation { + return { + description: isSet(object.description) ? globalThis.String(object.description) : "", + url: isSet(object.url) ? globalThis.String(object.url) : "", + }; + }, + + toJSON(message: ExternalDocumentation): unknown { + const obj: any = {}; + if (message.description !== "") { + obj.description = message.description; + } + if (message.url !== "") { + obj.url = message.url; + } + return obj; + }, + + create(base?: DeepPartial): ExternalDocumentation { + return ExternalDocumentation.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExternalDocumentation { + const message = createBaseExternalDocumentation(); + message.description = object.description ?? ""; + message.url = object.url ?? ""; + return message; + }, +}; + +function createBaseSchema(): Schema { + return { jsonSchema: undefined, discriminator: "", readOnly: false, externalDocs: undefined, example: "" }; +} + +export const Schema: MessageFns = { + encode(message: Schema, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.jsonSchema !== undefined) { + JSONSchema.encode(message.jsonSchema, writer.uint32(10).fork()).join(); + } + if (message.discriminator !== "") { + writer.uint32(18).string(message.discriminator); + } + if (message.readOnly !== false) { + writer.uint32(24).bool(message.readOnly); + } + if (message.externalDocs !== undefined) { + ExternalDocumentation.encode(message.externalDocs, writer.uint32(42).fork()).join(); + } + if (message.example !== "") { + writer.uint32(50).string(message.example); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Schema { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSchema(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.jsonSchema = JSONSchema.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.discriminator = reader.string(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.readOnly = reader.bool(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.externalDocs = ExternalDocumentation.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.example = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Schema { + return { + jsonSchema: isSet(object.jsonSchema) ? JSONSchema.fromJSON(object.jsonSchema) : undefined, + discriminator: isSet(object.discriminator) ? globalThis.String(object.discriminator) : "", + readOnly: isSet(object.readOnly) ? globalThis.Boolean(object.readOnly) : false, + externalDocs: isSet(object.externalDocs) ? ExternalDocumentation.fromJSON(object.externalDocs) : undefined, + example: isSet(object.example) ? globalThis.String(object.example) : "", + }; + }, + + toJSON(message: Schema): unknown { + const obj: any = {}; + if (message.jsonSchema !== undefined) { + obj.jsonSchema = JSONSchema.toJSON(message.jsonSchema); + } + if (message.discriminator !== "") { + obj.discriminator = message.discriminator; + } + if (message.readOnly !== false) { + obj.readOnly = message.readOnly; + } + if (message.externalDocs !== undefined) { + obj.externalDocs = ExternalDocumentation.toJSON(message.externalDocs); + } + if (message.example !== "") { + obj.example = message.example; + } + return obj; + }, + + create(base?: DeepPartial): Schema { + return Schema.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Schema { + const message = createBaseSchema(); + message.jsonSchema = (object.jsonSchema !== undefined && object.jsonSchema !== null) + ? JSONSchema.fromPartial(object.jsonSchema) + : undefined; + message.discriminator = object.discriminator ?? ""; + message.readOnly = object.readOnly ?? false; + message.externalDocs = (object.externalDocs !== undefined && object.externalDocs !== null) + ? ExternalDocumentation.fromPartial(object.externalDocs) + : undefined; + message.example = object.example ?? ""; + return message; + }, +}; + +function createBaseEnumSchema(): EnumSchema { + return { + description: "", + default: "", + title: "", + required: false, + readOnly: false, + externalDocs: undefined, + example: "", + ref: "", + extensions: {}, + }; +} + +export const EnumSchema: MessageFns = { + encode(message: EnumSchema, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.description !== "") { + writer.uint32(10).string(message.description); + } + if (message.default !== "") { + writer.uint32(18).string(message.default); + } + if (message.title !== "") { + writer.uint32(26).string(message.title); + } + if (message.required !== false) { + writer.uint32(32).bool(message.required); + } + if (message.readOnly !== false) { + writer.uint32(40).bool(message.readOnly); + } + if (message.externalDocs !== undefined) { + ExternalDocumentation.encode(message.externalDocs, writer.uint32(50).fork()).join(); + } + if (message.example !== "") { + writer.uint32(58).string(message.example); + } + if (message.ref !== "") { + writer.uint32(66).string(message.ref); + } + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + EnumSchema_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(74).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumSchema { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumSchema(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.description = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.default = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.title = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.required = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.readOnly = reader.bool(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.externalDocs = ExternalDocumentation.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.example = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.ref = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + const entry9 = EnumSchema_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.extensions[entry9.key] = entry9.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumSchema { + return { + description: isSet(object.description) ? globalThis.String(object.description) : "", + default: isSet(object.default) ? globalThis.String(object.default) : "", + title: isSet(object.title) ? globalThis.String(object.title) : "", + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + readOnly: isSet(object.readOnly) ? globalThis.Boolean(object.readOnly) : false, + externalDocs: isSet(object.externalDocs) ? ExternalDocumentation.fromJSON(object.externalDocs) : undefined, + example: isSet(object.example) ? globalThis.String(object.example) : "", + ref: isSet(object.ref) ? globalThis.String(object.ref) : "", + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: EnumSchema): unknown { + const obj: any = {}; + if (message.description !== "") { + obj.description = message.description; + } + if (message.default !== "") { + obj.default = message.default; + } + if (message.title !== "") { + obj.title = message.title; + } + if (message.required !== false) { + obj.required = message.required; + } + if (message.readOnly !== false) { + obj.readOnly = message.readOnly; + } + if (message.externalDocs !== undefined) { + obj.externalDocs = ExternalDocumentation.toJSON(message.externalDocs); + } + if (message.example !== "") { + obj.example = message.example; + } + if (message.ref !== "") { + obj.ref = message.ref; + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): EnumSchema { + return EnumSchema.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumSchema { + const message = createBaseEnumSchema(); + message.description = object.description ?? ""; + message.default = object.default ?? ""; + message.title = object.title ?? ""; + message.required = object.required ?? false; + message.readOnly = object.readOnly ?? false; + message.externalDocs = (object.externalDocs !== undefined && object.externalDocs !== null) + ? ExternalDocumentation.fromPartial(object.externalDocs) + : undefined; + message.example = object.example ?? ""; + message.ref = object.ref ?? ""; + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseEnumSchema_ExtensionsEntry(): EnumSchema_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const EnumSchema_ExtensionsEntry: MessageFns = { + encode(message: EnumSchema_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumSchema_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumSchema_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumSchema_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: EnumSchema_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): EnumSchema_ExtensionsEntry { + return EnumSchema_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumSchema_ExtensionsEntry { + const message = createBaseEnumSchema_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseJSONSchema(): JSONSchema { + return { + ref: "", + title: "", + description: "", + default: "", + readOnly: false, + example: "", + multipleOf: 0, + maximum: 0, + exclusiveMaximum: false, + minimum: 0, + exclusiveMinimum: false, + maxLength: Long.UZERO, + minLength: Long.UZERO, + pattern: "", + maxItems: Long.UZERO, + minItems: Long.UZERO, + uniqueItems: false, + maxProperties: Long.UZERO, + minProperties: Long.UZERO, + required: [], + array: [], + type: [], + format: "", + enum: [], + fieldConfiguration: undefined, + extensions: {}, + }; +} + +export const JSONSchema: MessageFns = { + encode(message: JSONSchema, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.ref !== "") { + writer.uint32(26).string(message.ref); + } + if (message.title !== "") { + writer.uint32(42).string(message.title); + } + if (message.description !== "") { + writer.uint32(50).string(message.description); + } + if (message.default !== "") { + writer.uint32(58).string(message.default); + } + if (message.readOnly !== false) { + writer.uint32(64).bool(message.readOnly); + } + if (message.example !== "") { + writer.uint32(74).string(message.example); + } + if (message.multipleOf !== 0) { + writer.uint32(81).double(message.multipleOf); + } + if (message.maximum !== 0) { + writer.uint32(89).double(message.maximum); + } + if (message.exclusiveMaximum !== false) { + writer.uint32(96).bool(message.exclusiveMaximum); + } + if (message.minimum !== 0) { + writer.uint32(105).double(message.minimum); + } + if (message.exclusiveMinimum !== false) { + writer.uint32(112).bool(message.exclusiveMinimum); + } + if (!message.maxLength.equals(Long.UZERO)) { + writer.uint32(120).uint64(message.maxLength.toString()); + } + if (!message.minLength.equals(Long.UZERO)) { + writer.uint32(128).uint64(message.minLength.toString()); + } + if (message.pattern !== "") { + writer.uint32(138).string(message.pattern); + } + if (!message.maxItems.equals(Long.UZERO)) { + writer.uint32(160).uint64(message.maxItems.toString()); + } + if (!message.minItems.equals(Long.UZERO)) { + writer.uint32(168).uint64(message.minItems.toString()); + } + if (message.uniqueItems !== false) { + writer.uint32(176).bool(message.uniqueItems); + } + if (!message.maxProperties.equals(Long.UZERO)) { + writer.uint32(192).uint64(message.maxProperties.toString()); + } + if (!message.minProperties.equals(Long.UZERO)) { + writer.uint32(200).uint64(message.minProperties.toString()); + } + for (const v of message.required) { + writer.uint32(210).string(v!); + } + for (const v of message.array) { + writer.uint32(274).string(v!); + } + writer.uint32(282).fork(); + for (const v of message.type) { + writer.int32(v); + } + writer.join(); + if (message.format !== "") { + writer.uint32(290).string(message.format); + } + for (const v of message.enum) { + writer.uint32(370).string(v!); + } + if (message.fieldConfiguration !== undefined) { + JSONSchema_FieldConfiguration.encode(message.fieldConfiguration, writer.uint32(8010).fork()).join(); + } + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + JSONSchema_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(386).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): JSONSchema { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseJSONSchema(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (tag !== 26) { + break; + } + + message.ref = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.title = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.description = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.default = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.readOnly = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.example = reader.string(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.multipleOf = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.maximum = reader.double(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.exclusiveMaximum = reader.bool(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.minimum = reader.double(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.exclusiveMinimum = reader.bool(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.maxLength = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.minLength = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 17: { + if (tag !== 138) { + break; + } + + message.pattern = reader.string(); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.maxItems = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 21: { + if (tag !== 168) { + break; + } + + message.minItems = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 22: { + if (tag !== 176) { + break; + } + + message.uniqueItems = reader.bool(); + continue; + } + case 24: { + if (tag !== 192) { + break; + } + + message.maxProperties = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 25: { + if (tag !== 200) { + break; + } + + message.minProperties = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 26: { + if (tag !== 210) { + break; + } + + message.required.push(reader.string()); + continue; + } + case 34: { + if (tag !== 274) { + break; + } + + message.array.push(reader.string()); + continue; + } + case 35: { + if (tag === 280) { + message.type.push(reader.int32() as any); + + continue; + } + + if (tag === 282) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.type.push(reader.int32() as any); + } + + continue; + } + + break; + } + case 36: { + if (tag !== 290) { + break; + } + + message.format = reader.string(); + continue; + } + case 46: { + if (tag !== 370) { + break; + } + + message.enum.push(reader.string()); + continue; + } + case 1001: { + if (tag !== 8010) { + break; + } + + message.fieldConfiguration = JSONSchema_FieldConfiguration.decode(reader, reader.uint32()); + continue; + } + case 48: { + if (tag !== 386) { + break; + } + + const entry48 = JSONSchema_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry48.value !== undefined) { + message.extensions[entry48.key] = entry48.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): JSONSchema { + return { + ref: isSet(object.ref) ? globalThis.String(object.ref) : "", + title: isSet(object.title) ? globalThis.String(object.title) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + default: isSet(object.default) ? globalThis.String(object.default) : "", + readOnly: isSet(object.readOnly) ? globalThis.Boolean(object.readOnly) : false, + example: isSet(object.example) ? globalThis.String(object.example) : "", + multipleOf: isSet(object.multipleOf) ? globalThis.Number(object.multipleOf) : 0, + maximum: isSet(object.maximum) ? globalThis.Number(object.maximum) : 0, + exclusiveMaximum: isSet(object.exclusiveMaximum) ? globalThis.Boolean(object.exclusiveMaximum) : false, + minimum: isSet(object.minimum) ? globalThis.Number(object.minimum) : 0, + exclusiveMinimum: isSet(object.exclusiveMinimum) ? globalThis.Boolean(object.exclusiveMinimum) : false, + maxLength: isSet(object.maxLength) ? Long.fromValue(object.maxLength) : Long.UZERO, + minLength: isSet(object.minLength) ? Long.fromValue(object.minLength) : Long.UZERO, + pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", + maxItems: isSet(object.maxItems) ? Long.fromValue(object.maxItems) : Long.UZERO, + minItems: isSet(object.minItems) ? Long.fromValue(object.minItems) : Long.UZERO, + uniqueItems: isSet(object.uniqueItems) ? globalThis.Boolean(object.uniqueItems) : false, + maxProperties: isSet(object.maxProperties) ? Long.fromValue(object.maxProperties) : Long.UZERO, + minProperties: isSet(object.minProperties) ? Long.fromValue(object.minProperties) : Long.UZERO, + required: globalThis.Array.isArray(object?.required) ? object.required.map((e: any) => globalThis.String(e)) : [], + array: globalThis.Array.isArray(object?.array) ? object.array.map((e: any) => globalThis.String(e)) : [], + type: globalThis.Array.isArray(object?.type) + ? object.type.map((e: any) => jSONSchema_JSONSchemaSimpleTypesFromJSON(e)) + : [], + format: isSet(object.format) ? globalThis.String(object.format) : "", + enum: globalThis.Array.isArray(object?.enum) ? object.enum.map((e: any) => globalThis.String(e)) : [], + fieldConfiguration: isSet(object.fieldConfiguration) + ? JSONSchema_FieldConfiguration.fromJSON(object.fieldConfiguration) + : undefined, + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: JSONSchema): unknown { + const obj: any = {}; + if (message.ref !== "") { + obj.ref = message.ref; + } + if (message.title !== "") { + obj.title = message.title; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.default !== "") { + obj.default = message.default; + } + if (message.readOnly !== false) { + obj.readOnly = message.readOnly; + } + if (message.example !== "") { + obj.example = message.example; + } + if (message.multipleOf !== 0) { + obj.multipleOf = message.multipleOf; + } + if (message.maximum !== 0) { + obj.maximum = message.maximum; + } + if (message.exclusiveMaximum !== false) { + obj.exclusiveMaximum = message.exclusiveMaximum; + } + if (message.minimum !== 0) { + obj.minimum = message.minimum; + } + if (message.exclusiveMinimum !== false) { + obj.exclusiveMinimum = message.exclusiveMinimum; + } + if (!message.maxLength.equals(Long.UZERO)) { + obj.maxLength = (message.maxLength || Long.UZERO).toString(); + } + if (!message.minLength.equals(Long.UZERO)) { + obj.minLength = (message.minLength || Long.UZERO).toString(); + } + if (message.pattern !== "") { + obj.pattern = message.pattern; + } + if (!message.maxItems.equals(Long.UZERO)) { + obj.maxItems = (message.maxItems || Long.UZERO).toString(); + } + if (!message.minItems.equals(Long.UZERO)) { + obj.minItems = (message.minItems || Long.UZERO).toString(); + } + if (message.uniqueItems !== false) { + obj.uniqueItems = message.uniqueItems; + } + if (!message.maxProperties.equals(Long.UZERO)) { + obj.maxProperties = (message.maxProperties || Long.UZERO).toString(); + } + if (!message.minProperties.equals(Long.UZERO)) { + obj.minProperties = (message.minProperties || Long.UZERO).toString(); + } + if (message.required?.length) { + obj.required = message.required; + } + if (message.array?.length) { + obj.array = message.array; + } + if (message.type?.length) { + obj.type = message.type.map((e) => jSONSchema_JSONSchemaSimpleTypesToJSON(e)); + } + if (message.format !== "") { + obj.format = message.format; + } + if (message.enum?.length) { + obj.enum = message.enum; + } + if (message.fieldConfiguration !== undefined) { + obj.fieldConfiguration = JSONSchema_FieldConfiguration.toJSON(message.fieldConfiguration); + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): JSONSchema { + return JSONSchema.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): JSONSchema { + const message = createBaseJSONSchema(); + message.ref = object.ref ?? ""; + message.title = object.title ?? ""; + message.description = object.description ?? ""; + message.default = object.default ?? ""; + message.readOnly = object.readOnly ?? false; + message.example = object.example ?? ""; + message.multipleOf = object.multipleOf ?? 0; + message.maximum = object.maximum ?? 0; + message.exclusiveMaximum = object.exclusiveMaximum ?? false; + message.minimum = object.minimum ?? 0; + message.exclusiveMinimum = object.exclusiveMinimum ?? false; + message.maxLength = (object.maxLength !== undefined && object.maxLength !== null) + ? Long.fromValue(object.maxLength) + : Long.UZERO; + message.minLength = (object.minLength !== undefined && object.minLength !== null) + ? Long.fromValue(object.minLength) + : Long.UZERO; + message.pattern = object.pattern ?? ""; + message.maxItems = (object.maxItems !== undefined && object.maxItems !== null) + ? Long.fromValue(object.maxItems) + : Long.UZERO; + message.minItems = (object.minItems !== undefined && object.minItems !== null) + ? Long.fromValue(object.minItems) + : Long.UZERO; + message.uniqueItems = object.uniqueItems ?? false; + message.maxProperties = (object.maxProperties !== undefined && object.maxProperties !== null) + ? Long.fromValue(object.maxProperties) + : Long.UZERO; + message.minProperties = (object.minProperties !== undefined && object.minProperties !== null) + ? Long.fromValue(object.minProperties) + : Long.UZERO; + message.required = object.required?.map((e) => e) || []; + message.array = object.array?.map((e) => e) || []; + message.type = object.type?.map((e) => e) || []; + message.format = object.format ?? ""; + message.enum = object.enum?.map((e) => e) || []; + message.fieldConfiguration = (object.fieldConfiguration !== undefined && object.fieldConfiguration !== null) + ? JSONSchema_FieldConfiguration.fromPartial(object.fieldConfiguration) + : undefined; + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseJSONSchema_FieldConfiguration(): JSONSchema_FieldConfiguration { + return { pathParamName: "" }; +} + +export const JSONSchema_FieldConfiguration: MessageFns = { + encode(message: JSONSchema_FieldConfiguration, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pathParamName !== "") { + writer.uint32(378).string(message.pathParamName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): JSONSchema_FieldConfiguration { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseJSONSchema_FieldConfiguration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 47: { + if (tag !== 378) { + break; + } + + message.pathParamName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): JSONSchema_FieldConfiguration { + return { pathParamName: isSet(object.pathParamName) ? globalThis.String(object.pathParamName) : "" }; + }, + + toJSON(message: JSONSchema_FieldConfiguration): unknown { + const obj: any = {}; + if (message.pathParamName !== "") { + obj.pathParamName = message.pathParamName; + } + return obj; + }, + + create(base?: DeepPartial): JSONSchema_FieldConfiguration { + return JSONSchema_FieldConfiguration.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): JSONSchema_FieldConfiguration { + const message = createBaseJSONSchema_FieldConfiguration(); + message.pathParamName = object.pathParamName ?? ""; + return message; + }, +}; + +function createBaseJSONSchema_ExtensionsEntry(): JSONSchema_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const JSONSchema_ExtensionsEntry: MessageFns = { + encode(message: JSONSchema_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): JSONSchema_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseJSONSchema_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): JSONSchema_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: JSONSchema_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): JSONSchema_ExtensionsEntry { + return JSONSchema_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): JSONSchema_ExtensionsEntry { + const message = createBaseJSONSchema_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseTag(): Tag { + return { name: "", description: "", externalDocs: undefined, extensions: {} }; +} + +export const Tag: MessageFns = { + encode(message: Tag, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.externalDocs !== undefined) { + ExternalDocumentation.encode(message.externalDocs, writer.uint32(26).fork()).join(); + } + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + Tag_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(34).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Tag { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTag(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.externalDocs = ExternalDocumentation.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + const entry4 = Tag_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry4.value !== undefined) { + message.extensions[entry4.key] = entry4.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Tag { + return { + name: isSet(object.name) ? globalThis.String(object.name) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + externalDocs: isSet(object.externalDocs) ? ExternalDocumentation.fromJSON(object.externalDocs) : undefined, + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Tag): unknown { + const obj: any = {}; + if (message.name !== "") { + obj.name = message.name; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.externalDocs !== undefined) { + obj.externalDocs = ExternalDocumentation.toJSON(message.externalDocs); + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): Tag { + return Tag.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Tag { + const message = createBaseTag(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.externalDocs = (object.externalDocs !== undefined && object.externalDocs !== null) + ? ExternalDocumentation.fromPartial(object.externalDocs) + : undefined; + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseTag_ExtensionsEntry(): Tag_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const Tag_ExtensionsEntry: MessageFns = { + encode(message: Tag_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Tag_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTag_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Tag_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: Tag_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Tag_ExtensionsEntry { + return Tag_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Tag_ExtensionsEntry { + const message = createBaseTag_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseSecurityDefinitions(): SecurityDefinitions { + return { security: {} }; +} + +export const SecurityDefinitions: MessageFns = { + encode(message: SecurityDefinitions, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.security).forEach(([key, value]) => { + SecurityDefinitions_SecurityEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecurityDefinitions { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecurityDefinitions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = SecurityDefinitions_SecurityEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.security[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecurityDefinitions { + return { + security: isObject(object.security) + ? Object.entries(object.security).reduce<{ [key: string]: SecurityScheme }>((acc, [key, value]) => { + acc[key] = SecurityScheme.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: SecurityDefinitions): unknown { + const obj: any = {}; + if (message.security) { + const entries = Object.entries(message.security); + if (entries.length > 0) { + obj.security = {}; + entries.forEach(([k, v]) => { + obj.security[k] = SecurityScheme.toJSON(v); + }); + } + } + return obj; + }, + + create(base?: DeepPartial): SecurityDefinitions { + return SecurityDefinitions.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecurityDefinitions { + const message = createBaseSecurityDefinitions(); + message.security = Object.entries(object.security ?? {}).reduce<{ [key: string]: SecurityScheme }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = SecurityScheme.fromPartial(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseSecurityDefinitions_SecurityEntry(): SecurityDefinitions_SecurityEntry { + return { key: "", value: undefined }; +} + +export const SecurityDefinitions_SecurityEntry: MessageFns = { + encode(message: SecurityDefinitions_SecurityEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + SecurityScheme.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecurityDefinitions_SecurityEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecurityDefinitions_SecurityEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = SecurityScheme.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecurityDefinitions_SecurityEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? SecurityScheme.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: SecurityDefinitions_SecurityEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = SecurityScheme.toJSON(message.value); + } + return obj; + }, + + create(base?: DeepPartial): SecurityDefinitions_SecurityEntry { + return SecurityDefinitions_SecurityEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecurityDefinitions_SecurityEntry { + const message = createBaseSecurityDefinitions_SecurityEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? SecurityScheme.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseSecurityScheme(): SecurityScheme { + return { + type: 0, + description: "", + name: "", + in: 0, + flow: 0, + authorizationUrl: "", + tokenUrl: "", + scopes: undefined, + extensions: {}, + }; +} + +export const SecurityScheme: MessageFns = { + encode(message: SecurityScheme, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.in !== 0) { + writer.uint32(32).int32(message.in); + } + if (message.flow !== 0) { + writer.uint32(40).int32(message.flow); + } + if (message.authorizationUrl !== "") { + writer.uint32(50).string(message.authorizationUrl); + } + if (message.tokenUrl !== "") { + writer.uint32(58).string(message.tokenUrl); + } + if (message.scopes !== undefined) { + Scopes.encode(message.scopes, writer.uint32(66).fork()).join(); + } + Object.entries(message.extensions).forEach(([key, value]) => { + if (value !== undefined) { + SecurityScheme_ExtensionsEntry.encode({ key: key as any, value }, writer.uint32(74).fork()).join(); + } + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecurityScheme { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecurityScheme(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.type = reader.int32() as any; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.name = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.in = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.flow = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.authorizationUrl = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.tokenUrl = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.scopes = Scopes.decode(reader, reader.uint32()); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + const entry9 = SecurityScheme_ExtensionsEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.extensions[entry9.key] = entry9.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecurityScheme { + return { + type: isSet(object.type) ? securityScheme_TypeFromJSON(object.type) : 0, + description: isSet(object.description) ? globalThis.String(object.description) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + in: isSet(object.in) ? securityScheme_InFromJSON(object.in) : 0, + flow: isSet(object.flow) ? securityScheme_FlowFromJSON(object.flow) : 0, + authorizationUrl: isSet(object.authorizationUrl) ? globalThis.String(object.authorizationUrl) : "", + tokenUrl: isSet(object.tokenUrl) ? globalThis.String(object.tokenUrl) : "", + scopes: isSet(object.scopes) ? Scopes.fromJSON(object.scopes) : undefined, + extensions: isObject(object.extensions) + ? Object.entries(object.extensions).reduce<{ [key: string]: any | undefined }>((acc, [key, value]) => { + acc[key] = value as any | undefined; + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: SecurityScheme): unknown { + const obj: any = {}; + if (message.type !== 0) { + obj.type = securityScheme_TypeToJSON(message.type); + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.in !== 0) { + obj.in = securityScheme_InToJSON(message.in); + } + if (message.flow !== 0) { + obj.flow = securityScheme_FlowToJSON(message.flow); + } + if (message.authorizationUrl !== "") { + obj.authorizationUrl = message.authorizationUrl; + } + if (message.tokenUrl !== "") { + obj.tokenUrl = message.tokenUrl; + } + if (message.scopes !== undefined) { + obj.scopes = Scopes.toJSON(message.scopes); + } + if (message.extensions) { + const entries = Object.entries(message.extensions); + if (entries.length > 0) { + obj.extensions = {}; + entries.forEach(([k, v]) => { + obj.extensions[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): SecurityScheme { + return SecurityScheme.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecurityScheme { + const message = createBaseSecurityScheme(); + message.type = object.type ?? 0; + message.description = object.description ?? ""; + message.name = object.name ?? ""; + message.in = object.in ?? 0; + message.flow = object.flow ?? 0; + message.authorizationUrl = object.authorizationUrl ?? ""; + message.tokenUrl = object.tokenUrl ?? ""; + message.scopes = (object.scopes !== undefined && object.scopes !== null) + ? Scopes.fromPartial(object.scopes) + : undefined; + message.extensions = Object.entries(object.extensions ?? {}).reduce<{ [key: string]: any | undefined }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = value; + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseSecurityScheme_ExtensionsEntry(): SecurityScheme_ExtensionsEntry { + return { key: "", value: undefined }; +} + +export const SecurityScheme_ExtensionsEntry: MessageFns = { + encode(message: SecurityScheme_ExtensionsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecurityScheme_ExtensionsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecurityScheme_ExtensionsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = Value.unwrap(Value.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecurityScheme_ExtensionsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object?.value) ? object.value : undefined, + }; + }, + + toJSON(message: SecurityScheme_ExtensionsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): SecurityScheme_ExtensionsEntry { + return SecurityScheme_ExtensionsEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecurityScheme_ExtensionsEntry { + const message = createBaseSecurityScheme_ExtensionsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? undefined; + return message; + }, +}; + +function createBaseSecurityRequirement(): SecurityRequirement { + return { securityRequirement: {} }; +} + +export const SecurityRequirement: MessageFns = { + encode(message: SecurityRequirement, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.securityRequirement).forEach(([key, value]) => { + SecurityRequirement_SecurityRequirementEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecurityRequirement { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecurityRequirement(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = SecurityRequirement_SecurityRequirementEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.securityRequirement[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecurityRequirement { + return { + securityRequirement: isObject(object.securityRequirement) + ? Object.entries(object.securityRequirement).reduce< + { [key: string]: SecurityRequirement_SecurityRequirementValue } + >((acc, [key, value]) => { + acc[key] = SecurityRequirement_SecurityRequirementValue.fromJSON(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: SecurityRequirement): unknown { + const obj: any = {}; + if (message.securityRequirement) { + const entries = Object.entries(message.securityRequirement); + if (entries.length > 0) { + obj.securityRequirement = {}; + entries.forEach(([k, v]) => { + obj.securityRequirement[k] = SecurityRequirement_SecurityRequirementValue.toJSON(v); + }); + } + } + return obj; + }, + + create(base?: DeepPartial): SecurityRequirement { + return SecurityRequirement.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SecurityRequirement { + const message = createBaseSecurityRequirement(); + message.securityRequirement = Object.entries(object.securityRequirement ?? {}).reduce< + { [key: string]: SecurityRequirement_SecurityRequirementValue } + >((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = SecurityRequirement_SecurityRequirementValue.fromPartial(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseSecurityRequirement_SecurityRequirementValue(): SecurityRequirement_SecurityRequirementValue { + return { scope: [] }; +} + +export const SecurityRequirement_SecurityRequirementValue: MessageFns = { + encode( + message: SecurityRequirement_SecurityRequirementValue, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + for (const v of message.scope) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecurityRequirement_SecurityRequirementValue { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecurityRequirement_SecurityRequirementValue(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.scope.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecurityRequirement_SecurityRequirementValue { + return { scope: globalThis.Array.isArray(object?.scope) ? object.scope.map((e: any) => globalThis.String(e)) : [] }; + }, + + toJSON(message: SecurityRequirement_SecurityRequirementValue): unknown { + const obj: any = {}; + if (message.scope?.length) { + obj.scope = message.scope; + } + return obj; + }, + + create( + base?: DeepPartial, + ): SecurityRequirement_SecurityRequirementValue { + return SecurityRequirement_SecurityRequirementValue.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): SecurityRequirement_SecurityRequirementValue { + const message = createBaseSecurityRequirement_SecurityRequirementValue(); + message.scope = object.scope?.map((e) => e) || []; + return message; + }, +}; + +function createBaseSecurityRequirement_SecurityRequirementEntry(): SecurityRequirement_SecurityRequirementEntry { + return { key: "", value: undefined }; +} + +export const SecurityRequirement_SecurityRequirementEntry: MessageFns = { + encode( + message: SecurityRequirement_SecurityRequirementEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== undefined) { + SecurityRequirement_SecurityRequirementValue.encode(message.value, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SecurityRequirement_SecurityRequirementEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSecurityRequirement_SecurityRequirementEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = SecurityRequirement_SecurityRequirementValue.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SecurityRequirement_SecurityRequirementEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? SecurityRequirement_SecurityRequirementValue.fromJSON(object.value) : undefined, + }; + }, + + toJSON(message: SecurityRequirement_SecurityRequirementEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== undefined) { + obj.value = SecurityRequirement_SecurityRequirementValue.toJSON(message.value); + } + return obj; + }, + + create( + base?: DeepPartial, + ): SecurityRequirement_SecurityRequirementEntry { + return SecurityRequirement_SecurityRequirementEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): SecurityRequirement_SecurityRequirementEntry { + const message = createBaseSecurityRequirement_SecurityRequirementEntry(); + message.key = object.key ?? ""; + message.value = (object.value !== undefined && object.value !== null) + ? SecurityRequirement_SecurityRequirementValue.fromPartial(object.value) + : undefined; + return message; + }, +}; + +function createBaseScopes(): Scopes { + return { scope: {} }; +} + +export const Scopes: MessageFns = { + encode(message: Scopes, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + Object.entries(message.scope).forEach(([key, value]) => { + Scopes_ScopeEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join(); + }); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Scopes { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScopes(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + const entry1 = Scopes_ScopeEntry.decode(reader, reader.uint32()); + if (entry1.value !== undefined) { + message.scope[entry1.key] = entry1.value; + } + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Scopes { + return { + scope: isObject(object.scope) + ? Object.entries(object.scope).reduce<{ [key: string]: string }>((acc, [key, value]) => { + acc[key] = String(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: Scopes): unknown { + const obj: any = {}; + if (message.scope) { + const entries = Object.entries(message.scope); + if (entries.length > 0) { + obj.scope = {}; + entries.forEach(([k, v]) => { + obj.scope[k] = v; + }); + } + } + return obj; + }, + + create(base?: DeepPartial): Scopes { + return Scopes.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Scopes { + const message = createBaseScopes(); + message.scope = Object.entries(object.scope ?? {}).reduce<{ [key: string]: string }>((acc, [key, value]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, {}); + return message; + }, +}; + +function createBaseScopes_ScopeEntry(): Scopes_ScopeEntry { + return { key: "", value: "" }; +} + +export const Scopes_ScopeEntry: MessageFns = { + encode(message: Scopes_ScopeEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Scopes_ScopeEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScopes_ScopeEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Scopes_ScopeEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.String(object.value) : "", + }; + }, + + toJSON(message: Scopes_ScopeEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== "") { + obj.value = message.value; + } + return obj; + }, + + create(base?: DeepPartial): Scopes_ScopeEntry { + return Scopes_ScopeEntry.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Scopes_ScopeEntry { + const message = createBaseScopes_ScopeEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function isObject(value: any): boolean { + return typeof value === "object" && value !== null; +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +} diff --git a/src/grpc/generated/validate/validate.ts b/src/grpc/generated/validate/validate.ts new file mode 100644 index 0000000..7d741fc --- /dev/null +++ b/src/grpc/generated/validate/validate.ts @@ -0,0 +1,6048 @@ +// Code generated by protoc-gen-ts_proto. DO NOT EDIT. +// versions: +// protoc-gen-ts_proto v2.8.3 +// protoc unknown +// source: validate/validate.proto + +/* eslint-disable */ +import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; +import Long from "long"; +import { Duration } from "../google/protobuf/duration"; +import { Timestamp } from "../google/protobuf/timestamp"; + +export const protobufPackage = "validate"; + +/** WellKnownRegex contain some well-known patterns. */ +export enum KnownRegex { + UNKNOWN = 0, + /** HTTP_HEADER_NAME - HTTP header name as defined by RFC 7230. */ + HTTP_HEADER_NAME = 1, + /** HTTP_HEADER_VALUE - HTTP header value as defined by RFC 7230. */ + HTTP_HEADER_VALUE = 2, + UNRECOGNIZED = -1, +} + +export function knownRegexFromJSON(object: any): KnownRegex { + switch (object) { + case 0: + case "UNKNOWN": + return KnownRegex.UNKNOWN; + case 1: + case "HTTP_HEADER_NAME": + return KnownRegex.HTTP_HEADER_NAME; + case 2: + case "HTTP_HEADER_VALUE": + return KnownRegex.HTTP_HEADER_VALUE; + case -1: + case "UNRECOGNIZED": + default: + return KnownRegex.UNRECOGNIZED; + } +} + +export function knownRegexToJSON(object: KnownRegex): string { + switch (object) { + case KnownRegex.UNKNOWN: + return "UNKNOWN"; + case KnownRegex.HTTP_HEADER_NAME: + return "HTTP_HEADER_NAME"; + case KnownRegex.HTTP_HEADER_VALUE: + return "HTTP_HEADER_VALUE"; + case KnownRegex.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * FieldRules encapsulates the rules for each type of field. Depending on the + * field, the correct set should be used to ensure proper validations. + */ +export interface FieldRules { + message?: MessageRules | undefined; + type?: + | // + /** Scalar Field Types */ + { $case: "float"; float: FloatRules } + | { $case: "double"; double: DoubleRules } + | { $case: "int32"; int32: Int32Rules } + | { $case: "int64"; int64: Int64Rules } + | { $case: "uint32"; uint32: UInt32Rules } + | { $case: "uint64"; uint64: UInt64Rules } + | { $case: "sint32"; sint32: SInt32Rules } + | { $case: "sint64"; sint64: SInt64Rules } + | { $case: "fixed32"; fixed32: Fixed32Rules } + | { $case: "fixed64"; fixed64: Fixed64Rules } + | { $case: "sfixed32"; sfixed32: SFixed32Rules } + | { $case: "sfixed64"; sfixed64: SFixed64Rules } + | { $case: "bool"; bool: BoolRules } + | { $case: "string"; string: StringRules } + | { $case: "bytes"; bytes: BytesRules } + | // + /** Complex Field Types */ + { $case: "enum"; enum: EnumRules } + | { $case: "repeated"; repeated: RepeatedRules } + | { $case: "map"; map: MapRules } + | // + /** Well-Known Field Types */ + { $case: "any"; any: AnyRules } + | { $case: "duration"; duration: DurationRules } + | { $case: "timestamp"; timestamp: TimestampRules } + | undefined; +} + +/** FloatRules describes the constraints applied to `float` values */ +export interface FloatRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** DoubleRules describes the constraints applied to `double` values */ +export interface DoubleRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Int32Rules describes the constraints applied to `int32` values */ +export interface Int32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Int64Rules describes the constraints applied to `int64` values */ +export interface Int64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | Long + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Long + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | Long + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | Long + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | Long + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Long[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Long[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** UInt32Rules describes the constraints applied to `uint32` values */ +export interface UInt32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** UInt64Rules describes the constraints applied to `uint64` values */ +export interface UInt64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | Long + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Long + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | Long + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | Long + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | Long + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Long[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Long[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SInt32Rules describes the constraints applied to `sint32` values */ +export interface SInt32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SInt64Rules describes the constraints applied to `sint64` values */ +export interface SInt64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | Long + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Long + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | Long + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | Long + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | Long + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Long[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Long[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Fixed32Rules describes the constraints applied to `fixed32` values */ +export interface Fixed32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** Fixed64Rules describes the constraints applied to `fixed64` values */ +export interface Fixed64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | Long + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Long + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | Long + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | Long + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | Long + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Long[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Long[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SFixed32Rules describes the constraints applied to `sfixed32` values */ +export interface SFixed32Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | number + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | number + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | number + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | number + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** SFixed64Rules describes the constraints applied to `sfixed64` values */ +export interface SFixed64Rules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | Long + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Long + | undefined; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + */ + lte?: + | Long + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive. If the value of Gt is larger than a specified Lt or Lte, the + * range is reversed. + */ + gt?: + | Long + | undefined; + /** + * Gte specifies that this field must be greater than or equal to the + * specified value, inclusive. If the value of Gte is larger than a + * specified Lt or Lte, the range is reversed. + */ + gte?: + | Long + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Long[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Long[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** BoolRules describes the constraints applied to `bool` values */ +export interface BoolRules { + /** Const specifies that this field must be exactly the specified value */ + const?: boolean | undefined; +} + +/** StringRules describe the constraints applied to `string` values */ +export interface StringRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | string + | undefined; + /** + * Len specifies that this field must be the specified number of + * characters (Unicode code points). Note that the number of + * characters may differ from the number of bytes in the string. + */ + len?: + | Long + | undefined; + /** + * MinLen specifies that this field must be the specified number of + * characters (Unicode code points) at a minimum. Note that the number of + * characters may differ from the number of bytes in the string. + */ + minLen?: + | Long + | undefined; + /** + * MaxLen specifies that this field must be the specified number of + * characters (Unicode code points) at a maximum. Note that the number of + * characters may differ from the number of bytes in the string. + */ + maxLen?: + | Long + | undefined; + /** LenBytes specifies that this field must be the specified number of bytes */ + lenBytes?: + | Long + | undefined; + /** + * MinBytes specifies that this field must be the specified number of bytes + * at a minimum + */ + minBytes?: + | Long + | undefined; + /** + * MaxBytes specifies that this field must be the specified number of bytes + * at a maximum + */ + maxBytes?: + | Long + | undefined; + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + */ + pattern?: + | string + | undefined; + /** + * Prefix specifies that this field must have the specified substring at + * the beginning of the string. + */ + prefix?: + | string + | undefined; + /** + * Suffix specifies that this field must have the specified substring at + * the end of the string. + */ + suffix?: + | string + | undefined; + /** + * Contains specifies that this field must have the specified substring + * anywhere in the string. + */ + contains?: + | string + | undefined; + /** + * NotContains specifies that this field cannot have the specified substring + * anywhere in the string. + */ + notContains?: + | string + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: string[]; + /** + * WellKnown rules provide advanced constraints against common string + * patterns + */ + wellKnown?: + | // + /** + * Email specifies that the field must be a valid email address as + * defined by RFC 5322 + */ + { $case: "email"; email: boolean } + | // + /** + * Hostname specifies that the field must be a valid hostname as + * defined by RFC 1034. This constraint does not support + * internationalized domain names (IDNs). + */ + { $case: "hostname"; hostname: boolean } + | // + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address. + * Valid IPv6 addresses should not include surrounding square brackets. + */ + { $case: "ip"; ip: boolean } + | // + /** Ipv4 specifies that the field must be a valid IPv4 address. */ + { $case: "ipv4"; ipv4: boolean } + | // + /** + * Ipv6 specifies that the field must be a valid IPv6 address. Valid + * IPv6 addresses should not include surrounding square brackets. + */ + { $case: "ipv6"; ipv6: boolean } + | // + /** + * Uri specifies that the field must be a valid, absolute URI as defined + * by RFC 3986 + */ + { $case: "uri"; uri: boolean } + | // + /** + * UriRef specifies that the field must be a valid URI as defined by RFC + * 3986 and may be relative or absolute. + */ + { $case: "uriRef"; uriRef: boolean } + | // + /** + * Address specifies that the field must be either a valid hostname as + * defined by RFC 1034 (which does not support internationalized domain + * names or IDNs), or it can be a valid IP (v4 or v6). + */ + { $case: "address"; address: boolean } + | // + /** + * Uuid specifies that the field must be a valid UUID as defined by + * RFC 4122 + */ + { $case: "uuid"; uuid: boolean } + | // + /** WellKnownRegex specifies a common well known pattern defined as a regex. */ + { $case: "wellKnownRegex"; wellKnownRegex: KnownRegex } + | undefined; + /** + * This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable + * strict header validation. + * By default, this is true, and HTTP header validations are RFC-compliant. + * Setting to false will enable a looser validations that only disallows + * \r\n\0 characters, which can be used to bypass header matching rules. + */ + strict?: + | boolean + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** BytesRules describe the constraints applied to `bytes` values */ +export interface BytesRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | Buffer + | undefined; + /** Len specifies that this field must be the specified number of bytes */ + len?: + | Long + | undefined; + /** + * MinLen specifies that this field must be the specified number of bytes + * at a minimum + */ + minLen?: + | Long + | undefined; + /** + * MaxLen specifies that this field must be the specified number of bytes + * at a maximum + */ + maxLen?: + | Long + | undefined; + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + */ + pattern?: + | string + | undefined; + /** + * Prefix specifies that this field must have the specified bytes at the + * beginning of the string. + */ + prefix?: + | Buffer + | undefined; + /** + * Suffix specifies that this field must have the specified bytes at the + * end of the string. + */ + suffix?: + | Buffer + | undefined; + /** + * Contains specifies that this field must have the specified bytes + * anywhere in the string. + */ + contains?: + | Buffer + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Buffer[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Buffer[]; + /** + * WellKnown rules provide advanced constraints against common byte + * patterns + */ + wellKnown?: + | // + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address in + * byte format + */ + { $case: "ip"; ip: boolean } + | // + /** + * Ipv4 specifies that the field must be a valid IPv4 address in byte + * format + */ + { $case: "ipv4"; ipv4: boolean } + | // + /** + * Ipv6 specifies that the field must be a valid IPv6 address in byte + * format + */ + { $case: "ipv6"; ipv6: boolean } + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** EnumRules describe the constraints applied to enum values */ +export interface EnumRules { + /** Const specifies that this field must be exactly the specified value */ + const?: + | number + | undefined; + /** + * DefinedOnly specifies that this field must be only one of the defined + * values for this enum, failing on any undefined value. + */ + definedOnly?: + | boolean + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: number[]; +} + +/** + * MessageRules describe the constraints applied to embedded message values. + * For message-type fields, validation is performed recursively. + */ +export interface MessageRules { + /** + * Skip specifies that the validation rules of this field should not be + * evaluated + */ + skip?: + | boolean + | undefined; + /** Required specifies that this field must be set */ + required?: boolean | undefined; +} + +/** RepeatedRules describe the constraints applied to `repeated` values */ +export interface RepeatedRules { + /** + * MinItems specifies that this field must have the specified number of + * items at a minimum + */ + minItems?: + | Long + | undefined; + /** + * MaxItems specifies that this field must have the specified number of + * items at a maximum + */ + maxItems?: + | Long + | undefined; + /** + * Unique specifies that all elements in this field must be unique. This + * constraint is only applicable to scalar and enum types (messages are not + * supported). + */ + unique?: + | boolean + | undefined; + /** + * Items specifies the constraints to be applied to each item in the field. + * Repeated message fields will still execute validation against each item + * unless skip is specified here. + */ + items?: + | FieldRules + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** MapRules describe the constraints applied to `map` values */ +export interface MapRules { + /** + * MinPairs specifies that this field must have the specified number of + * KVs at a minimum + */ + minPairs?: + | Long + | undefined; + /** + * MaxPairs specifies that this field must have the specified number of + * KVs at a maximum + */ + maxPairs?: + | Long + | undefined; + /** + * NoSparse specifies values in this field cannot be unset. This only + * applies to map's with message value types. + */ + noSparse?: + | boolean + | undefined; + /** Keys specifies the constraints to be applied to each key in the field. */ + keys?: + | FieldRules + | undefined; + /** + * Values specifies the constraints to be applied to the value of each key + * in the field. Message values will still have their validations evaluated + * unless skip is specified here. + */ + values?: + | FieldRules + | undefined; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + */ + ignoreEmpty?: boolean | undefined; +} + +/** + * AnyRules describe constraints applied exclusively to the + * `google.protobuf.Any` well-known type + */ +export interface AnyRules { + /** Required specifies that this field must be set */ + required?: + | boolean + | undefined; + /** + * In specifies that this field's `type_url` must be equal to one of the + * specified values. + */ + in: string[]; + /** + * NotIn specifies that this field's `type_url` must not be equal to any of + * the specified values. + */ + notIn: string[]; +} + +/** + * DurationRules describe the constraints applied exclusively to the + * `google.protobuf.Duration` well-known type + */ +export interface DurationRules { + /** Required specifies that this field must be set */ + required?: + | boolean + | undefined; + /** Const specifies that this field must be exactly the specified value */ + const?: + | Duration + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Duration + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * inclusive + */ + lte?: + | Duration + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + */ + gt?: + | Duration + | undefined; + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + */ + gte?: + | Duration + | undefined; + /** + * In specifies that this field must be equal to one of the specified + * values + */ + in: Duration[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + */ + notIn: Duration[]; +} + +/** + * TimestampRules describe the constraints applied exclusively to the + * `google.protobuf.Timestamp` well-known type + */ +export interface TimestampRules { + /** Required specifies that this field must be set */ + required?: + | boolean + | undefined; + /** Const specifies that this field must be exactly the specified value */ + const?: + | Date + | undefined; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + */ + lt?: + | Date + | undefined; + /** + * Lte specifies that this field must be less than the specified value, + * inclusive + */ + lte?: + | Date + | undefined; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + */ + gt?: + | Date + | undefined; + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + */ + gte?: + | Date + | undefined; + /** + * LtNow specifies that this must be less than the current time. LtNow + * can only be used with the Within rule. + */ + ltNow?: + | boolean + | undefined; + /** + * GtNow specifies that this must be greater than the current time. GtNow + * can only be used with the Within rule. + */ + gtNow?: + | boolean + | undefined; + /** + * Within specifies that this field must be within this duration of the + * current time. This constraint can be used alone or with the LtNow and + * GtNow rules. + */ + within?: Duration | undefined; +} + +function createBaseFieldRules(): FieldRules { + return { message: undefined, type: undefined }; +} + +export const FieldRules: MessageFns = { + encode(message: FieldRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.message !== undefined) { + MessageRules.encode(message.message, writer.uint32(138).fork()).join(); + } + switch (message.type?.$case) { + case "float": + FloatRules.encode(message.type.float, writer.uint32(10).fork()).join(); + break; + case "double": + DoubleRules.encode(message.type.double, writer.uint32(18).fork()).join(); + break; + case "int32": + Int32Rules.encode(message.type.int32, writer.uint32(26).fork()).join(); + break; + case "int64": + Int64Rules.encode(message.type.int64, writer.uint32(34).fork()).join(); + break; + case "uint32": + UInt32Rules.encode(message.type.uint32, writer.uint32(42).fork()).join(); + break; + case "uint64": + UInt64Rules.encode(message.type.uint64, writer.uint32(50).fork()).join(); + break; + case "sint32": + SInt32Rules.encode(message.type.sint32, writer.uint32(58).fork()).join(); + break; + case "sint64": + SInt64Rules.encode(message.type.sint64, writer.uint32(66).fork()).join(); + break; + case "fixed32": + Fixed32Rules.encode(message.type.fixed32, writer.uint32(74).fork()).join(); + break; + case "fixed64": + Fixed64Rules.encode(message.type.fixed64, writer.uint32(82).fork()).join(); + break; + case "sfixed32": + SFixed32Rules.encode(message.type.sfixed32, writer.uint32(90).fork()).join(); + break; + case "sfixed64": + SFixed64Rules.encode(message.type.sfixed64, writer.uint32(98).fork()).join(); + break; + case "bool": + BoolRules.encode(message.type.bool, writer.uint32(106).fork()).join(); + break; + case "string": + StringRules.encode(message.type.string, writer.uint32(114).fork()).join(); + break; + case "bytes": + BytesRules.encode(message.type.bytes, writer.uint32(122).fork()).join(); + break; + case "enum": + EnumRules.encode(message.type.enum, writer.uint32(130).fork()).join(); + break; + case "repeated": + RepeatedRules.encode(message.type.repeated, writer.uint32(146).fork()).join(); + break; + case "map": + MapRules.encode(message.type.map, writer.uint32(154).fork()).join(); + break; + case "any": + AnyRules.encode(message.type.any, writer.uint32(162).fork()).join(); + break; + case "duration": + DurationRules.encode(message.type.duration, writer.uint32(170).fork()).join(); + break; + case "timestamp": + TimestampRules.encode(message.type.timestamp, writer.uint32(178).fork()).join(); + break; + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FieldRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 17: { + if (tag !== 138) { + break; + } + + message.message = MessageRules.decode(reader, reader.uint32()); + continue; + } + case 1: { + if (tag !== 10) { + break; + } + + message.type = { $case: "float", float: FloatRules.decode(reader, reader.uint32()) }; + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.type = { $case: "double", double: DoubleRules.decode(reader, reader.uint32()) }; + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.type = { $case: "int32", int32: Int32Rules.decode(reader, reader.uint32()) }; + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.type = { $case: "int64", int64: Int64Rules.decode(reader, reader.uint32()) }; + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.type = { $case: "uint32", uint32: UInt32Rules.decode(reader, reader.uint32()) }; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.type = { $case: "uint64", uint64: UInt64Rules.decode(reader, reader.uint32()) }; + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.type = { $case: "sint32", sint32: SInt32Rules.decode(reader, reader.uint32()) }; + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.type = { $case: "sint64", sint64: SInt64Rules.decode(reader, reader.uint32()) }; + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.type = { $case: "fixed32", fixed32: Fixed32Rules.decode(reader, reader.uint32()) }; + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.type = { $case: "fixed64", fixed64: Fixed64Rules.decode(reader, reader.uint32()) }; + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.type = { $case: "sfixed32", sfixed32: SFixed32Rules.decode(reader, reader.uint32()) }; + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.type = { $case: "sfixed64", sfixed64: SFixed64Rules.decode(reader, reader.uint32()) }; + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.type = { $case: "bool", bool: BoolRules.decode(reader, reader.uint32()) }; + continue; + } + case 14: { + if (tag !== 114) { + break; + } + + message.type = { $case: "string", string: StringRules.decode(reader, reader.uint32()) }; + continue; + } + case 15: { + if (tag !== 122) { + break; + } + + message.type = { $case: "bytes", bytes: BytesRules.decode(reader, reader.uint32()) }; + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.type = { $case: "enum", enum: EnumRules.decode(reader, reader.uint32()) }; + continue; + } + case 18: { + if (tag !== 146) { + break; + } + + message.type = { $case: "repeated", repeated: RepeatedRules.decode(reader, reader.uint32()) }; + continue; + } + case 19: { + if (tag !== 154) { + break; + } + + message.type = { $case: "map", map: MapRules.decode(reader, reader.uint32()) }; + continue; + } + case 20: { + if (tag !== 162) { + break; + } + + message.type = { $case: "any", any: AnyRules.decode(reader, reader.uint32()) }; + continue; + } + case 21: { + if (tag !== 170) { + break; + } + + message.type = { $case: "duration", duration: DurationRules.decode(reader, reader.uint32()) }; + continue; + } + case 22: { + if (tag !== 178) { + break; + } + + message.type = { $case: "timestamp", timestamp: TimestampRules.decode(reader, reader.uint32()) }; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FieldRules { + return { + message: isSet(object.message) ? MessageRules.fromJSON(object.message) : undefined, + type: isSet(object.float) + ? { $case: "float", float: FloatRules.fromJSON(object.float) } + : isSet(object.double) + ? { $case: "double", double: DoubleRules.fromJSON(object.double) } + : isSet(object.int32) + ? { $case: "int32", int32: Int32Rules.fromJSON(object.int32) } + : isSet(object.int64) + ? { $case: "int64", int64: Int64Rules.fromJSON(object.int64) } + : isSet(object.uint32) + ? { $case: "uint32", uint32: UInt32Rules.fromJSON(object.uint32) } + : isSet(object.uint64) + ? { $case: "uint64", uint64: UInt64Rules.fromJSON(object.uint64) } + : isSet(object.sint32) + ? { $case: "sint32", sint32: SInt32Rules.fromJSON(object.sint32) } + : isSet(object.sint64) + ? { $case: "sint64", sint64: SInt64Rules.fromJSON(object.sint64) } + : isSet(object.fixed32) + ? { $case: "fixed32", fixed32: Fixed32Rules.fromJSON(object.fixed32) } + : isSet(object.fixed64) + ? { $case: "fixed64", fixed64: Fixed64Rules.fromJSON(object.fixed64) } + : isSet(object.sfixed32) + ? { $case: "sfixed32", sfixed32: SFixed32Rules.fromJSON(object.sfixed32) } + : isSet(object.sfixed64) + ? { $case: "sfixed64", sfixed64: SFixed64Rules.fromJSON(object.sfixed64) } + : isSet(object.bool) + ? { $case: "bool", bool: BoolRules.fromJSON(object.bool) } + : isSet(object.string) + ? { $case: "string", string: StringRules.fromJSON(object.string) } + : isSet(object.bytes) + ? { $case: "bytes", bytes: BytesRules.fromJSON(object.bytes) } + : isSet(object.enum) + ? { $case: "enum", enum: EnumRules.fromJSON(object.enum) } + : isSet(object.repeated) + ? { $case: "repeated", repeated: RepeatedRules.fromJSON(object.repeated) } + : isSet(object.map) + ? { $case: "map", map: MapRules.fromJSON(object.map) } + : isSet(object.any) + ? { $case: "any", any: AnyRules.fromJSON(object.any) } + : isSet(object.duration) + ? { $case: "duration", duration: DurationRules.fromJSON(object.duration) } + : isSet(object.timestamp) + ? { $case: "timestamp", timestamp: TimestampRules.fromJSON(object.timestamp) } + : undefined, + }; + }, + + toJSON(message: FieldRules): unknown { + const obj: any = {}; + if (message.message !== undefined) { + obj.message = MessageRules.toJSON(message.message); + } + if (message.type?.$case === "float") { + obj.float = FloatRules.toJSON(message.type.float); + } else if (message.type?.$case === "double") { + obj.double = DoubleRules.toJSON(message.type.double); + } else if (message.type?.$case === "int32") { + obj.int32 = Int32Rules.toJSON(message.type.int32); + } else if (message.type?.$case === "int64") { + obj.int64 = Int64Rules.toJSON(message.type.int64); + } else if (message.type?.$case === "uint32") { + obj.uint32 = UInt32Rules.toJSON(message.type.uint32); + } else if (message.type?.$case === "uint64") { + obj.uint64 = UInt64Rules.toJSON(message.type.uint64); + } else if (message.type?.$case === "sint32") { + obj.sint32 = SInt32Rules.toJSON(message.type.sint32); + } else if (message.type?.$case === "sint64") { + obj.sint64 = SInt64Rules.toJSON(message.type.sint64); + } else if (message.type?.$case === "fixed32") { + obj.fixed32 = Fixed32Rules.toJSON(message.type.fixed32); + } else if (message.type?.$case === "fixed64") { + obj.fixed64 = Fixed64Rules.toJSON(message.type.fixed64); + } else if (message.type?.$case === "sfixed32") { + obj.sfixed32 = SFixed32Rules.toJSON(message.type.sfixed32); + } else if (message.type?.$case === "sfixed64") { + obj.sfixed64 = SFixed64Rules.toJSON(message.type.sfixed64); + } else if (message.type?.$case === "bool") { + obj.bool = BoolRules.toJSON(message.type.bool); + } else if (message.type?.$case === "string") { + obj.string = StringRules.toJSON(message.type.string); + } else if (message.type?.$case === "bytes") { + obj.bytes = BytesRules.toJSON(message.type.bytes); + } else if (message.type?.$case === "enum") { + obj.enum = EnumRules.toJSON(message.type.enum); + } else if (message.type?.$case === "repeated") { + obj.repeated = RepeatedRules.toJSON(message.type.repeated); + } else if (message.type?.$case === "map") { + obj.map = MapRules.toJSON(message.type.map); + } else if (message.type?.$case === "any") { + obj.any = AnyRules.toJSON(message.type.any); + } else if (message.type?.$case === "duration") { + obj.duration = DurationRules.toJSON(message.type.duration); + } else if (message.type?.$case === "timestamp") { + obj.timestamp = TimestampRules.toJSON(message.type.timestamp); + } + return obj; + }, + + create(base?: DeepPartial): FieldRules { + return FieldRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FieldRules { + const message = createBaseFieldRules(); + message.message = (object.message !== undefined && object.message !== null) + ? MessageRules.fromPartial(object.message) + : undefined; + switch (object.type?.$case) { + case "float": { + if (object.type?.float !== undefined && object.type?.float !== null) { + message.type = { $case: "float", float: FloatRules.fromPartial(object.type.float) }; + } + break; + } + case "double": { + if (object.type?.double !== undefined && object.type?.double !== null) { + message.type = { $case: "double", double: DoubleRules.fromPartial(object.type.double) }; + } + break; + } + case "int32": { + if (object.type?.int32 !== undefined && object.type?.int32 !== null) { + message.type = { $case: "int32", int32: Int32Rules.fromPartial(object.type.int32) }; + } + break; + } + case "int64": { + if (object.type?.int64 !== undefined && object.type?.int64 !== null) { + message.type = { $case: "int64", int64: Int64Rules.fromPartial(object.type.int64) }; + } + break; + } + case "uint32": { + if (object.type?.uint32 !== undefined && object.type?.uint32 !== null) { + message.type = { $case: "uint32", uint32: UInt32Rules.fromPartial(object.type.uint32) }; + } + break; + } + case "uint64": { + if (object.type?.uint64 !== undefined && object.type?.uint64 !== null) { + message.type = { $case: "uint64", uint64: UInt64Rules.fromPartial(object.type.uint64) }; + } + break; + } + case "sint32": { + if (object.type?.sint32 !== undefined && object.type?.sint32 !== null) { + message.type = { $case: "sint32", sint32: SInt32Rules.fromPartial(object.type.sint32) }; + } + break; + } + case "sint64": { + if (object.type?.sint64 !== undefined && object.type?.sint64 !== null) { + message.type = { $case: "sint64", sint64: SInt64Rules.fromPartial(object.type.sint64) }; + } + break; + } + case "fixed32": { + if (object.type?.fixed32 !== undefined && object.type?.fixed32 !== null) { + message.type = { $case: "fixed32", fixed32: Fixed32Rules.fromPartial(object.type.fixed32) }; + } + break; + } + case "fixed64": { + if (object.type?.fixed64 !== undefined && object.type?.fixed64 !== null) { + message.type = { $case: "fixed64", fixed64: Fixed64Rules.fromPartial(object.type.fixed64) }; + } + break; + } + case "sfixed32": { + if (object.type?.sfixed32 !== undefined && object.type?.sfixed32 !== null) { + message.type = { $case: "sfixed32", sfixed32: SFixed32Rules.fromPartial(object.type.sfixed32) }; + } + break; + } + case "sfixed64": { + if (object.type?.sfixed64 !== undefined && object.type?.sfixed64 !== null) { + message.type = { $case: "sfixed64", sfixed64: SFixed64Rules.fromPartial(object.type.sfixed64) }; + } + break; + } + case "bool": { + if (object.type?.bool !== undefined && object.type?.bool !== null) { + message.type = { $case: "bool", bool: BoolRules.fromPartial(object.type.bool) }; + } + break; + } + case "string": { + if (object.type?.string !== undefined && object.type?.string !== null) { + message.type = { $case: "string", string: StringRules.fromPartial(object.type.string) }; + } + break; + } + case "bytes": { + if (object.type?.bytes !== undefined && object.type?.bytes !== null) { + message.type = { $case: "bytes", bytes: BytesRules.fromPartial(object.type.bytes) }; + } + break; + } + case "enum": { + if (object.type?.enum !== undefined && object.type?.enum !== null) { + message.type = { $case: "enum", enum: EnumRules.fromPartial(object.type.enum) }; + } + break; + } + case "repeated": { + if (object.type?.repeated !== undefined && object.type?.repeated !== null) { + message.type = { $case: "repeated", repeated: RepeatedRules.fromPartial(object.type.repeated) }; + } + break; + } + case "map": { + if (object.type?.map !== undefined && object.type?.map !== null) { + message.type = { $case: "map", map: MapRules.fromPartial(object.type.map) }; + } + break; + } + case "any": { + if (object.type?.any !== undefined && object.type?.any !== null) { + message.type = { $case: "any", any: AnyRules.fromPartial(object.type.any) }; + } + break; + } + case "duration": { + if (object.type?.duration !== undefined && object.type?.duration !== null) { + message.type = { $case: "duration", duration: DurationRules.fromPartial(object.type.duration) }; + } + break; + } + case "timestamp": { + if (object.type?.timestamp !== undefined && object.type?.timestamp !== null) { + message.type = { $case: "timestamp", timestamp: TimestampRules.fromPartial(object.type.timestamp) }; + } + break; + } + } + return message; + }, +}; + +function createBaseFloatRules(): FloatRules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const FloatRules: MessageFns = { + encode(message: FloatRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(13).float(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(21).float(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(29).float(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(37).float(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(45).float(message.gte); + } + for (const v of message.in) { + writer.uint32(53).float(v!); + } + for (const v of message.notIn) { + writer.uint32(61).float(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): FloatRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFloatRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 13) { + break; + } + + message.const = reader.float(); + continue; + } + case 2: { + if (tag !== 21) { + break; + } + + message.lt = reader.float(); + continue; + } + case 3: { + if (tag !== 29) { + break; + } + + message.lte = reader.float(); + continue; + } + case 4: { + if (tag !== 37) { + break; + } + + message.gt = reader.float(); + continue; + } + case 5: { + if (tag !== 45) { + break; + } + + message.gte = reader.float(); + continue; + } + case 6: { + if (tag === 53) { + message.in.push(reader.float()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.float()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 61) { + message.notIn.push(reader.float()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.float()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): FloatRules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: FloatRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): FloatRules { + return FloatRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): FloatRules { + const message = createBaseFloatRules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseDoubleRules(): DoubleRules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const DoubleRules: MessageFns = { + encode(message: DoubleRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(9).double(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(17).double(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(25).double(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(33).double(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(41).double(message.gte); + } + for (const v of message.in) { + writer.uint32(49).double(v!); + } + for (const v of message.notIn) { + writer.uint32(57).double(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DoubleRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDoubleRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.const = reader.double(); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.lt = reader.double(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.lte = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.gt = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.gte = reader.double(); + continue; + } + case 6: { + if (tag === 49) { + message.in.push(reader.double()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.double()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 57) { + message.notIn.push(reader.double()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.double()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DoubleRules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: DoubleRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = message.const; + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = message.lt; + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = message.lte; + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = message.gt; + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = message.gte; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): DoubleRules { + return DoubleRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DoubleRules { + const message = createBaseDoubleRules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseInt32Rules(): Int32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const Int32Rules: MessageFns = { + encode(message: Int32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).int32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(16).int32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(24).int32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(32).int32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(40).int32(message.gte); + } + for (const v of message.in) { + writer.uint32(48).int32(v!); + } + for (const v of message.notIn) { + writer.uint32(56).int32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Int32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.int32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.int32(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.int32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.int32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.int32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.int32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Int32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Int32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): Int32Rules { + return Int32Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Int32Rules { + const message = createBaseInt32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseInt64Rules(): Int64Rules { + return { + const: Long.ZERO, + lt: Long.ZERO, + lte: Long.ZERO, + gt: Long.ZERO, + gte: Long.ZERO, + in: [], + notIn: [], + ignoreEmpty: false, + }; +} + +export const Int64Rules: MessageFns = { + encode(message: Int64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && !message.const.equals(Long.ZERO)) { + writer.uint32(8).int64(message.const.toString()); + } + if (message.lt !== undefined && !message.lt.equals(Long.ZERO)) { + writer.uint32(16).int64(message.lt.toString()); + } + if (message.lte !== undefined && !message.lte.equals(Long.ZERO)) { + writer.uint32(24).int64(message.lte.toString()); + } + if (message.gt !== undefined && !message.gt.equals(Long.ZERO)) { + writer.uint32(32).int64(message.gt.toString()); + } + if (message.gte !== undefined && !message.gte.equals(Long.ZERO)) { + writer.uint32(40).int64(message.gte.toString()); + } + for (const v of message.in) { + writer.uint32(48).int64(v!.toString()); + } + for (const v of message.notIn) { + writer.uint32(56).int64(v!.toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Int64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInt64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = Long.fromString(reader.int64().toString()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = Long.fromString(reader.int64().toString()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = Long.fromString(reader.int64().toString()); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = Long.fromString(reader.int64().toString()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = Long.fromString(reader.int64().toString()); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(Long.fromString(reader.int64().toString())); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(Long.fromString(reader.int64().toString())); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(Long.fromString(reader.int64().toString())); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(Long.fromString(reader.int64().toString())); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Int64Rules { + return { + const: isSet(object.const) ? Long.fromValue(object.const) : Long.ZERO, + lt: isSet(object.lt) ? Long.fromValue(object.lt) : Long.ZERO, + lte: isSet(object.lte) ? Long.fromValue(object.lte) : Long.ZERO, + gt: isSet(object.gt) ? Long.fromValue(object.gt) : Long.ZERO, + gte: isSet(object.gte) ? Long.fromValue(object.gte) : Long.ZERO, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Long.fromValue(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Long.fromValue(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Int64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && !message.const.equals(Long.ZERO)) { + obj.const = (message.const || Long.ZERO).toString(); + } + if (message.lt !== undefined && !message.lt.equals(Long.ZERO)) { + obj.lt = (message.lt || Long.ZERO).toString(); + } + if (message.lte !== undefined && !message.lte.equals(Long.ZERO)) { + obj.lte = (message.lte || Long.ZERO).toString(); + } + if (message.gt !== undefined && !message.gt.equals(Long.ZERO)) { + obj.gt = (message.gt || Long.ZERO).toString(); + } + if (message.gte !== undefined && !message.gte.equals(Long.ZERO)) { + obj.gte = (message.gte || Long.ZERO).toString(); + } + if (message.in?.length) { + obj.in = message.in.map((e) => (e || Long.ZERO).toString()); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => (e || Long.ZERO).toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): Int64Rules { + return Int64Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Int64Rules { + const message = createBaseInt64Rules(); + message.const = (object.const !== undefined && object.const !== null) ? Long.fromValue(object.const) : Long.ZERO; + message.lt = (object.lt !== undefined && object.lt !== null) ? Long.fromValue(object.lt) : Long.ZERO; + message.lte = (object.lte !== undefined && object.lte !== null) ? Long.fromValue(object.lte) : Long.ZERO; + message.gt = (object.gt !== undefined && object.gt !== null) ? Long.fromValue(object.gt) : Long.ZERO; + message.gte = (object.gte !== undefined && object.gte !== null) ? Long.fromValue(object.gte) : Long.ZERO; + message.in = object.in?.map((e) => Long.fromValue(e)) || []; + message.notIn = object.notIn?.map((e) => Long.fromValue(e)) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseUInt32Rules(): UInt32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const UInt32Rules: MessageFns = { + encode(message: UInt32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).uint32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(16).uint32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(24).uint32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(32).uint32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(40).uint32(message.gte); + } + for (const v of message.in) { + writer.uint32(48).uint32(v!); + } + for (const v of message.notIn) { + writer.uint32(56).uint32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UInt32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.uint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.uint32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.uint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.uint32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.uint32(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.uint32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.uint32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.uint32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.uint32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UInt32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: UInt32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): UInt32Rules { + return UInt32Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UInt32Rules { + const message = createBaseUInt32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseUInt64Rules(): UInt64Rules { + return { + const: Long.UZERO, + lt: Long.UZERO, + lte: Long.UZERO, + gt: Long.UZERO, + gte: Long.UZERO, + in: [], + notIn: [], + ignoreEmpty: false, + }; +} + +export const UInt64Rules: MessageFns = { + encode(message: UInt64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && !message.const.equals(Long.UZERO)) { + writer.uint32(8).uint64(message.const.toString()); + } + if (message.lt !== undefined && !message.lt.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.lt.toString()); + } + if (message.lte !== undefined && !message.lte.equals(Long.UZERO)) { + writer.uint32(24).uint64(message.lte.toString()); + } + if (message.gt !== undefined && !message.gt.equals(Long.UZERO)) { + writer.uint32(32).uint64(message.gt.toString()); + } + if (message.gte !== undefined && !message.gte.equals(Long.UZERO)) { + writer.uint32(40).uint64(message.gte.toString()); + } + for (const v of message.in) { + writer.uint32(48).uint64(v!.toString()); + } + for (const v of message.notIn) { + writer.uint32(56).uint64(v!.toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UInt64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUInt64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(Long.fromString(reader.uint64().toString(), true)); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(Long.fromString(reader.uint64().toString(), true)); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(Long.fromString(reader.uint64().toString(), true)); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(Long.fromString(reader.uint64().toString(), true)); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UInt64Rules { + return { + const: isSet(object.const) ? Long.fromValue(object.const) : Long.UZERO, + lt: isSet(object.lt) ? Long.fromValue(object.lt) : Long.UZERO, + lte: isSet(object.lte) ? Long.fromValue(object.lte) : Long.UZERO, + gt: isSet(object.gt) ? Long.fromValue(object.gt) : Long.UZERO, + gte: isSet(object.gte) ? Long.fromValue(object.gte) : Long.UZERO, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Long.fromValue(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Long.fromValue(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: UInt64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && !message.const.equals(Long.UZERO)) { + obj.const = (message.const || Long.UZERO).toString(); + } + if (message.lt !== undefined && !message.lt.equals(Long.UZERO)) { + obj.lt = (message.lt || Long.UZERO).toString(); + } + if (message.lte !== undefined && !message.lte.equals(Long.UZERO)) { + obj.lte = (message.lte || Long.UZERO).toString(); + } + if (message.gt !== undefined && !message.gt.equals(Long.UZERO)) { + obj.gt = (message.gt || Long.UZERO).toString(); + } + if (message.gte !== undefined && !message.gte.equals(Long.UZERO)) { + obj.gte = (message.gte || Long.UZERO).toString(); + } + if (message.in?.length) { + obj.in = message.in.map((e) => (e || Long.UZERO).toString()); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => (e || Long.UZERO).toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): UInt64Rules { + return UInt64Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UInt64Rules { + const message = createBaseUInt64Rules(); + message.const = (object.const !== undefined && object.const !== null) ? Long.fromValue(object.const) : Long.UZERO; + message.lt = (object.lt !== undefined && object.lt !== null) ? Long.fromValue(object.lt) : Long.UZERO; + message.lte = (object.lte !== undefined && object.lte !== null) ? Long.fromValue(object.lte) : Long.UZERO; + message.gt = (object.gt !== undefined && object.gt !== null) ? Long.fromValue(object.gt) : Long.UZERO; + message.gte = (object.gte !== undefined && object.gte !== null) ? Long.fromValue(object.gte) : Long.UZERO; + message.in = object.in?.map((e) => Long.fromValue(e)) || []; + message.notIn = object.notIn?.map((e) => Long.fromValue(e)) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSInt32Rules(): SInt32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const SInt32Rules: MessageFns = { + encode(message: SInt32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).sint32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(16).sint32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(24).sint32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(32).sint32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(40).sint32(message.gte); + } + for (const v of message.in) { + writer.uint32(48).sint32(v!); + } + for (const v of message.notIn) { + writer.uint32(56).sint32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SInt32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSInt32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.sint32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = reader.sint32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = reader.sint32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = reader.sint32(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = reader.sint32(); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(reader.sint32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.sint32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(reader.sint32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.sint32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SInt32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SInt32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): SInt32Rules { + return SInt32Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SInt32Rules { + const message = createBaseSInt32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSInt64Rules(): SInt64Rules { + return { + const: Long.ZERO, + lt: Long.ZERO, + lte: Long.ZERO, + gt: Long.ZERO, + gte: Long.ZERO, + in: [], + notIn: [], + ignoreEmpty: false, + }; +} + +export const SInt64Rules: MessageFns = { + encode(message: SInt64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && !message.const.equals(Long.ZERO)) { + writer.uint32(8).sint64(message.const.toString()); + } + if (message.lt !== undefined && !message.lt.equals(Long.ZERO)) { + writer.uint32(16).sint64(message.lt.toString()); + } + if (message.lte !== undefined && !message.lte.equals(Long.ZERO)) { + writer.uint32(24).sint64(message.lte.toString()); + } + if (message.gt !== undefined && !message.gt.equals(Long.ZERO)) { + writer.uint32(32).sint64(message.gt.toString()); + } + if (message.gte !== undefined && !message.gte.equals(Long.ZERO)) { + writer.uint32(40).sint64(message.gte.toString()); + } + for (const v of message.in) { + writer.uint32(48).sint64(v!.toString()); + } + for (const v of message.notIn) { + writer.uint32(56).sint64(v!.toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SInt64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSInt64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = Long.fromString(reader.sint64().toString()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.lt = Long.fromString(reader.sint64().toString()); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.lte = Long.fromString(reader.sint64().toString()); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.gt = Long.fromString(reader.sint64().toString()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.gte = Long.fromString(reader.sint64().toString()); + continue; + } + case 6: { + if (tag === 48) { + message.in.push(Long.fromString(reader.sint64().toString())); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(Long.fromString(reader.sint64().toString())); + } + + continue; + } + + break; + } + case 7: { + if (tag === 56) { + message.notIn.push(Long.fromString(reader.sint64().toString())); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(Long.fromString(reader.sint64().toString())); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SInt64Rules { + return { + const: isSet(object.const) ? Long.fromValue(object.const) : Long.ZERO, + lt: isSet(object.lt) ? Long.fromValue(object.lt) : Long.ZERO, + lte: isSet(object.lte) ? Long.fromValue(object.lte) : Long.ZERO, + gt: isSet(object.gt) ? Long.fromValue(object.gt) : Long.ZERO, + gte: isSet(object.gte) ? Long.fromValue(object.gte) : Long.ZERO, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Long.fromValue(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Long.fromValue(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SInt64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && !message.const.equals(Long.ZERO)) { + obj.const = (message.const || Long.ZERO).toString(); + } + if (message.lt !== undefined && !message.lt.equals(Long.ZERO)) { + obj.lt = (message.lt || Long.ZERO).toString(); + } + if (message.lte !== undefined && !message.lte.equals(Long.ZERO)) { + obj.lte = (message.lte || Long.ZERO).toString(); + } + if (message.gt !== undefined && !message.gt.equals(Long.ZERO)) { + obj.gt = (message.gt || Long.ZERO).toString(); + } + if (message.gte !== undefined && !message.gte.equals(Long.ZERO)) { + obj.gte = (message.gte || Long.ZERO).toString(); + } + if (message.in?.length) { + obj.in = message.in.map((e) => (e || Long.ZERO).toString()); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => (e || Long.ZERO).toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): SInt64Rules { + return SInt64Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SInt64Rules { + const message = createBaseSInt64Rules(); + message.const = (object.const !== undefined && object.const !== null) ? Long.fromValue(object.const) : Long.ZERO; + message.lt = (object.lt !== undefined && object.lt !== null) ? Long.fromValue(object.lt) : Long.ZERO; + message.lte = (object.lte !== undefined && object.lte !== null) ? Long.fromValue(object.lte) : Long.ZERO; + message.gt = (object.gt !== undefined && object.gt !== null) ? Long.fromValue(object.gt) : Long.ZERO; + message.gte = (object.gte !== undefined && object.gte !== null) ? Long.fromValue(object.gte) : Long.ZERO; + message.in = object.in?.map((e) => Long.fromValue(e)) || []; + message.notIn = object.notIn?.map((e) => Long.fromValue(e)) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseFixed32Rules(): Fixed32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const Fixed32Rules: MessageFns = { + encode(message: Fixed32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(13).fixed32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(21).fixed32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(29).fixed32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(37).fixed32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(45).fixed32(message.gte); + } + for (const v of message.in) { + writer.uint32(53).fixed32(v!); + } + for (const v of message.notIn) { + writer.uint32(61).fixed32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Fixed32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFixed32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 13) { + break; + } + + message.const = reader.fixed32(); + continue; + } + case 2: { + if (tag !== 21) { + break; + } + + message.lt = reader.fixed32(); + continue; + } + case 3: { + if (tag !== 29) { + break; + } + + message.lte = reader.fixed32(); + continue; + } + case 4: { + if (tag !== 37) { + break; + } + + message.gt = reader.fixed32(); + continue; + } + case 5: { + if (tag !== 45) { + break; + } + + message.gte = reader.fixed32(); + continue; + } + case 6: { + if (tag === 53) { + message.in.push(reader.fixed32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.fixed32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 61) { + message.notIn.push(reader.fixed32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.fixed32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Fixed32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Fixed32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): Fixed32Rules { + return Fixed32Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Fixed32Rules { + const message = createBaseFixed32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseFixed64Rules(): Fixed64Rules { + return { + const: Long.UZERO, + lt: Long.UZERO, + lte: Long.UZERO, + gt: Long.UZERO, + gte: Long.UZERO, + in: [], + notIn: [], + ignoreEmpty: false, + }; +} + +export const Fixed64Rules: MessageFns = { + encode(message: Fixed64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && !message.const.equals(Long.UZERO)) { + writer.uint32(9).fixed64(message.const.toString()); + } + if (message.lt !== undefined && !message.lt.equals(Long.UZERO)) { + writer.uint32(17).fixed64(message.lt.toString()); + } + if (message.lte !== undefined && !message.lte.equals(Long.UZERO)) { + writer.uint32(25).fixed64(message.lte.toString()); + } + if (message.gt !== undefined && !message.gt.equals(Long.UZERO)) { + writer.uint32(33).fixed64(message.gt.toString()); + } + if (message.gte !== undefined && !message.gte.equals(Long.UZERO)) { + writer.uint32(41).fixed64(message.gte.toString()); + } + for (const v of message.in) { + writer.uint32(49).fixed64(v!.toString()); + } + for (const v of message.notIn) { + writer.uint32(57).fixed64(v!.toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Fixed64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFixed64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.const = Long.fromString(reader.fixed64().toString(), true); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.lt = Long.fromString(reader.fixed64().toString(), true); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.lte = Long.fromString(reader.fixed64().toString(), true); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.gt = Long.fromString(reader.fixed64().toString(), true); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.gte = Long.fromString(reader.fixed64().toString(), true); + continue; + } + case 6: { + if (tag === 49) { + message.in.push(Long.fromString(reader.fixed64().toString(), true)); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(Long.fromString(reader.fixed64().toString(), true)); + } + + continue; + } + + break; + } + case 7: { + if (tag === 57) { + message.notIn.push(Long.fromString(reader.fixed64().toString(), true)); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(Long.fromString(reader.fixed64().toString(), true)); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Fixed64Rules { + return { + const: isSet(object.const) ? Long.fromValue(object.const) : Long.UZERO, + lt: isSet(object.lt) ? Long.fromValue(object.lt) : Long.UZERO, + lte: isSet(object.lte) ? Long.fromValue(object.lte) : Long.UZERO, + gt: isSet(object.gt) ? Long.fromValue(object.gt) : Long.UZERO, + gte: isSet(object.gte) ? Long.fromValue(object.gte) : Long.UZERO, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Long.fromValue(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Long.fromValue(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: Fixed64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && !message.const.equals(Long.UZERO)) { + obj.const = (message.const || Long.UZERO).toString(); + } + if (message.lt !== undefined && !message.lt.equals(Long.UZERO)) { + obj.lt = (message.lt || Long.UZERO).toString(); + } + if (message.lte !== undefined && !message.lte.equals(Long.UZERO)) { + obj.lte = (message.lte || Long.UZERO).toString(); + } + if (message.gt !== undefined && !message.gt.equals(Long.UZERO)) { + obj.gt = (message.gt || Long.UZERO).toString(); + } + if (message.gte !== undefined && !message.gte.equals(Long.UZERO)) { + obj.gte = (message.gte || Long.UZERO).toString(); + } + if (message.in?.length) { + obj.in = message.in.map((e) => (e || Long.UZERO).toString()); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => (e || Long.UZERO).toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): Fixed64Rules { + return Fixed64Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Fixed64Rules { + const message = createBaseFixed64Rules(); + message.const = (object.const !== undefined && object.const !== null) ? Long.fromValue(object.const) : Long.UZERO; + message.lt = (object.lt !== undefined && object.lt !== null) ? Long.fromValue(object.lt) : Long.UZERO; + message.lte = (object.lte !== undefined && object.lte !== null) ? Long.fromValue(object.lte) : Long.UZERO; + message.gt = (object.gt !== undefined && object.gt !== null) ? Long.fromValue(object.gt) : Long.UZERO; + message.gte = (object.gte !== undefined && object.gte !== null) ? Long.fromValue(object.gte) : Long.UZERO; + message.in = object.in?.map((e) => Long.fromValue(e)) || []; + message.notIn = object.notIn?.map((e) => Long.fromValue(e)) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSFixed32Rules(): SFixed32Rules { + return { const: 0, lt: 0, lte: 0, gt: 0, gte: 0, in: [], notIn: [], ignoreEmpty: false }; +} + +export const SFixed32Rules: MessageFns = { + encode(message: SFixed32Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(13).sfixed32(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + writer.uint32(21).sfixed32(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + writer.uint32(29).sfixed32(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + writer.uint32(37).sfixed32(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + writer.uint32(45).sfixed32(message.gte); + } + for (const v of message.in) { + writer.uint32(53).sfixed32(v!); + } + for (const v of message.notIn) { + writer.uint32(61).sfixed32(v!); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SFixed32Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSFixed32Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 13) { + break; + } + + message.const = reader.sfixed32(); + continue; + } + case 2: { + if (tag !== 21) { + break; + } + + message.lt = reader.sfixed32(); + continue; + } + case 3: { + if (tag !== 29) { + break; + } + + message.lte = reader.sfixed32(); + continue; + } + case 4: { + if (tag !== 37) { + break; + } + + message.gt = reader.sfixed32(); + continue; + } + case 5: { + if (tag !== 45) { + break; + } + + message.gte = reader.sfixed32(); + continue; + } + case 6: { + if (tag === 53) { + message.in.push(reader.sfixed32()); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.sfixed32()); + } + + continue; + } + + break; + } + case 7: { + if (tag === 61) { + message.notIn.push(reader.sfixed32()); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.sfixed32()); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SFixed32Rules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + lt: isSet(object.lt) ? globalThis.Number(object.lt) : 0, + lte: isSet(object.lte) ? globalThis.Number(object.lte) : 0, + gt: isSet(object.gt) ? globalThis.Number(object.gt) : 0, + gte: isSet(object.gte) ? globalThis.Number(object.gte) : 0, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SFixed32Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.lt !== undefined && message.lt !== 0) { + obj.lt = Math.round(message.lt); + } + if (message.lte !== undefined && message.lte !== 0) { + obj.lte = Math.round(message.lte); + } + if (message.gt !== undefined && message.gt !== 0) { + obj.gt = Math.round(message.gt); + } + if (message.gte !== undefined && message.gte !== 0) { + obj.gte = Math.round(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): SFixed32Rules { + return SFixed32Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SFixed32Rules { + const message = createBaseSFixed32Rules(); + message.const = object.const ?? 0; + message.lt = object.lt ?? 0; + message.lte = object.lte ?? 0; + message.gt = object.gt ?? 0; + message.gte = object.gte ?? 0; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseSFixed64Rules(): SFixed64Rules { + return { + const: Long.ZERO, + lt: Long.ZERO, + lte: Long.ZERO, + gt: Long.ZERO, + gte: Long.ZERO, + in: [], + notIn: [], + ignoreEmpty: false, + }; +} + +export const SFixed64Rules: MessageFns = { + encode(message: SFixed64Rules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && !message.const.equals(Long.ZERO)) { + writer.uint32(9).sfixed64(message.const.toString()); + } + if (message.lt !== undefined && !message.lt.equals(Long.ZERO)) { + writer.uint32(17).sfixed64(message.lt.toString()); + } + if (message.lte !== undefined && !message.lte.equals(Long.ZERO)) { + writer.uint32(25).sfixed64(message.lte.toString()); + } + if (message.gt !== undefined && !message.gt.equals(Long.ZERO)) { + writer.uint32(33).sfixed64(message.gt.toString()); + } + if (message.gte !== undefined && !message.gte.equals(Long.ZERO)) { + writer.uint32(41).sfixed64(message.gte.toString()); + } + for (const v of message.in) { + writer.uint32(49).sfixed64(v!.toString()); + } + for (const v of message.notIn) { + writer.uint32(57).sfixed64(v!.toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(64).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SFixed64Rules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSFixed64Rules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 9) { + break; + } + + message.const = Long.fromString(reader.sfixed64().toString()); + continue; + } + case 2: { + if (tag !== 17) { + break; + } + + message.lt = Long.fromString(reader.sfixed64().toString()); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.lte = Long.fromString(reader.sfixed64().toString()); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.gt = Long.fromString(reader.sfixed64().toString()); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.gte = Long.fromString(reader.sfixed64().toString()); + continue; + } + case 6: { + if (tag === 49) { + message.in.push(Long.fromString(reader.sfixed64().toString())); + + continue; + } + + if (tag === 50) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(Long.fromString(reader.sfixed64().toString())); + } + + continue; + } + + break; + } + case 7: { + if (tag === 57) { + message.notIn.push(Long.fromString(reader.sfixed64().toString())); + + continue; + } + + if (tag === 58) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(Long.fromString(reader.sfixed64().toString())); + } + + continue; + } + + break; + } + case 8: { + if (tag !== 64) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SFixed64Rules { + return { + const: isSet(object.const) ? Long.fromValue(object.const) : Long.ZERO, + lt: isSet(object.lt) ? Long.fromValue(object.lt) : Long.ZERO, + lte: isSet(object.lte) ? Long.fromValue(object.lte) : Long.ZERO, + gt: isSet(object.gt) ? Long.fromValue(object.gt) : Long.ZERO, + gte: isSet(object.gte) ? Long.fromValue(object.gte) : Long.ZERO, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Long.fromValue(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Long.fromValue(e)) : [], + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: SFixed64Rules): unknown { + const obj: any = {}; + if (message.const !== undefined && !message.const.equals(Long.ZERO)) { + obj.const = (message.const || Long.ZERO).toString(); + } + if (message.lt !== undefined && !message.lt.equals(Long.ZERO)) { + obj.lt = (message.lt || Long.ZERO).toString(); + } + if (message.lte !== undefined && !message.lte.equals(Long.ZERO)) { + obj.lte = (message.lte || Long.ZERO).toString(); + } + if (message.gt !== undefined && !message.gt.equals(Long.ZERO)) { + obj.gt = (message.gt || Long.ZERO).toString(); + } + if (message.gte !== undefined && !message.gte.equals(Long.ZERO)) { + obj.gte = (message.gte || Long.ZERO).toString(); + } + if (message.in?.length) { + obj.in = message.in.map((e) => (e || Long.ZERO).toString()); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => (e || Long.ZERO).toString()); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): SFixed64Rules { + return SFixed64Rules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SFixed64Rules { + const message = createBaseSFixed64Rules(); + message.const = (object.const !== undefined && object.const !== null) ? Long.fromValue(object.const) : Long.ZERO; + message.lt = (object.lt !== undefined && object.lt !== null) ? Long.fromValue(object.lt) : Long.ZERO; + message.lte = (object.lte !== undefined && object.lte !== null) ? Long.fromValue(object.lte) : Long.ZERO; + message.gt = (object.gt !== undefined && object.gt !== null) ? Long.fromValue(object.gt) : Long.ZERO; + message.gte = (object.gte !== undefined && object.gte !== null) ? Long.fromValue(object.gte) : Long.ZERO; + message.in = object.in?.map((e) => Long.fromValue(e)) || []; + message.notIn = object.notIn?.map((e) => Long.fromValue(e)) || []; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseBoolRules(): BoolRules { + return { const: false }; +} + +export const BoolRules: MessageFns = { + encode(message: BoolRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== false) { + writer.uint32(8).bool(message.const); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BoolRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBoolRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BoolRules { + return { const: isSet(object.const) ? globalThis.Boolean(object.const) : false }; + }, + + toJSON(message: BoolRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== false) { + obj.const = message.const; + } + return obj; + }, + + create(base?: DeepPartial): BoolRules { + return BoolRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BoolRules { + const message = createBaseBoolRules(); + message.const = object.const ?? false; + return message; + }, +}; + +function createBaseStringRules(): StringRules { + return { + const: "", + len: Long.UZERO, + minLen: Long.UZERO, + maxLen: Long.UZERO, + lenBytes: Long.UZERO, + minBytes: Long.UZERO, + maxBytes: Long.UZERO, + pattern: "", + prefix: "", + suffix: "", + contains: "", + notContains: "", + in: [], + notIn: [], + wellKnown: undefined, + strict: true, + ignoreEmpty: false, + }; +} + +export const StringRules: MessageFns = { + encode(message: StringRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== "") { + writer.uint32(10).string(message.const); + } + if (message.len !== undefined && !message.len.equals(Long.UZERO)) { + writer.uint32(152).uint64(message.len.toString()); + } + if (message.minLen !== undefined && !message.minLen.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.minLen.toString()); + } + if (message.maxLen !== undefined && !message.maxLen.equals(Long.UZERO)) { + writer.uint32(24).uint64(message.maxLen.toString()); + } + if (message.lenBytes !== undefined && !message.lenBytes.equals(Long.UZERO)) { + writer.uint32(160).uint64(message.lenBytes.toString()); + } + if (message.minBytes !== undefined && !message.minBytes.equals(Long.UZERO)) { + writer.uint32(32).uint64(message.minBytes.toString()); + } + if (message.maxBytes !== undefined && !message.maxBytes.equals(Long.UZERO)) { + writer.uint32(40).uint64(message.maxBytes.toString()); + } + if (message.pattern !== undefined && message.pattern !== "") { + writer.uint32(50).string(message.pattern); + } + if (message.prefix !== undefined && message.prefix !== "") { + writer.uint32(58).string(message.prefix); + } + if (message.suffix !== undefined && message.suffix !== "") { + writer.uint32(66).string(message.suffix); + } + if (message.contains !== undefined && message.contains !== "") { + writer.uint32(74).string(message.contains); + } + if (message.notContains !== undefined && message.notContains !== "") { + writer.uint32(186).string(message.notContains); + } + for (const v of message.in) { + writer.uint32(82).string(v!); + } + for (const v of message.notIn) { + writer.uint32(90).string(v!); + } + switch (message.wellKnown?.$case) { + case "email": + writer.uint32(96).bool(message.wellKnown.email); + break; + case "hostname": + writer.uint32(104).bool(message.wellKnown.hostname); + break; + case "ip": + writer.uint32(112).bool(message.wellKnown.ip); + break; + case "ipv4": + writer.uint32(120).bool(message.wellKnown.ipv4); + break; + case "ipv6": + writer.uint32(128).bool(message.wellKnown.ipv6); + break; + case "uri": + writer.uint32(136).bool(message.wellKnown.uri); + break; + case "uriRef": + writer.uint32(144).bool(message.wellKnown.uriRef); + break; + case "address": + writer.uint32(168).bool(message.wellKnown.address); + break; + case "uuid": + writer.uint32(176).bool(message.wellKnown.uuid); + break; + case "wellKnownRegex": + writer.uint32(192).int32(message.wellKnown.wellKnownRegex); + break; + } + if (message.strict !== undefined && message.strict !== true) { + writer.uint32(200).bool(message.strict); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(208).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): StringRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStringRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.const = reader.string(); + continue; + } + case 19: { + if (tag !== 152) { + break; + } + + message.len = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.minLen = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.maxLen = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 20: { + if (tag !== 160) { + break; + } + + message.lenBytes = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.minBytes = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.maxBytes = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.pattern = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.prefix = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.suffix = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.contains = reader.string(); + continue; + } + case 23: { + if (tag !== 186) { + break; + } + + message.notContains = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.in.push(reader.string()); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notIn.push(reader.string()); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.wellKnown = { $case: "email", email: reader.bool() }; + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.wellKnown = { $case: "hostname", hostname: reader.bool() }; + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.wellKnown = { $case: "ip", ip: reader.bool() }; + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.wellKnown = { $case: "ipv4", ipv4: reader.bool() }; + continue; + } + case 16: { + if (tag !== 128) { + break; + } + + message.wellKnown = { $case: "ipv6", ipv6: reader.bool() }; + continue; + } + case 17: { + if (tag !== 136) { + break; + } + + message.wellKnown = { $case: "uri", uri: reader.bool() }; + continue; + } + case 18: { + if (tag !== 144) { + break; + } + + message.wellKnown = { $case: "uriRef", uriRef: reader.bool() }; + continue; + } + case 21: { + if (tag !== 168) { + break; + } + + message.wellKnown = { $case: "address", address: reader.bool() }; + continue; + } + case 22: { + if (tag !== 176) { + break; + } + + message.wellKnown = { $case: "uuid", uuid: reader.bool() }; + continue; + } + case 24: { + if (tag !== 192) { + break; + } + + message.wellKnown = { $case: "wellKnownRegex", wellKnownRegex: reader.int32() as any }; + continue; + } + case 25: { + if (tag !== 200) { + break; + } + + message.strict = reader.bool(); + continue; + } + case 26: { + if (tag !== 208) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): StringRules { + return { + const: isSet(object.const) ? globalThis.String(object.const) : "", + len: isSet(object.len) ? Long.fromValue(object.len) : Long.UZERO, + minLen: isSet(object.minLen) ? Long.fromValue(object.minLen) : Long.UZERO, + maxLen: isSet(object.maxLen) ? Long.fromValue(object.maxLen) : Long.UZERO, + lenBytes: isSet(object.lenBytes) ? Long.fromValue(object.lenBytes) : Long.UZERO, + minBytes: isSet(object.minBytes) ? Long.fromValue(object.minBytes) : Long.UZERO, + maxBytes: isSet(object.maxBytes) ? Long.fromValue(object.maxBytes) : Long.UZERO, + pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", + prefix: isSet(object.prefix) ? globalThis.String(object.prefix) : "", + suffix: isSet(object.suffix) ? globalThis.String(object.suffix) : "", + contains: isSet(object.contains) ? globalThis.String(object.contains) : "", + notContains: isSet(object.notContains) ? globalThis.String(object.notContains) : "", + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + wellKnown: isSet(object.email) + ? { $case: "email", email: globalThis.Boolean(object.email) } + : isSet(object.hostname) + ? { $case: "hostname", hostname: globalThis.Boolean(object.hostname) } + : isSet(object.ip) + ? { $case: "ip", ip: globalThis.Boolean(object.ip) } + : isSet(object.ipv4) + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : isSet(object.uri) + ? { $case: "uri", uri: globalThis.Boolean(object.uri) } + : isSet(object.uriRef) + ? { $case: "uriRef", uriRef: globalThis.Boolean(object.uriRef) } + : isSet(object.address) + ? { $case: "address", address: globalThis.Boolean(object.address) } + : isSet(object.uuid) + ? { $case: "uuid", uuid: globalThis.Boolean(object.uuid) } + : isSet(object.wellKnownRegex) + ? { $case: "wellKnownRegex", wellKnownRegex: knownRegexFromJSON(object.wellKnownRegex) } + : undefined, + strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : true, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: StringRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== "") { + obj.const = message.const; + } + if (message.len !== undefined && !message.len.equals(Long.UZERO)) { + obj.len = (message.len || Long.UZERO).toString(); + } + if (message.minLen !== undefined && !message.minLen.equals(Long.UZERO)) { + obj.minLen = (message.minLen || Long.UZERO).toString(); + } + if (message.maxLen !== undefined && !message.maxLen.equals(Long.UZERO)) { + obj.maxLen = (message.maxLen || Long.UZERO).toString(); + } + if (message.lenBytes !== undefined && !message.lenBytes.equals(Long.UZERO)) { + obj.lenBytes = (message.lenBytes || Long.UZERO).toString(); + } + if (message.minBytes !== undefined && !message.minBytes.equals(Long.UZERO)) { + obj.minBytes = (message.minBytes || Long.UZERO).toString(); + } + if (message.maxBytes !== undefined && !message.maxBytes.equals(Long.UZERO)) { + obj.maxBytes = (message.maxBytes || Long.UZERO).toString(); + } + if (message.pattern !== undefined && message.pattern !== "") { + obj.pattern = message.pattern; + } + if (message.prefix !== undefined && message.prefix !== "") { + obj.prefix = message.prefix; + } + if (message.suffix !== undefined && message.suffix !== "") { + obj.suffix = message.suffix; + } + if (message.contains !== undefined && message.contains !== "") { + obj.contains = message.contains; + } + if (message.notContains !== undefined && message.notContains !== "") { + obj.notContains = message.notContains; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + if (message.wellKnown?.$case === "email") { + obj.email = message.wellKnown.email; + } else if (message.wellKnown?.$case === "hostname") { + obj.hostname = message.wellKnown.hostname; + } else if (message.wellKnown?.$case === "ip") { + obj.ip = message.wellKnown.ip; + } else if (message.wellKnown?.$case === "ipv4") { + obj.ipv4 = message.wellKnown.ipv4; + } else if (message.wellKnown?.$case === "ipv6") { + obj.ipv6 = message.wellKnown.ipv6; + } else if (message.wellKnown?.$case === "uri") { + obj.uri = message.wellKnown.uri; + } else if (message.wellKnown?.$case === "uriRef") { + obj.uriRef = message.wellKnown.uriRef; + } else if (message.wellKnown?.$case === "address") { + obj.address = message.wellKnown.address; + } else if (message.wellKnown?.$case === "uuid") { + obj.uuid = message.wellKnown.uuid; + } else if (message.wellKnown?.$case === "wellKnownRegex") { + obj.wellKnownRegex = knownRegexToJSON(message.wellKnown.wellKnownRegex); + } + if (message.strict !== undefined && message.strict !== true) { + obj.strict = message.strict; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): StringRules { + return StringRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): StringRules { + const message = createBaseStringRules(); + message.const = object.const ?? ""; + message.len = (object.len !== undefined && object.len !== null) ? Long.fromValue(object.len) : Long.UZERO; + message.minLen = (object.minLen !== undefined && object.minLen !== null) + ? Long.fromValue(object.minLen) + : Long.UZERO; + message.maxLen = (object.maxLen !== undefined && object.maxLen !== null) + ? Long.fromValue(object.maxLen) + : Long.UZERO; + message.lenBytes = (object.lenBytes !== undefined && object.lenBytes !== null) + ? Long.fromValue(object.lenBytes) + : Long.UZERO; + message.minBytes = (object.minBytes !== undefined && object.minBytes !== null) + ? Long.fromValue(object.minBytes) + : Long.UZERO; + message.maxBytes = (object.maxBytes !== undefined && object.maxBytes !== null) + ? Long.fromValue(object.maxBytes) + : Long.UZERO; + message.pattern = object.pattern ?? ""; + message.prefix = object.prefix ?? ""; + message.suffix = object.suffix ?? ""; + message.contains = object.contains ?? ""; + message.notContains = object.notContains ?? ""; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + switch (object.wellKnown?.$case) { + case "email": { + if (object.wellKnown?.email !== undefined && object.wellKnown?.email !== null) { + message.wellKnown = { $case: "email", email: object.wellKnown.email }; + } + break; + } + case "hostname": { + if (object.wellKnown?.hostname !== undefined && object.wellKnown?.hostname !== null) { + message.wellKnown = { $case: "hostname", hostname: object.wellKnown.hostname }; + } + break; + } + case "ip": { + if (object.wellKnown?.ip !== undefined && object.wellKnown?.ip !== null) { + message.wellKnown = { $case: "ip", ip: object.wellKnown.ip }; + } + break; + } + case "ipv4": { + if (object.wellKnown?.ipv4 !== undefined && object.wellKnown?.ipv4 !== null) { + message.wellKnown = { $case: "ipv4", ipv4: object.wellKnown.ipv4 }; + } + break; + } + case "ipv6": { + if (object.wellKnown?.ipv6 !== undefined && object.wellKnown?.ipv6 !== null) { + message.wellKnown = { $case: "ipv6", ipv6: object.wellKnown.ipv6 }; + } + break; + } + case "uri": { + if (object.wellKnown?.uri !== undefined && object.wellKnown?.uri !== null) { + message.wellKnown = { $case: "uri", uri: object.wellKnown.uri }; + } + break; + } + case "uriRef": { + if (object.wellKnown?.uriRef !== undefined && object.wellKnown?.uriRef !== null) { + message.wellKnown = { $case: "uriRef", uriRef: object.wellKnown.uriRef }; + } + break; + } + case "address": { + if (object.wellKnown?.address !== undefined && object.wellKnown?.address !== null) { + message.wellKnown = { $case: "address", address: object.wellKnown.address }; + } + break; + } + case "uuid": { + if (object.wellKnown?.uuid !== undefined && object.wellKnown?.uuid !== null) { + message.wellKnown = { $case: "uuid", uuid: object.wellKnown.uuid }; + } + break; + } + case "wellKnownRegex": { + if (object.wellKnown?.wellKnownRegex !== undefined && object.wellKnown?.wellKnownRegex !== null) { + message.wellKnown = { $case: "wellKnownRegex", wellKnownRegex: object.wellKnown.wellKnownRegex }; + } + break; + } + } + message.strict = object.strict ?? true; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseBytesRules(): BytesRules { + return { + const: Buffer.alloc(0), + len: Long.UZERO, + minLen: Long.UZERO, + maxLen: Long.UZERO, + pattern: "", + prefix: Buffer.alloc(0), + suffix: Buffer.alloc(0), + contains: Buffer.alloc(0), + in: [], + notIn: [], + wellKnown: undefined, + ignoreEmpty: false, + }; +} + +export const BytesRules: MessageFns = { + encode(message: BytesRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const.length !== 0) { + writer.uint32(10).bytes(message.const); + } + if (message.len !== undefined && !message.len.equals(Long.UZERO)) { + writer.uint32(104).uint64(message.len.toString()); + } + if (message.minLen !== undefined && !message.minLen.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.minLen.toString()); + } + if (message.maxLen !== undefined && !message.maxLen.equals(Long.UZERO)) { + writer.uint32(24).uint64(message.maxLen.toString()); + } + if (message.pattern !== undefined && message.pattern !== "") { + writer.uint32(34).string(message.pattern); + } + if (message.prefix !== undefined && message.prefix.length !== 0) { + writer.uint32(42).bytes(message.prefix); + } + if (message.suffix !== undefined && message.suffix.length !== 0) { + writer.uint32(50).bytes(message.suffix); + } + if (message.contains !== undefined && message.contains.length !== 0) { + writer.uint32(58).bytes(message.contains); + } + for (const v of message.in) { + writer.uint32(66).bytes(v!); + } + for (const v of message.notIn) { + writer.uint32(74).bytes(v!); + } + switch (message.wellKnown?.$case) { + case "ip": + writer.uint32(80).bool(message.wellKnown.ip); + break; + case "ipv4": + writer.uint32(88).bool(message.wellKnown.ipv4); + break; + case "ipv6": + writer.uint32(96).bool(message.wellKnown.ipv6); + break; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(112).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BytesRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBytesRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.const = Buffer.from(reader.bytes()); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.len = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.minLen = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.maxLen = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.pattern = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.prefix = Buffer.from(reader.bytes()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.suffix = Buffer.from(reader.bytes()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.contains = Buffer.from(reader.bytes()); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.in.push(Buffer.from(reader.bytes())); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.notIn.push(Buffer.from(reader.bytes())); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.wellKnown = { $case: "ip", ip: reader.bool() }; + continue; + } + case 11: { + if (tag !== 88) { + break; + } + + message.wellKnown = { $case: "ipv4", ipv4: reader.bool() }; + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.wellKnown = { $case: "ipv6", ipv6: reader.bool() }; + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BytesRules { + return { + const: isSet(object.const) ? Buffer.from(bytesFromBase64(object.const)) : Buffer.alloc(0), + len: isSet(object.len) ? Long.fromValue(object.len) : Long.UZERO, + minLen: isSet(object.minLen) ? Long.fromValue(object.minLen) : Long.UZERO, + maxLen: isSet(object.maxLen) ? Long.fromValue(object.maxLen) : Long.UZERO, + pattern: isSet(object.pattern) ? globalThis.String(object.pattern) : "", + prefix: isSet(object.prefix) ? Buffer.from(bytesFromBase64(object.prefix)) : Buffer.alloc(0), + suffix: isSet(object.suffix) ? Buffer.from(bytesFromBase64(object.suffix)) : Buffer.alloc(0), + contains: isSet(object.contains) ? Buffer.from(bytesFromBase64(object.contains)) : Buffer.alloc(0), + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Buffer.from(bytesFromBase64(e))) : [], + notIn: globalThis.Array.isArray(object?.notIn) + ? object.notIn.map((e: any) => Buffer.from(bytesFromBase64(e))) + : [], + wellKnown: isSet(object.ip) + ? { $case: "ip", ip: globalThis.Boolean(object.ip) } + : isSet(object.ipv4) + ? { $case: "ipv4", ipv4: globalThis.Boolean(object.ipv4) } + : isSet(object.ipv6) + ? { $case: "ipv6", ipv6: globalThis.Boolean(object.ipv6) } + : undefined, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: BytesRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const.length !== 0) { + obj.const = base64FromBytes(message.const); + } + if (message.len !== undefined && !message.len.equals(Long.UZERO)) { + obj.len = (message.len || Long.UZERO).toString(); + } + if (message.minLen !== undefined && !message.minLen.equals(Long.UZERO)) { + obj.minLen = (message.minLen || Long.UZERO).toString(); + } + if (message.maxLen !== undefined && !message.maxLen.equals(Long.UZERO)) { + obj.maxLen = (message.maxLen || Long.UZERO).toString(); + } + if (message.pattern !== undefined && message.pattern !== "") { + obj.pattern = message.pattern; + } + if (message.prefix !== undefined && message.prefix.length !== 0) { + obj.prefix = base64FromBytes(message.prefix); + } + if (message.suffix !== undefined && message.suffix.length !== 0) { + obj.suffix = base64FromBytes(message.suffix); + } + if (message.contains !== undefined && message.contains.length !== 0) { + obj.contains = base64FromBytes(message.contains); + } + if (message.in?.length) { + obj.in = message.in.map((e) => base64FromBytes(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => base64FromBytes(e)); + } + if (message.wellKnown?.$case === "ip") { + obj.ip = message.wellKnown.ip; + } else if (message.wellKnown?.$case === "ipv4") { + obj.ipv4 = message.wellKnown.ipv4; + } else if (message.wellKnown?.$case === "ipv6") { + obj.ipv6 = message.wellKnown.ipv6; + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): BytesRules { + return BytesRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BytesRules { + const message = createBaseBytesRules(); + message.const = object.const ?? Buffer.alloc(0); + message.len = (object.len !== undefined && object.len !== null) ? Long.fromValue(object.len) : Long.UZERO; + message.minLen = (object.minLen !== undefined && object.minLen !== null) + ? Long.fromValue(object.minLen) + : Long.UZERO; + message.maxLen = (object.maxLen !== undefined && object.maxLen !== null) + ? Long.fromValue(object.maxLen) + : Long.UZERO; + message.pattern = object.pattern ?? ""; + message.prefix = object.prefix ?? Buffer.alloc(0); + message.suffix = object.suffix ?? Buffer.alloc(0); + message.contains = object.contains ?? Buffer.alloc(0); + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + switch (object.wellKnown?.$case) { + case "ip": { + if (object.wellKnown?.ip !== undefined && object.wellKnown?.ip !== null) { + message.wellKnown = { $case: "ip", ip: object.wellKnown.ip }; + } + break; + } + case "ipv4": { + if (object.wellKnown?.ipv4 !== undefined && object.wellKnown?.ipv4 !== null) { + message.wellKnown = { $case: "ipv4", ipv4: object.wellKnown.ipv4 }; + } + break; + } + case "ipv6": { + if (object.wellKnown?.ipv6 !== undefined && object.wellKnown?.ipv6 !== null) { + message.wellKnown = { $case: "ipv6", ipv6: object.wellKnown.ipv6 }; + } + break; + } + } + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseEnumRules(): EnumRules { + return { const: 0, definedOnly: false, in: [], notIn: [] }; +} + +export const EnumRules: MessageFns = { + encode(message: EnumRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.const !== undefined && message.const !== 0) { + writer.uint32(8).int32(message.const); + } + if (message.definedOnly !== undefined && message.definedOnly !== false) { + writer.uint32(16).bool(message.definedOnly); + } + for (const v of message.in) { + writer.uint32(24).int32(v!); + } + for (const v of message.notIn) { + writer.uint32(32).int32(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): EnumRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.const = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.definedOnly = reader.bool(); + continue; + } + case 3: { + if (tag === 24) { + message.in.push(reader.int32()); + + continue; + } + + if (tag === 26) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.in.push(reader.int32()); + } + + continue; + } + + break; + } + case 4: { + if (tag === 32) { + message.notIn.push(reader.int32()); + + continue; + } + + if (tag === 34) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.notIn.push(reader.int32()); + } + + continue; + } + + break; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): EnumRules { + return { + const: isSet(object.const) ? globalThis.Number(object.const) : 0, + definedOnly: isSet(object.definedOnly) ? globalThis.Boolean(object.definedOnly) : false, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.Number(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.Number(e)) : [], + }; + }, + + toJSON(message: EnumRules): unknown { + const obj: any = {}; + if (message.const !== undefined && message.const !== 0) { + obj.const = Math.round(message.const); + } + if (message.definedOnly !== undefined && message.definedOnly !== false) { + obj.definedOnly = message.definedOnly; + } + if (message.in?.length) { + obj.in = message.in.map((e) => Math.round(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Math.round(e)); + } + return obj; + }, + + create(base?: DeepPartial): EnumRules { + return EnumRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): EnumRules { + const message = createBaseEnumRules(); + message.const = object.const ?? 0; + message.definedOnly = object.definedOnly ?? false; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + return message; + }, +}; + +function createBaseMessageRules(): MessageRules { + return { skip: false, required: false }; +} + +export const MessageRules: MessageFns = { + encode(message: MessageRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.skip !== undefined && message.skip !== false) { + writer.uint32(8).bool(message.skip); + } + if (message.required !== undefined && message.required !== false) { + writer.uint32(16).bool(message.required); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MessageRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.skip = reader.bool(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.required = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MessageRules { + return { + skip: isSet(object.skip) ? globalThis.Boolean(object.skip) : false, + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + }; + }, + + toJSON(message: MessageRules): unknown { + const obj: any = {}; + if (message.skip !== undefined && message.skip !== false) { + obj.skip = message.skip; + } + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + return obj; + }, + + create(base?: DeepPartial): MessageRules { + return MessageRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MessageRules { + const message = createBaseMessageRules(); + message.skip = object.skip ?? false; + message.required = object.required ?? false; + return message; + }, +}; + +function createBaseRepeatedRules(): RepeatedRules { + return { minItems: Long.UZERO, maxItems: Long.UZERO, unique: false, items: undefined, ignoreEmpty: false }; +} + +export const RepeatedRules: MessageFns = { + encode(message: RepeatedRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.minItems !== undefined && !message.minItems.equals(Long.UZERO)) { + writer.uint32(8).uint64(message.minItems.toString()); + } + if (message.maxItems !== undefined && !message.maxItems.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.maxItems.toString()); + } + if (message.unique !== undefined && message.unique !== false) { + writer.uint32(24).bool(message.unique); + } + if (message.items !== undefined) { + FieldRules.encode(message.items, writer.uint32(34).fork()).join(); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(40).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): RepeatedRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRepeatedRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.minItems = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.maxItems = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.unique = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.items = FieldRules.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): RepeatedRules { + return { + minItems: isSet(object.minItems) ? Long.fromValue(object.minItems) : Long.UZERO, + maxItems: isSet(object.maxItems) ? Long.fromValue(object.maxItems) : Long.UZERO, + unique: isSet(object.unique) ? globalThis.Boolean(object.unique) : false, + items: isSet(object.items) ? FieldRules.fromJSON(object.items) : undefined, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: RepeatedRules): unknown { + const obj: any = {}; + if (message.minItems !== undefined && !message.minItems.equals(Long.UZERO)) { + obj.minItems = (message.minItems || Long.UZERO).toString(); + } + if (message.maxItems !== undefined && !message.maxItems.equals(Long.UZERO)) { + obj.maxItems = (message.maxItems || Long.UZERO).toString(); + } + if (message.unique !== undefined && message.unique !== false) { + obj.unique = message.unique; + } + if (message.items !== undefined) { + obj.items = FieldRules.toJSON(message.items); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): RepeatedRules { + return RepeatedRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): RepeatedRules { + const message = createBaseRepeatedRules(); + message.minItems = (object.minItems !== undefined && object.minItems !== null) + ? Long.fromValue(object.minItems) + : Long.UZERO; + message.maxItems = (object.maxItems !== undefined && object.maxItems !== null) + ? Long.fromValue(object.maxItems) + : Long.UZERO; + message.unique = object.unique ?? false; + message.items = (object.items !== undefined && object.items !== null) + ? FieldRules.fromPartial(object.items) + : undefined; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseMapRules(): MapRules { + return { + minPairs: Long.UZERO, + maxPairs: Long.UZERO, + noSparse: false, + keys: undefined, + values: undefined, + ignoreEmpty: false, + }; +} + +export const MapRules: MessageFns = { + encode(message: MapRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.minPairs !== undefined && !message.minPairs.equals(Long.UZERO)) { + writer.uint32(8).uint64(message.minPairs.toString()); + } + if (message.maxPairs !== undefined && !message.maxPairs.equals(Long.UZERO)) { + writer.uint32(16).uint64(message.maxPairs.toString()); + } + if (message.noSparse !== undefined && message.noSparse !== false) { + writer.uint32(24).bool(message.noSparse); + } + if (message.keys !== undefined) { + FieldRules.encode(message.keys, writer.uint32(34).fork()).join(); + } + if (message.values !== undefined) { + FieldRules.encode(message.values, writer.uint32(42).fork()).join(); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + writer.uint32(48).bool(message.ignoreEmpty); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MapRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMapRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.minPairs = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.maxPairs = Long.fromString(reader.uint64().toString(), true); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.noSparse = reader.bool(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.keys = FieldRules.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.values = FieldRules.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.ignoreEmpty = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MapRules { + return { + minPairs: isSet(object.minPairs) ? Long.fromValue(object.minPairs) : Long.UZERO, + maxPairs: isSet(object.maxPairs) ? Long.fromValue(object.maxPairs) : Long.UZERO, + noSparse: isSet(object.noSparse) ? globalThis.Boolean(object.noSparse) : false, + keys: isSet(object.keys) ? FieldRules.fromJSON(object.keys) : undefined, + values: isSet(object.values) ? FieldRules.fromJSON(object.values) : undefined, + ignoreEmpty: isSet(object.ignoreEmpty) ? globalThis.Boolean(object.ignoreEmpty) : false, + }; + }, + + toJSON(message: MapRules): unknown { + const obj: any = {}; + if (message.minPairs !== undefined && !message.minPairs.equals(Long.UZERO)) { + obj.minPairs = (message.minPairs || Long.UZERO).toString(); + } + if (message.maxPairs !== undefined && !message.maxPairs.equals(Long.UZERO)) { + obj.maxPairs = (message.maxPairs || Long.UZERO).toString(); + } + if (message.noSparse !== undefined && message.noSparse !== false) { + obj.noSparse = message.noSparse; + } + if (message.keys !== undefined) { + obj.keys = FieldRules.toJSON(message.keys); + } + if (message.values !== undefined) { + obj.values = FieldRules.toJSON(message.values); + } + if (message.ignoreEmpty !== undefined && message.ignoreEmpty !== false) { + obj.ignoreEmpty = message.ignoreEmpty; + } + return obj; + }, + + create(base?: DeepPartial): MapRules { + return MapRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MapRules { + const message = createBaseMapRules(); + message.minPairs = (object.minPairs !== undefined && object.minPairs !== null) + ? Long.fromValue(object.minPairs) + : Long.UZERO; + message.maxPairs = (object.maxPairs !== undefined && object.maxPairs !== null) + ? Long.fromValue(object.maxPairs) + : Long.UZERO; + message.noSparse = object.noSparse ?? false; + message.keys = (object.keys !== undefined && object.keys !== null) + ? FieldRules.fromPartial(object.keys) + : undefined; + message.values = (object.values !== undefined && object.values !== null) + ? FieldRules.fromPartial(object.values) + : undefined; + message.ignoreEmpty = object.ignoreEmpty ?? false; + return message; + }, +}; + +function createBaseAnyRules(): AnyRules { + return { required: false, in: [], notIn: [] }; +} + +export const AnyRules: MessageFns = { + encode(message: AnyRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.required !== undefined && message.required !== false) { + writer.uint32(8).bool(message.required); + } + for (const v of message.in) { + writer.uint32(18).string(v!); + } + for (const v of message.notIn) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): AnyRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAnyRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.required = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.in.push(reader.string()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.notIn.push(reader.string()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): AnyRules { + return { + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => globalThis.String(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => globalThis.String(e)) : [], + }; + }, + + toJSON(message: AnyRules): unknown { + const obj: any = {}; + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + if (message.in?.length) { + obj.in = message.in; + } + if (message.notIn?.length) { + obj.notIn = message.notIn; + } + return obj; + }, + + create(base?: DeepPartial): AnyRules { + return AnyRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): AnyRules { + const message = createBaseAnyRules(); + message.required = object.required ?? false; + message.in = object.in?.map((e) => e) || []; + message.notIn = object.notIn?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDurationRules(): DurationRules { + return { + required: false, + const: undefined, + lt: undefined, + lte: undefined, + gt: undefined, + gte: undefined, + in: [], + notIn: [], + }; +} + +export const DurationRules: MessageFns = { + encode(message: DurationRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.required !== undefined && message.required !== false) { + writer.uint32(8).bool(message.required); + } + if (message.const !== undefined) { + Duration.encode(message.const, writer.uint32(18).fork()).join(); + } + if (message.lt !== undefined) { + Duration.encode(message.lt, writer.uint32(26).fork()).join(); + } + if (message.lte !== undefined) { + Duration.encode(message.lte, writer.uint32(34).fork()).join(); + } + if (message.gt !== undefined) { + Duration.encode(message.gt, writer.uint32(42).fork()).join(); + } + if (message.gte !== undefined) { + Duration.encode(message.gte, writer.uint32(50).fork()).join(); + } + for (const v of message.in) { + Duration.encode(v!, writer.uint32(58).fork()).join(); + } + for (const v of message.notIn) { + Duration.encode(v!, writer.uint32(66).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DurationRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDurationRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.required = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.const = Duration.decode(reader, reader.uint32()); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.lt = Duration.decode(reader, reader.uint32()); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.lte = Duration.decode(reader, reader.uint32()); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.gt = Duration.decode(reader, reader.uint32()); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.gte = Duration.decode(reader, reader.uint32()); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.in.push(Duration.decode(reader, reader.uint32())); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.notIn.push(Duration.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DurationRules { + return { + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + const: isSet(object.const) ? Duration.fromJSON(object.const) : undefined, + lt: isSet(object.lt) ? Duration.fromJSON(object.lt) : undefined, + lte: isSet(object.lte) ? Duration.fromJSON(object.lte) : undefined, + gt: isSet(object.gt) ? Duration.fromJSON(object.gt) : undefined, + gte: isSet(object.gte) ? Duration.fromJSON(object.gte) : undefined, + in: globalThis.Array.isArray(object?.in) ? object.in.map((e: any) => Duration.fromJSON(e)) : [], + notIn: globalThis.Array.isArray(object?.notIn) ? object.notIn.map((e: any) => Duration.fromJSON(e)) : [], + }; + }, + + toJSON(message: DurationRules): unknown { + const obj: any = {}; + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + if (message.const !== undefined) { + obj.const = Duration.toJSON(message.const); + } + if (message.lt !== undefined) { + obj.lt = Duration.toJSON(message.lt); + } + if (message.lte !== undefined) { + obj.lte = Duration.toJSON(message.lte); + } + if (message.gt !== undefined) { + obj.gt = Duration.toJSON(message.gt); + } + if (message.gte !== undefined) { + obj.gte = Duration.toJSON(message.gte); + } + if (message.in?.length) { + obj.in = message.in.map((e) => Duration.toJSON(e)); + } + if (message.notIn?.length) { + obj.notIn = message.notIn.map((e) => Duration.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): DurationRules { + return DurationRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DurationRules { + const message = createBaseDurationRules(); + message.required = object.required ?? false; + message.const = (object.const !== undefined && object.const !== null) + ? Duration.fromPartial(object.const) + : undefined; + message.lt = (object.lt !== undefined && object.lt !== null) ? Duration.fromPartial(object.lt) : undefined; + message.lte = (object.lte !== undefined && object.lte !== null) ? Duration.fromPartial(object.lte) : undefined; + message.gt = (object.gt !== undefined && object.gt !== null) ? Duration.fromPartial(object.gt) : undefined; + message.gte = (object.gte !== undefined && object.gte !== null) ? Duration.fromPartial(object.gte) : undefined; + message.in = object.in?.map((e) => Duration.fromPartial(e)) || []; + message.notIn = object.notIn?.map((e) => Duration.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseTimestampRules(): TimestampRules { + return { + required: false, + const: undefined, + lt: undefined, + lte: undefined, + gt: undefined, + gte: undefined, + ltNow: false, + gtNow: false, + within: undefined, + }; +} + +export const TimestampRules: MessageFns = { + encode(message: TimestampRules, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.required !== undefined && message.required !== false) { + writer.uint32(8).bool(message.required); + } + if (message.const !== undefined) { + Timestamp.encode(toTimestamp(message.const), writer.uint32(18).fork()).join(); + } + if (message.lt !== undefined) { + Timestamp.encode(toTimestamp(message.lt), writer.uint32(26).fork()).join(); + } + if (message.lte !== undefined) { + Timestamp.encode(toTimestamp(message.lte), writer.uint32(34).fork()).join(); + } + if (message.gt !== undefined) { + Timestamp.encode(toTimestamp(message.gt), writer.uint32(42).fork()).join(); + } + if (message.gte !== undefined) { + Timestamp.encode(toTimestamp(message.gte), writer.uint32(50).fork()).join(); + } + if (message.ltNow !== undefined && message.ltNow !== false) { + writer.uint32(56).bool(message.ltNow); + } + if (message.gtNow !== undefined && message.gtNow !== false) { + writer.uint32(64).bool(message.gtNow); + } + if (message.within !== undefined) { + Duration.encode(message.within, writer.uint32(74).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): TimestampRules { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestampRules(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.required = reader.bool(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.const = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.lt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.lte = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.gt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.gte = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.ltNow = reader.bool(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.gtNow = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.within = Duration.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): TimestampRules { + return { + required: isSet(object.required) ? globalThis.Boolean(object.required) : false, + const: isSet(object.const) ? fromJsonTimestamp(object.const) : undefined, + lt: isSet(object.lt) ? fromJsonTimestamp(object.lt) : undefined, + lte: isSet(object.lte) ? fromJsonTimestamp(object.lte) : undefined, + gt: isSet(object.gt) ? fromJsonTimestamp(object.gt) : undefined, + gte: isSet(object.gte) ? fromJsonTimestamp(object.gte) : undefined, + ltNow: isSet(object.ltNow) ? globalThis.Boolean(object.ltNow) : false, + gtNow: isSet(object.gtNow) ? globalThis.Boolean(object.gtNow) : false, + within: isSet(object.within) ? Duration.fromJSON(object.within) : undefined, + }; + }, + + toJSON(message: TimestampRules): unknown { + const obj: any = {}; + if (message.required !== undefined && message.required !== false) { + obj.required = message.required; + } + if (message.const !== undefined) { + obj.const = message.const.toISOString(); + } + if (message.lt !== undefined) { + obj.lt = message.lt.toISOString(); + } + if (message.lte !== undefined) { + obj.lte = message.lte.toISOString(); + } + if (message.gt !== undefined) { + obj.gt = message.gt.toISOString(); + } + if (message.gte !== undefined) { + obj.gte = message.gte.toISOString(); + } + if (message.ltNow !== undefined && message.ltNow !== false) { + obj.ltNow = message.ltNow; + } + if (message.gtNow !== undefined && message.gtNow !== false) { + obj.gtNow = message.gtNow; + } + if (message.within !== undefined) { + obj.within = Duration.toJSON(message.within); + } + return obj; + }, + + create(base?: DeepPartial): TimestampRules { + return TimestampRules.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): TimestampRules { + const message = createBaseTimestampRules(); + message.required = object.required ?? false; + message.const = object.const ?? undefined; + message.lt = object.lt ?? undefined; + message.lte = object.lte ?? undefined; + message.gt = object.gt ?? undefined; + message.gte = object.gte ?? undefined; + message.ltNow = object.ltNow ?? false; + message.gtNow = object.gtNow ?? false; + message.within = (object.within !== undefined && object.within !== null) + ? Duration.fromPartial(object.within) + : undefined; + return message; + }, +}; + +function bytesFromBase64(b64: string): Uint8Array { + return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); +} + +function base64FromBytes(arr: Uint8Array): string { + return globalThis.Buffer.from(arr).toString("base64"); +} + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = numberToLong(Math.trunc(date.getTime() / 1_000)); + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds.toNumber() || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new globalThis.Date(millis); +} + +function fromJsonTimestamp(o: any): Date { + if (o instanceof globalThis.Date) { + return o; + } else if (typeof o === "string") { + return new globalThis.Date(o); + } else { + return fromTimestamp(Timestamp.fromJSON(o)); + } +} + +function numberToLong(number: number) { + return Long.fromNumber(number); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} + +export interface MessageFns { + encode(message: T, writer?: BinaryWriter): BinaryWriter; + decode(input: BinaryReader | Uint8Array, length?: number): T; + fromJSON(object: any): T; + toJSON(message: T): unknown; + create(base?: DeepPartial): T; + fromPartial(object: DeepPartial): T; +}