From 1eb2c0aef5470958159edfbf8df8731ea83322f0 Mon Sep 17 00:00:00 2001 From: tolgaozen <39353278+tolgaozen@users.noreply.github.com> Date: Mon, 10 Nov 2025 19:02:03 +0000 Subject: [PATCH] chore(proto): update generated SDK with latest Permify definitions --- src/grpc/generated/base/v1/base.ts | 9302 ++-- src/grpc/generated/base/v1/errors.ts | 927 +- .../generated/base/v1/service.grpc-client.ts | 647 + src/grpc/generated/base/v1/service.ts | 39482 ++-------------- .../google/api/expr/v1alpha1/checked.ts | 3145 +- .../google/api/expr/v1alpha1/syntax.ts | 3978 +- src/grpc/generated/google/api/http.ts | 874 +- src/grpc/generated/google/protobuf/any.ts | 374 +- .../generated/google/protobuf/descriptor.ts | 11315 ++--- .../generated/google/protobuf/duration.ts | 281 +- src/grpc/generated/google/protobuf/empty.ts | 141 +- src/grpc/generated/google/protobuf/struct.ts | 990 +- .../generated/google/protobuf/timestamp.ts | 305 +- .../protoc-gen-openapiv2/options/openapiv2.ts | 8091 ++-- src/grpc/generated/validate/validate.ts | 9971 ++-- 15 files changed, 25457 insertions(+), 64366 deletions(-) create mode 100644 src/grpc/generated/base/v1/service.grpc-client.ts diff --git a/src/grpc/generated/base/v1/base.ts b/src/grpc/generated/base/v1/base.ts index 1fed2c3..26e85b6 100644 --- a/src/grpc/generated/base/v1/base.ts +++ b/src/grpc/generated/base/v1/base.ts @@ -1,5758 +1,4046 @@ -// 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"; +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "base/v1/base.proto" (package "base.v1", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { Timestamp } from "../../google/protobuf/timestamp"; import { Any } from "../../google/protobuf/any"; +import { CheckedExpr } from "../../google/api/expr/v1alpha1/checked"; 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. + * + * @generated from protobuf message base.v1.Context */ 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; + /** + * A repeated field of tuples involved in the operation. + * + * @generated from protobuf field: repeated base.v1.Tuple tuples = 1; + */ + tuples: Tuple[]; + /** + * A repeated field of attributes associated with the operation. + * + * @generated from protobuf field: repeated base.v1.Attribute attributes = 2; + */ + attributes: Attribute[]; + /** + * Additional data associated with the context. + * + * @generated from protobuf field: google.protobuf.Struct data = 3; + */ + data?: Struct; } - -/** Child represents a node in the permission tree. */ +/** + * Child represents a node in the permission tree. + * + * @generated from protobuf message base.v1.Child + */ 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; + /** + * @generated from protobuf oneof: type + */ + type: { + oneofKind: "leaf"; + /** + * Leaf node in the permission tree. + * + * @generated from protobuf field: base.v1.Leaf leaf = 1; + */ + leaf: Leaf; + } | { + oneofKind: "rewrite"; + /** + * Rewrite operation in the permission tree. + * + * @generated from protobuf field: base.v1.Rewrite rewrite = 2; + */ + rewrite: Rewrite; + } | { + oneofKind: undefined; + }; } - -/** Leaf represents a leaf node in the permission tree. */ +/** + * Leaf represents a leaf node in the permission tree. + * + * @generated from protobuf message base.v1.Leaf + */ 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; + /** + * @generated from protobuf oneof: type + */ + type: { + oneofKind: "computedUserSet"; + /** + * A computed set of users. + * + * @generated from protobuf field: base.v1.ComputedUserSet computed_user_set = 1; + */ + computedUserSet: ComputedUserSet; + } | { + oneofKind: "tupleToUserSet"; + /** + * A tuple to user set conversion. + * + * @generated from protobuf field: base.v1.TupleToUserSet tuple_to_user_set = 2; + */ + tupleToUserSet: TupleToUserSet; + } | { + oneofKind: "computedAttribute"; + /** + * A computed attribute. + * + * @generated from protobuf field: base.v1.ComputedAttribute computed_attribute = 3; + */ + computedAttribute: ComputedAttribute; + } | { + oneofKind: "call"; + /** + * A call to a function or method. + * + * @generated from protobuf field: base.v1.Call call = 4; + */ + call: Call; + } | { + oneofKind: undefined; + }; } - /** * The Rewrite message represents a specific rewrite operation. * This operation could be one of the following: union, intersection, or exclusion. + * + * @generated from protobuf message base.v1.Rewrite */ 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[]; + /** + * The type of rewrite operation to be performed. + * + * @generated from protobuf field: base.v1.Rewrite.Operation rewrite_operation = 1; + */ + rewriteOperation: Rewrite_Operation; + /** + * A list of children that are operated upon by the rewrite operation. + * + * @generated from protobuf field: repeated base.v1.Child children = 2; + */ + 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. + * + * @generated from protobuf enum base.v1.Rewrite.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"; - } + /** + * Default, unspecified operation. + * + * @generated from protobuf enum value: OPERATION_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Represents a union operation. + * + * @generated from protobuf enum value: OPERATION_UNION = 1; + */ + UNION = 1, + /** + * Represents an intersection operation. + * + * @generated from protobuf enum value: OPERATION_INTERSECTION = 2; + */ + INTERSECTION = 2, + /** + * Represents an exclusion operation. + * + * @generated from protobuf enum value: OPERATION_EXCLUSION = 3; + */ + EXCLUSION = 3 } - /** * The SchemaDefinition message provides definitions for entities and rules, * and includes references to clarify whether a name refers to an entity or a rule. + * + * @generated from protobuf message base.v1.SchemaDefinition */ 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 }; + /** + * Map of entity definitions. The key is the entity name, and the value is the corresponding EntityDefinition. + * + * @generated from protobuf field: map entity_definitions = 1; + */ + entityDefinitions: { + [key: string]: EntityDefinition; + }; + /** + * Map of rule definitions. The key is the rule name, and the value is the corresponding RuleDefinition. + * + * @generated from protobuf field: map rule_definitions = 2; + */ + ruleDefinitions: { + [key: string]: RuleDefinition; + }; + /** + * Map of references to signify whether a string refers to an entity or a rule. + * + * @generated from protobuf field: map references = 3; + */ + references: { + [key: string]: SchemaDefinition_Reference; + }; } - -/** The Reference enum helps distinguish whether a name corresponds to an entity or a rule. */ +/** + * The Reference enum helps distinguish whether a name corresponds to an entity or a rule. + * + * @generated from protobuf enum base.v1.SchemaDefinition.Reference + */ 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; + /** + * Default, unspecified reference. + * + * @generated from protobuf enum value: REFERENCE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Indicates that the name refers to an entity. + * + * @generated from protobuf enum value: REFERENCE_ENTITY = 1; + */ + ENTITY = 1, + /** + * Indicates that the name refers to a rule. + * + * @generated from protobuf enum value: REFERENCE_RULE = 2; + */ + RULE = 2 } - -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. */ +/** + * The EntityDefinition message provides detailed information about a specific entity. + * + * @generated from protobuf message base.v1.EntityDefinition + */ 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 name of the entity, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * Map of relation definitions within this entity. The key is the relation name, and the value is the RelationDefinition. + * + * @generated from protobuf field: map relations = 2; + */ + relations: { + [key: string]: RelationDefinition; + }; + /** + * Map of permission definitions within this entity. The key is the permission name, and the value is the PermissionDefinition. + * + * @generated from protobuf field: map permissions = 3; + */ + permissions: { + [key: string]: PermissionDefinition; + }; + /** + * Map of attribute definitions within this entity. The key is the attribute name, and the value is the AttributeDefinition. + * + * @generated from protobuf field: map attributes = 4; + */ + attributes: { + [key: string]: AttributeDefinition; + }; + /** + * Map of references indicating whether a string pertains to a relation, permission, or attribute. + * + * @generated from protobuf field: map references = 5; + */ + references: { + [key: string]: EntityDefinition_Reference; + }; } - -/** The Reference enum specifies whether a name pertains to a relation, permission, or attribute. */ +/** + * The Reference enum specifies whether a name pertains to a relation, permission, or attribute. + * + * @generated from protobuf enum base.v1.EntityDefinition.Reference + */ 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"; - } + /** + * Default, unspecified reference. + * + * @generated from protobuf enum value: REFERENCE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Indicates that the name refers to a relation. + * + * @generated from protobuf enum value: REFERENCE_RELATION = 1; + */ + RELATION = 1, + /** + * Indicates that the name refers to a permission. + * + * @generated from protobuf enum value: REFERENCE_PERMISSION = 2; + */ + PERMISSION = 2, + /** + * Indicates that the name refers to an attribute. + * + * @generated from protobuf enum value: REFERENCE_ATTRIBUTE = 3; + */ + ATTRIBUTE = 3 } - -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. */ +/** + * The RuleDefinition message provides detailed information about a specific rule. + * + * @generated from protobuf message base.v1.RuleDefinition + */ 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 name of the rule, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * Map of arguments for this rule. The key is the attribute name, and the value is the AttributeType. + * + * @generated from protobuf field: map arguments = 2; + */ + arguments: { + [key: string]: AttributeType; + }; + /** + * The expression for this rule in the form of a google.api.expr.v1alpha1.CheckedExpr. + * + * @generated from protobuf field: google.api.expr.v1alpha1.CheckedExpr expression = 3; + */ + expression?: CheckedExpr; } - -/** The AttributeDefinition message provides detailed information about a specific attribute. */ +/** + * The AttributeDefinition message provides detailed information about a specific attribute. + * + * @generated from protobuf message base.v1.AttributeDefinition + */ 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 name of the attribute, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * The type of the attribute. + * + * @generated from protobuf field: base.v1.AttributeType type = 2; + */ + type: AttributeType; } - -/** The RelationDefinition message provides detailed information about a specific relation. */ +/** + * The RelationDefinition message provides detailed information about a specific relation. + * + * @generated from protobuf message base.v1.RelationDefinition + */ 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 name of the relation, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * A list of references to other relations. + * + * @generated from protobuf field: repeated base.v1.RelationReference relation_references = 2; + */ + relationReferences: RelationReference[]; } - -/** The PermissionDefinition message provides detailed information about a specific permission. */ +/** + * The PermissionDefinition message provides detailed information about a specific permission. + * + * @generated from protobuf message base.v1.PermissionDefinition + */ 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 name of the permission, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * The child related to this permission. + * + * @generated from protobuf field: base.v1.Child child = 2; + */ + child?: Child; } - -/** The RelationReference message provides a reference to a specific relation. */ +/** + * The RelationReference message provides a reference to a specific relation. + * + * @generated from protobuf message base.v1.RelationReference + */ 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; + /** + * The type of the referenced entity, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string type = 1; + */ + type: string; + /** + * The name of the referenced relation, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string relation = 2; + */ + relation: string; } - +/** + * @generated from protobuf message base.v1.Entrance + */ 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; + /** + * The type of the entrance entity, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string type = 1; + */ + type: string; + /** + * The value associated with the entrance, which follows a specific string pattern and has a maximum byte size. + * + * @generated from protobuf field: string value = 2; + */ + value: string; } - -/** Argument defines the type of argument in a Call. It can be either a ComputedAttribute or a ContextAttribute. */ +/** + * Argument defines the type of argument in a Call. It can be either a ComputedAttribute or a ContextAttribute. + * + * @generated from protobuf message base.v1.Argument + */ export interface Argument { - type?: { $case: "computedAttribute"; computedAttribute: ComputedAttribute } | undefined; + /** + * @generated from protobuf oneof: type + */ + type: { + oneofKind: "computedAttribute"; + /** + * @generated from protobuf field: base.v1.ComputedAttribute computed_attribute = 1; + */ + computedAttribute: ComputedAttribute; + } | { + oneofKind: undefined; + }; } - -/** Call represents a call to a rule. It includes the name of the rule and the arguments passed to it. */ +/** + * Call represents a call to a rule. It includes the name of the rule and the arguments passed to it. + * + * @generated from protobuf message base.v1.Call + */ export interface Call { - /** Name of the rule */ - ruleName: string; - /** Arguments passed to the rule */ - arguments: Argument[]; + /** + * @generated from protobuf field: string rule_name = 1; + */ + ruleName: string; // Name of the rule + /** + * @generated from protobuf field: repeated base.v1.Argument arguments = 2; + */ + arguments: Argument[]; // Arguments passed to the rule } - -/** ComputedAttribute defines a computed attribute which includes its name. */ +/** + * ComputedAttribute defines a computed attribute which includes its name. + * + * @generated from protobuf message base.v1.ComputedAttribute + */ export interface ComputedAttribute { - /** Name of the computed attribute */ - name: string; + /** + * @generated from protobuf field: string name = 1; + */ + name: string; // Name of the computed attribute } - -/** ComputedUserSet defines a set of computed users which includes the relation name. */ +/** + * ComputedUserSet defines a set of computed users which includes the relation name. + * + * @generated from protobuf message base.v1.ComputedUserSet + */ export interface ComputedUserSet { - /** Relation name */ - relation: string; + /** + * @generated from protobuf field: string relation = 1; + */ + relation: string; // Relation name } - -/** TupleToUserSet defines a mapping from tuple sets to computed user sets. */ +/** + * TupleToUserSet defines a mapping from tuple sets to computed user sets. + * + * @generated from protobuf message base.v1.TupleToUserSet + */ export interface TupleToUserSet { - /** The tuple set */ - tupleSet: - | TupleSet - | undefined; - /** The computed user set */ - computed: ComputedUserSet | undefined; + /** + * @generated from protobuf field: base.v1.TupleSet tupleSet = 1; + */ + tupleSet?: TupleSet; // The tuple set + /** + * @generated from protobuf field: base.v1.ComputedUserSet computed = 2; + */ + computed?: ComputedUserSet; // The computed user set } - -/** TupleSet represents a set of tuples associated with a specific relation. */ +/** + * TupleSet represents a set of tuples associated with a specific relation. + * + * @generated from protobuf message base.v1.TupleSet + */ export interface TupleSet { - relation: string; + /** + * @generated from protobuf field: string relation = 1; + */ + relation: string; } - -/** Tuple is a structure that includes an entity, a relation, and a subject. */ +/** + * Tuple is a structure that includes an entity, a relation, and a subject. + * + * @generated from protobuf message base.v1.Tuple + */ export interface Tuple { - entity: Entity | undefined; - relation: string; - subject: Subject | undefined; + /** + * @generated from protobuf field: base.v1.Entity entity = 1; + */ + entity?: Entity; + /** + * @generated from protobuf field: string relation = 2; + */ + relation: string; + /** + * @generated from protobuf field: base.v1.Subject subject = 3; + */ + subject?: Subject; } - -/** Attribute represents an attribute of an entity with a specific type and value. */ +/** + * Attribute represents an attribute of an entity with a specific type and value. + * + * @generated from protobuf message base.v1.Attribute + */ export interface Attribute { - entity: - | Entity - | undefined; - /** Name of the attribute */ - attribute: string; - value: Any | undefined; + /** + * @generated from protobuf field: base.v1.Entity entity = 1; + */ + entity?: Entity; + /** + * @generated from protobuf field: string attribute = 2; + */ + attribute: string; // Name of the attribute + /** + * @generated from protobuf field: google.protobuf.Any value = 3; + */ + value?: Any; } - -/** Tuples is a collection of tuples. */ +/** + * Tuples is a collection of tuples. + * + * @generated from protobuf message base.v1.Tuples + */ export interface Tuples { - tuples: Tuple[]; + /** + * @generated from protobuf field: repeated base.v1.Tuple tuples = 1; + */ + tuples: Tuple[]; } - -/** Attributes is a collection of attributes. */ +/** + * Attributes is a collection of attributes. + * + * @generated from protobuf message base.v1.Attributes + */ export interface Attributes { - attributes: Attribute[]; + /** + * @generated from protobuf field: repeated base.v1.Attribute attributes = 1; + */ + attributes: Attribute[]; } - -/** Entity represents an entity with a type and an identifier. */ +/** + * Entity represents an entity with a type and an identifier. + * + * @generated from protobuf message base.v1.Entity + */ export interface Entity { - type: string; - id: string; + /** + * @generated from protobuf field: string type = 1; + */ + type: string; + /** + * @generated from protobuf field: string id = 2; + */ + id: string; } - -/** EntityAndRelation represents an entity along with a relation. */ +/** + * EntityAndRelation represents an entity along with a relation. + * + * @generated from protobuf message base.v1.EntityAndRelation + */ export interface EntityAndRelation { - entity: Entity | undefined; - relation: string; + /** + * @generated from protobuf field: base.v1.Entity entity = 1; + */ + entity?: Entity; + /** + * @generated from protobuf field: string relation = 2; + */ + relation: string; } - -/** Subject represents an entity subject with a type, an identifier, and a relation. */ +/** + * Subject represents an entity subject with a type, an identifier, and a relation. + * + * @generated from protobuf message base.v1.Subject + */ export interface Subject { - type: string; - id: string; - relation: string; + /** + * @generated from protobuf field: string type = 1; + */ + type: string; + /** + * @generated from protobuf field: string id = 2; + */ + id: string; + /** + * @generated from protobuf field: string relation = 3; + */ + relation: string; } - -/** AttributeFilter is used to filter attributes based on the entity and attribute names. */ +/** + * AttributeFilter is used to filter attributes based on the entity and attribute names. + * + * @generated from protobuf message base.v1.AttributeFilter + */ export interface AttributeFilter { - entity: - | EntityFilter - | undefined; - /** Names of the attributes to be filtered */ - attributes: string[]; + /** + * @generated from protobuf field: base.v1.EntityFilter entity = 1; + */ + entity?: EntityFilter; + /** + * @generated from protobuf field: repeated string attributes = 2; + */ + attributes: string[]; // Names of the attributes to be filtered } - -/** TupleFilter is used to filter tuples based on the entity, relation and the subject. */ +/** + * TupleFilter is used to filter tuples based on the entity, relation and the subject. + * + * @generated from protobuf message base.v1.TupleFilter + */ export interface TupleFilter { - entity: EntityFilter | undefined; - relation: string; - /** The subject filter */ - subject: SubjectFilter | undefined; + /** + * @generated from protobuf field: base.v1.EntityFilter entity = 1; + */ + entity?: EntityFilter; + /** + * @generated from protobuf field: string relation = 2; + */ + relation: string; + /** + * @generated from protobuf field: base.v1.SubjectFilter subject = 3; + */ + subject?: SubjectFilter; // The subject filter } - -/** EntityFilter is used to filter entities based on the type and ids. */ +/** + * EntityFilter is used to filter entities based on the type and ids. + * + * @generated from protobuf message base.v1.EntityFilter + */ export interface EntityFilter { - /** Type of the entity */ - type: string; - /** List of entity IDs */ - ids: string[]; + /** + * @generated from protobuf field: string type = 1; + */ + type: string; // Type of the entity + /** + * @generated from protobuf field: repeated string ids = 2; + */ + ids: string[]; // List of entity IDs } - -/** SubjectFilter is used to filter subjects based on the type, ids and relation. */ +/** + * SubjectFilter is used to filter subjects based on the type, ids and relation. + * + * @generated from protobuf message base.v1.SubjectFilter + */ export interface SubjectFilter { - /** Type of the subject */ - type: string; - /** List of subject IDs */ - ids: string[]; - relation: string; + /** + * @generated from protobuf field: string type = 1; + */ + type: string; // Type of the subject + /** + * @generated from protobuf field: repeated string ids = 2; + */ + ids: string[]; // List of subject IDs + /** + * @generated from protobuf field: string relation = 3; + */ + relation: string; } - -/** ExpandTreeNode represents a node in an expansion tree with a specific operation and its children. */ +/** + * ExpandTreeNode represents a node in an expansion tree with a specific operation and its children. + * + * @generated from protobuf message base.v1.ExpandTreeNode + */ export interface ExpandTreeNode { - /** Operation to be applied on this tree node */ - operation: ExpandTreeNode_Operation; - /** The children of this tree node */ - children: Expand[]; + /** + * @generated from protobuf field: base.v1.ExpandTreeNode.Operation operation = 1; + */ + operation: ExpandTreeNode_Operation; // Operation to be applied on this tree node + /** + * @generated from protobuf field: repeated base.v1.Expand children = 2; + */ + children: Expand[]; // The children of this tree node } - -/** Operation is an enum representing the type of operation to be applied on the tree node. */ +/** + * Operation is an enum representing the type of operation to be applied on the tree node. + * + * @generated from protobuf enum base.v1.ExpandTreeNode.Operation + */ 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; - } + /** + * @generated from protobuf enum value: OPERATION_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * @generated from protobuf enum value: OPERATION_UNION = 1; + */ + UNION = 1, + /** + * @generated from protobuf enum value: OPERATION_INTERSECTION = 2; + */ + INTERSECTION = 2, + /** + * @generated from protobuf enum value: OPERATION_EXCLUSION = 3; + */ + EXCLUSION = 3 } - -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. + * + * @generated from protobuf message base.v1.Expand */ 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; + /** + * entity is the entity for which the hierarchical structure is defined. + * + * @generated from protobuf field: base.v1.Entity entity = 1; + */ + entity?: Entity; + /** + * permission is the permission applied to the entity. + * + * @generated from protobuf field: string permission = 2; + */ + permission: string; + /** + * arguments are the additional information or context used to evaluate permissions. + * + * @generated from protobuf field: repeated base.v1.Argument arguments = 3; + */ + arguments: Argument[]; + /** + * @generated from protobuf oneof: node + */ + node: { + oneofKind: "expand"; + /** + * expand contains another hierarchical structure. + * + * @generated from protobuf field: base.v1.ExpandTreeNode expand = 4; + */ + expand: ExpandTreeNode; + } | { + oneofKind: "leaf"; + /** + * leaf contains a set of subjects. + * + * @generated from protobuf field: base.v1.ExpandLeaf leaf = 5; + */ + leaf: ExpandLeaf; + } | { + oneofKind: undefined; + }; } - -/** ExpandLeaf is the leaf node of an Expand tree and can be either a set of Subjects or a set of Values. */ +/** + * ExpandLeaf is the leaf node of an Expand tree and can be either a set of Subjects or a set of Values. + * + * @generated from protobuf message base.v1.ExpandLeaf + */ 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; + /** + * @generated from protobuf oneof: type + */ + type: { + oneofKind: "subjects"; + /** + * subjects are used when the leaf is a set of subjects. + * + * @generated from protobuf field: base.v1.Subjects subjects = 1; + */ + subjects: Subjects; + } | { + oneofKind: "values"; + /** + * values are used when the leaf node is a set of values. + * + * @generated from protobuf field: base.v1.Values values = 2; + */ + values: Values; + } | { + oneofKind: "value"; + /** + * value is used when the leaf node is a single value. + * + * @generated from protobuf field: google.protobuf.Any value = 3; + */ + value: Any; + } | { + oneofKind: undefined; + }; } - +/** + * @generated from protobuf message base.v1.Values + */ export interface Values { - values: { [key: string]: Any }; -} - -export interface Values_ValuesEntry { - key: string; - value: Any | undefined; + /** + * @generated from protobuf field: map values = 1; + */ + values: { + [key: string]: Any; + }; } - -/** Subjects holds a repeated field of Subject type. */ +/** + * Subjects holds a repeated field of Subject type. + * + * @generated from protobuf message base.v1.Subjects + */ export interface Subjects { - /** A list of subjects. */ - subjects: Subject[]; + /** + * @generated from protobuf field: repeated base.v1.Subject subjects = 1; + */ + subjects: Subject[]; // A list of subjects. } - -/** Tenant represents a tenant with an id, a name, and a timestamp indicating when it was created. */ +/** + * Tenant represents a tenant with an id, a name, and a timestamp indicating when it was created. + * + * @generated from protobuf message base.v1.Tenant + */ 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; + /** + * @generated from protobuf field: string id = 1; + */ + id: string; // The ID of the tenant. + /** + * @generated from protobuf field: string name = 2; + */ + name: string; // The name of the tenant. + /** + * @generated from protobuf field: google.protobuf.Timestamp created_at = 3 [json_name = "created_at"]; + */ + createdAt?: Timestamp; // The time at which the tenant was created. } - -/** DataChanges represent changes in data with a snap token and a list of data change objects. */ +/** + * DataChanges represent changes in data with a snap token and a list of data change objects. + * + * @generated from protobuf message base.v1.DataChanges + */ export interface DataChanges { - /** The snapshot token. */ - snapToken: string; - /** The list of data changes. */ - dataChanges: DataChange[]; + /** + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + snapToken: string; // The snapshot token. + /** + * @generated from protobuf field: repeated base.v1.DataChange data_changes = 2 [json_name = "data_changes"]; + */ + dataChanges: DataChange[]; // The list of data changes. } - -/** DataChange represents a single change in data, with an operation type and the actual change which could be a tuple or an attribute. */ +/** + * DataChange represents a single change in data, with an operation type and the actual change which could be a tuple or an attribute. + * + * @generated from protobuf message base.v1.DataChange + */ 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; + /** + * @generated from protobuf field: base.v1.DataChange.Operation operation = 1; + */ + operation: DataChange_Operation; // The operation type. + /** + * @generated from protobuf oneof: type + */ + type: { + oneofKind: "tuple"; + /** + * @generated from protobuf field: base.v1.Tuple tuple = 2; + */ + tuple: Tuple; // If the change is a tuple. + } | { + oneofKind: "attribute"; + /** + * @generated from protobuf field: base.v1.Attribute attribute = 3; + */ + attribute: Attribute; // If the change is an attribute. + } | { + oneofKind: undefined; + }; } - +/** + * @generated from protobuf enum base.v1.DataChange.Operation + */ 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"; - } + /** + * Default operation, not specified. + * + * @generated from protobuf enum value: OPERATION_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Creation operation. + * + * @generated from protobuf enum value: OPERATION_CREATE = 1; + */ + CREATE = 1, + /** + * Deletion operation. + * + * @generated from protobuf enum value: OPERATION_DELETE = 2; + */ + DELETE = 2 } - -/** Wrapper for a single string value. */ +/** + * Wrapper for a single string value. + * + * @generated from protobuf message base.v1.StringValue + */ export interface StringValue { - /** The string value. */ - data: string; + /** + * @generated from protobuf field: string data = 1; + */ + data: string; // The string value. } - -/** Wrapper for a single integer value. */ +/** + * Wrapper for a single integer value. + * + * @generated from protobuf message base.v1.IntegerValue + */ export interface IntegerValue { - /** The integer value. */ - data: number; + /** + * @generated from protobuf field: int32 data = 1; + */ + data: number; // The integer value. } - -/** Wrapper for a single double precision floating point value. */ +/** + * Wrapper for a single double precision floating point value. + * + * @generated from protobuf message base.v1.DoubleValue + */ export interface DoubleValue { - /** The double value. */ - data: number; + /** + * @generated from protobuf field: double data = 1; + */ + data: number; // The double value. } - -/** Wrapper for a single boolean value. */ +/** + * Wrapper for a single boolean value. + * + * @generated from protobuf message base.v1.BooleanValue + */ export interface BooleanValue { - /** The boolean value. */ - data: boolean; + /** + * @generated from protobuf field: bool data = 1; + */ + data: boolean; // The boolean value. } - -/** Wrapper for an array of strings. */ +/** + * Wrapper for an array of strings. + * + * @generated from protobuf message base.v1.StringArrayValue + */ export interface StringArrayValue { - /** The array of strings. */ - data: string[]; + /** + * @generated from protobuf field: repeated string data = 1; + */ + data: string[]; // The array of strings. } - -/** Wrapper for an array of integers. */ +/** + * Wrapper for an array of integers. + * + * @generated from protobuf message base.v1.IntegerArrayValue + */ export interface IntegerArrayValue { - /** The array of integers. */ - data: number[]; + /** + * @generated from protobuf field: repeated int32 data = 1; + */ + data: number[]; // The array of integers. } - -/** Wrapper for an array of double precision floating point values. */ +/** + * Wrapper for an array of double precision floating point values. + * + * @generated from protobuf message base.v1.DoubleArrayValue + */ export interface DoubleArrayValue { - /** The array of doubles. */ - data: number[]; + /** + * @generated from protobuf field: repeated double data = 1; + */ + data: number[]; // The array of doubles. } - -/** Wrapper for an array of booleans. */ +/** + * Wrapper for an array of booleans. + * + * @generated from protobuf message base.v1.BooleanArrayValue + */ export interface BooleanArrayValue { - /** The array of booleans. */ - data: boolean[]; + /** + * @generated from protobuf field: repeated bool data = 1; + */ + data: boolean[]; // The array of booleans. } - /** * DataBundle is a message representing a bundle of data, which includes a name, * a list of arguments, and a series of operations. + * + * @generated from protobuf message base.v1.DataBundle */ 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[]; + /** + * 'name' is a simple string field representing the name of the DataBundle. + * + * @generated from protobuf field: string name = 1; + */ + 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. + * + * @generated from protobuf field: repeated string arguments = 2; + */ + arguments: string[]; + /** + * 'operations' is a repeated field containing multiple Operation messages. + * Each Operation represents a specific action or set of actions to be performed. + * + * @generated from protobuf field: repeated base.v1.Operation operations = 3; + */ + 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. + * + * @generated from protobuf message base.v1.Operation */ 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[]; + /** + * 'relationships_write' is a repeated string field for storing relationship keys + * that are to be written or created. + * + * @generated from protobuf field: repeated string relationships_write = 1 [json_name = "relationships_write"]; + */ + relationshipsWrite: string[]; + /** + * 'relationships_delete' is a repeated string field for storing relationship keys + * that are to be deleted or removed. + * + * @generated from protobuf field: repeated string relationships_delete = 2 [json_name = "relationships_delete"]; + */ + relationshipsDelete: string[]; + /** + * 'attributes_write' is a repeated string field for storing attribute keys + * that are to be written or created. + * + * @generated from protobuf field: repeated string attributes_write = 3 [json_name = "attributes_write"]; + */ + attributesWrite: string[]; + /** + * 'attributes_delete' is a repeated string field for storing attribute keys + * that are to be deleted or removed. + * + * @generated from protobuf field: repeated string attributes_delete = 4 [json_name = "attributes_delete"]; + */ + attributesDelete: string[]; } - -/** Partials contains the write, update and delete definitions */ +/** + * Partials contains the write, update and delete definitions + * + * @generated from protobuf message base.v1.Partials + */ export interface Partials { - write: string[]; - delete: string[]; - update: string[]; + /** + * @generated from protobuf field: repeated string write = 1; + */ + write: string[]; + /** + * @generated from protobuf field: repeated string delete = 2; + */ + delete: string[]; + /** + * @generated from protobuf field: repeated string update = 3; + */ + update: string[]; } - -function createBaseContext(): Context { - return { tuples: [], attributes: [], data: undefined }; +/** + * Enumerates results of a check operation. + * + * @generated from protobuf enum base.v1.CheckResult + */ +export enum CheckResult { + /** + * Not specified check result. This is the default value. + * + * @generated from protobuf enum value: CHECK_RESULT_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Represents a successful check (the check allowed the operation). + * + * @generated from protobuf enum value: CHECK_RESULT_ALLOWED = 1; + */ + ALLOWED = 1, + /** + * Represents a failed check (the check denied the operation). + * + * @generated from protobuf enum value: CHECK_RESULT_DENIED = 2; + */ + DENIED = 2 } - -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; +/** + * Enumerates the types of attribute. + * + * @generated from protobuf enum base.v1.AttributeType + */ +export enum AttributeType { + /** + * Not specified attribute type. This is the default value. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * A boolean attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_BOOLEAN = 1; + */ + BOOLEAN = 1, + /** + * A boolean array attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_BOOLEAN_ARRAY = 2; + */ + BOOLEAN_ARRAY = 2, + /** + * A string attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_STRING = 3; + */ + STRING = 3, + /** + * A string array attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_STRING_ARRAY = 4; + */ + STRING_ARRAY = 4, + /** + * An integer attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_INTEGER = 5; + */ + INTEGER = 5, + /** + * An integer array attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_INTEGER_ARRAY = 6; + */ + INTEGER_ARRAY = 6, + /** + * A double attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_DOUBLE = 7; + */ + DOUBLE = 7, + /** + * A double array attribute type. + * + * @generated from protobuf enum value: ATTRIBUTE_TYPE_DOUBLE_ARRAY = 8; + */ + DOUBLE_ARRAY = 8 +} +// @generated message type with reflection information, may provide speed optimized methods +class Context$Type extends MessageType { + constructor() { + super("base.v1.Context", [ + { no: 1, name: "tuples", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tuple }, + { no: 2, name: "attributes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Attribute }, + { no: 3, name: "data", kind: "message", T: () => Struct } + ]); + } + create(value?: PartialMessage): Context { + const message = { tuples: [], attributes: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Context): Context { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated base.v1.Tuple tuples */ 1: + message.tuples.push(Tuple.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated base.v1.Attribute attributes */ 2: + message.attributes.push(Attribute.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* google.protobuf.Struct data */ 3: + message.data = Struct.internalBinaryRead(reader, reader.uint32(), options, message.data); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: Context, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated base.v1.Tuple tuples = 1; */ + for (let i = 0; i < message.tuples.length; i++) + Tuple.internalBinaryWrite(message.tuples[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated base.v1.Attribute attributes = 2; */ + for (let i = 0; i < message.attributes.length; i++) + Attribute.internalBinaryWrite(message.attributes[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Struct data = 3; */ + if (message.data) + Struct.internalBinaryWrite(message.data, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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) }; +/** + * @generated MessageType for protobuf message base.v1.Context + */ +export const Context = new Context$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Child$Type extends MessageType { + constructor() { + super("base.v1.Child", [ + { no: 1, name: "leaf", kind: "message", oneof: "type", T: () => Leaf, options: { "validate.rules": { message: { required: true } } } }, + { no: 2, name: "rewrite", kind: "message", oneof: "type", T: () => Rewrite, options: { "validate.rules": { message: { required: true } } } } + ]); + } + create(value?: PartialMessage): Child { + const message = { type: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Child): Child { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Leaf leaf */ 1: + message.type = { + oneofKind: "leaf", + leaf: Leaf.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).leaf) + }; + break; + case /* base.v1.Rewrite rewrite */ 2: + message.type = { + oneofKind: "rewrite", + rewrite: Rewrite.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).rewrite) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } - } - return message; - }, -}; - -function createBaseLeaf(): Leaf { - return { type: undefined }; + return message; + } + internalBinaryWrite(message: Child, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Leaf leaf = 1; */ + if (message.type.oneofKind === "leaf") + Leaf.internalBinaryWrite(message.type.leaf, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Rewrite rewrite = 2; */ + if (message.type.oneofKind === "rewrite") + Rewrite.internalBinaryWrite(message.type.rewrite, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Child + */ +export const Child = new Child$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Leaf$Type extends MessageType { + constructor() { + super("base.v1.Leaf", [ + { no: 1, name: "computed_user_set", kind: "message", oneof: "type", T: () => ComputedUserSet, options: { "validate.rules": { message: { required: true } } } }, + { no: 2, name: "tuple_to_user_set", kind: "message", oneof: "type", T: () => TupleToUserSet, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "computed_attribute", kind: "message", oneof: "type", T: () => ComputedAttribute, options: { "validate.rules": { message: { required: true } } } }, + { no: 4, name: "call", kind: "message", oneof: "type", T: () => Call, options: { "validate.rules": { message: { required: true } } } } + ]); + } + create(value?: PartialMessage): Leaf { + const message = { type: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Leaf): Leaf { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.ComputedUserSet computed_user_set */ 1: + message.type = { + oneofKind: "computedUserSet", + computedUserSet: ComputedUserSet.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).computedUserSet) + }; + break; + case /* base.v1.TupleToUserSet tuple_to_user_set */ 2: + message.type = { + oneofKind: "tupleToUserSet", + tupleToUserSet: TupleToUserSet.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).tupleToUserSet) + }; + break; + case /* base.v1.ComputedAttribute computed_attribute */ 3: + message.type = { + oneofKind: "computedAttribute", + computedAttribute: ComputedAttribute.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).computedAttribute) + }; + break; + case /* base.v1.Call call */ 4: + message.type = { + oneofKind: "call", + call: Call.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).call) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 4: { - if (tag !== 34) { - break; - } - - message.type = { $case: "call", call: Call.decode(reader, reader.uint32()) }; - continue; + return message; + } + internalBinaryWrite(message: Leaf, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.ComputedUserSet computed_user_set = 1; */ + if (message.type.oneofKind === "computedUserSet") + ComputedUserSet.internalBinaryWrite(message.type.computedUserSet, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.TupleToUserSet tuple_to_user_set = 2; */ + if (message.type.oneofKind === "tupleToUserSet") + TupleToUserSet.internalBinaryWrite(message.type.tupleToUserSet, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.ComputedAttribute computed_attribute = 3; */ + if (message.type.oneofKind === "computedAttribute") + ComputedAttribute.internalBinaryWrite(message.type.computedAttribute, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Call call = 4; */ + if (message.type.oneofKind === "call") + Call.internalBinaryWrite(message.type.call, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message base.v1.Leaf + */ +export const Leaf = new Leaf$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Rewrite$Type extends MessageType { + constructor() { + super("base.v1.Rewrite", [ + { no: 1, name: "rewrite_operation", kind: "enum", T: () => ["base.v1.Rewrite.Operation", Rewrite_Operation, "OPERATION_"] }, + { no: 2, name: "children", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Child } + ]); + } + create(value?: PartialMessage): Rewrite { + const message = { rewriteOperation: 0, children: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Rewrite): Rewrite { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Rewrite.Operation rewrite_operation */ 1: + message.rewriteOperation = reader.int32(); + break; + case /* repeated base.v1.Child children */ 2: + message.children.push(Child.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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), - }; + return message; + } + internalBinaryWrite(message: Rewrite, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Rewrite.Operation rewrite_operation = 1; */ + if (message.rewriteOperation !== 0) + writer.tag(1, WireType.Varint).int32(message.rewriteOperation); + /* repeated base.v1.Child children = 2; */ + for (let i = 0; i < message.children.length; i++) + Child.internalBinaryWrite(message.children[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message base.v1.Rewrite + */ +export const Rewrite = new Rewrite$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaDefinition$Type extends MessageType { + constructor() { + super("base.v1.SchemaDefinition", [ + { no: 1, name: "entity_definitions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => EntityDefinition } }, + { no: 2, name: "rule_definitions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => RuleDefinition } }, + { no: 3, name: "references", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "enum", T: () => ["base.v1.SchemaDefinition.Reference", SchemaDefinition_Reference, "REFERENCE_"] } } + ]); + } + create(value?: PartialMessage): SchemaDefinition { + const message = { entityDefinitions: {}, ruleDefinitions: {}, references: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaDefinition): SchemaDefinition { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map entity_definitions */ 1: + this.binaryReadMap1(message.entityDefinitions, reader, options); + break; + case /* map rule_definitions */ 2: + this.binaryReadMap2(message.ruleDefinitions, reader, options); + break; + case /* map references */ 3: + this.binaryReadMap3(message.references, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } - case "tupleToUserSet": { - if (object.type?.tupleToUserSet !== undefined && object.type?.tupleToUserSet !== null) { - message.type = { - $case: "tupleToUserSet", - tupleToUserSet: TupleToUserSet.fromPartial(object.type.tupleToUserSet), - }; + return message; + } + private binaryReadMap1(map: SchemaDefinition["entityDefinitions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SchemaDefinition["entityDefinitions"] | undefined, val: SchemaDefinition["entityDefinitions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = EntityDefinition.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.SchemaDefinition.entity_definitions"); + } } - break; - } - case "computedAttribute": { - if (object.type?.computedAttribute !== undefined && object.type?.computedAttribute !== null) { - message.type = { - $case: "computedAttribute", - computedAttribute: ComputedAttribute.fromPartial(object.type.computedAttribute), - }; + map[key ?? ""] = val ?? EntityDefinition.create(); + } + private binaryReadMap2(map: SchemaDefinition["ruleDefinitions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SchemaDefinition["ruleDefinitions"] | undefined, val: SchemaDefinition["ruleDefinitions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = RuleDefinition.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.SchemaDefinition.rule_definitions"); + } } - break; - } - case "call": { - if (object.type?.call !== undefined && object.type?.call !== null) { - message.type = { $case: "call", call: Call.fromPartial(object.type.call) }; + map[key ?? ""] = val ?? RuleDefinition.create(); + } + private binaryReadMap3(map: SchemaDefinition["references"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SchemaDefinition["references"] | undefined, val: SchemaDefinition["references"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.int32(); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.SchemaDefinition.references"); + } } - 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; + map[key ?? ""] = val ?? 0; + } + internalBinaryWrite(message: SchemaDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map entity_definitions = 1; */ + for (let k of Object.keys(message.entityDefinitions)) { + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + EntityDefinition.internalBinaryWrite(message.entityDefinitions[k], writer, options); + writer.join().join(); } - case 2: { - if (tag !== 18) { - break; - } - - message.children.push(Child.decode(reader, reader.uint32())); - continue; + /* map rule_definitions = 2; */ + for (let k of Object.keys(message.ruleDefinitions)) { + writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + RuleDefinition.internalBinaryWrite(message.ruleDefinitions[k], writer, options); + writer.join().join(); } - } - 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: {} }; + /* map references = 3; */ + for (let k of Object.keys(message.references)) + writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int32(message.references[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.SchemaDefinition + */ +export const SchemaDefinition = new SchemaDefinition$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EntityDefinition$Type extends MessageType { + constructor() { + super("base.v1.EntityDefinition", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "relations", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => RelationDefinition } }, + { no: 3, name: "permissions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => PermissionDefinition } }, + { no: 4, name: "attributes", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => AttributeDefinition } }, + { no: 5, name: "references", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "enum", T: () => ["base.v1.EntityDefinition.Reference", EntityDefinition_Reference, "REFERENCE_"] } } + ]); + } + create(value?: PartialMessage): EntityDefinition { + const message = { name: "", relations: {}, permissions: {}, attributes: {}, references: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EntityDefinition): EntityDefinition { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* map relations */ 2: + this.binaryReadMap2(message.relations, reader, options); + break; + case /* map permissions */ 3: + this.binaryReadMap3(message.permissions, reader, options); + break; + case /* map attributes */ 4: + this.binaryReadMap4(message.attributes, reader, options); + break; + case /* map references */ 5: + this.binaryReadMap5(message.references, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - 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; + return message; + } + private binaryReadMap2(map: EntityDefinition["relations"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof EntityDefinition["relations"] | undefined, val: EntityDefinition["relations"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = RelationDefinition.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.EntityDefinition.relations"); + } } - 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; + map[key ?? ""] = val ?? RelationDefinition.create(); + } + private binaryReadMap3(map: EntityDefinition["permissions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof EntityDefinition["permissions"] | undefined, val: EntityDefinition["permissions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = PermissionDefinition.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.EntityDefinition.permissions"); + } } - } - 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); + map[key ?? ""] = val ?? PermissionDefinition.create(); + } + private binaryReadMap4(map: EntityDefinition["attributes"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof EntityDefinition["attributes"] | undefined, val: EntityDefinition["attributes"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = AttributeDefinition.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.EntityDefinition.attributes"); + } } - 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; + map[key ?? ""] = val ?? AttributeDefinition.create(); + } + private binaryReadMap5(map: EntityDefinition["references"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof EntityDefinition["references"] | undefined, val: EntityDefinition["references"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.int32(); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.EntityDefinition.references"); + } } - return acc; - }, - {}, - ); - return message; - }, -}; - -function createBaseSchemaDefinition_EntityDefinitionsEntry(): SchemaDefinition_EntityDefinitionsEntry { - return { key: "", value: undefined }; + map[key ?? ""] = val ?? 0; + } + internalBinaryWrite(message: EntityDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* map relations = 2; */ + for (let k of Object.keys(message.relations)) { + writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + RelationDefinition.internalBinaryWrite(message.relations[k], writer, options); + writer.join().join(); + } + /* map permissions = 3; */ + for (let k of Object.keys(message.permissions)) { + writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + PermissionDefinition.internalBinaryWrite(message.permissions[k], writer, options); + writer.join().join(); + } + /* map attributes = 4; */ + for (let k of Object.keys(message.attributes)) { + writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + AttributeDefinition.internalBinaryWrite(message.attributes[k], writer, options); + writer.join().join(); + } + /* map references = 5; */ + for (let k of Object.keys(message.references)) + writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int32(message.references[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.EntityDefinition + */ +export const EntityDefinition = new EntityDefinition$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RuleDefinition$Type extends MessageType { + constructor() { + super("base.v1.RuleDefinition", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "arguments", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "enum", T: () => ["base.v1.AttributeType", AttributeType, "ATTRIBUTE_TYPE_"] } }, + { no: 3, name: "expression", kind: "message", T: () => CheckedExpr } + ]); + } + create(value?: PartialMessage): RuleDefinition { + const message = { name: "", arguments: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RuleDefinition): RuleDefinition { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* map arguments */ 2: + this.binaryReadMap2(message.arguments, reader, options); + break; + case /* google.api.expr.v1alpha1.CheckedExpr expression */ 3: + message.expression = CheckedExpr.internalBinaryRead(reader, reader.uint32(), options, message.expression); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 2: { - if (tag !== 18) { - break; - } - - message.value = EntityDefinition.decode(reader, reader.uint32()); - continue; + return message; + } + private binaryReadMap2(map: RuleDefinition["arguments"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof RuleDefinition["arguments"] | undefined, val: RuleDefinition["arguments"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.int32(); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.RuleDefinition.arguments"); + } } - } - 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 }; + map[key ?? ""] = val ?? 0; + } + internalBinaryWrite(message: RuleDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* map arguments = 2; */ + for (let k of Object.keys(message.arguments)) + writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int32(message.arguments[k]).join(); + /* google.api.expr.v1alpha1.CheckedExpr expression = 3; */ + if (message.expression) + CheckedExpr.internalBinaryWrite(message.expression, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.RuleDefinition + */ +export const RuleDefinition = new RuleDefinition$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AttributeDefinition$Type extends MessageType { + constructor() { + super("base.v1.AttributeDefinition", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "type", kind: "enum", T: () => ["base.v1.AttributeType", AttributeType, "ATTRIBUTE_TYPE_"] } + ]); + } + create(value?: PartialMessage): AttributeDefinition { + const message = { name: "", type: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AttributeDefinition): AttributeDefinition { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* base.v1.AttributeType type */ 2: + message.type = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: AttributeDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* base.v1.AttributeType type = 2; */ + if (message.type !== 0) + writer.tag(2, WireType.Varint).int32(message.type); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.AttributeDefinition + */ +export const AttributeDefinition = new AttributeDefinition$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationDefinition$Type extends MessageType { + constructor() { + super("base.v1.RelationDefinition", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "relation_references", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RelationReference } + ]); + } + create(value?: PartialMessage): RelationDefinition { + const message = { name: "", relationReferences: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationDefinition): RelationDefinition { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* repeated base.v1.RelationReference relation_references */ 2: + message.relationReferences.push(RelationReference.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: {} }; + return message; + } + internalBinaryWrite(message: RelationDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated base.v1.RelationReference relation_references = 2; */ + for (let i = 0; i < message.relationReferences.length; i++) + RelationReference.internalBinaryWrite(message.relationReferences[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.RelationDefinition + */ +export const RelationDefinition = new RelationDefinition$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionDefinition$Type extends MessageType { + constructor() { + super("base.v1.PermissionDefinition", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "child", kind: "message", T: () => Child } + ]); + } + create(value?: PartialMessage): PermissionDefinition { + const message = { name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionDefinition): PermissionDefinition { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* base.v1.Child child */ 2: + message.child = Child.internalBinaryRead(reader, reader.uint32(), options, message.child); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - return acc; - }, - {}, - ); - return message; - }, -}; - -function createBaseEntityDefinition_RelationsEntry(): EntityDefinition_RelationsEntry { - return { key: "", value: undefined }; + return message; + } + internalBinaryWrite(message: PermissionDefinition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* base.v1.Child child = 2; */ + if (message.child) + Child.internalBinaryWrite(message.child, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.PermissionDefinition + */ +export const PermissionDefinition = new PermissionDefinition$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationReference$Type extends MessageType { + constructor() { + super("base.v1.RelationReference", [ + { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): RelationReference { + const message = { type: "", relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationReference): RelationReference { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string type */ 1: + message.type = reader.string(); + break; + case /* string relation */ 2: + message.relation = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: RelationReference, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string type = 1; */ + if (message.type !== "") + writer.tag(1, WireType.LengthDelimited).string(message.type); + /* string relation = 2; */ + if (message.relation !== "") + writer.tag(2, WireType.LengthDelimited).string(message.relation); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.RelationReference + */ +export const RelationReference = new RelationReference$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Entrance$Type extends MessageType { + constructor() { + super("base.v1.Entrance", [ + { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "value", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } } + ]); + } + create(value?: PartialMessage): Entrance { + const message = { type: "", value: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Entrance): Entrance { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string type */ 1: + message.type = reader.string(); + break; + case /* string value */ 2: + message.value = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: Entrance, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string type = 1; */ + if (message.type !== "") + writer.tag(1, WireType.LengthDelimited).string(message.type); + /* string value = 2; */ + if (message.value !== "") + writer.tag(2, WireType.LengthDelimited).string(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Entrance + */ +export const Entrance = new Entrance$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Argument$Type extends MessageType { + constructor() { + super("base.v1.Argument", [ + { no: 1, name: "computed_attribute", kind: "message", oneof: "type", T: () => ComputedAttribute } + ]); + } + create(value?: PartialMessage): Argument { + const message = { type: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Argument): Argument { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.ComputedAttribute computed_attribute */ 1: + message.type = { + oneofKind: "computedAttribute", + computedAttribute: ComputedAttribute.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).computedAttribute) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: Argument, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.ComputedAttribute computed_attribute = 1; */ + if (message.type.oneofKind === "computedAttribute") + ComputedAttribute.internalBinaryWrite(message.type.computedAttribute, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Argument + */ +export const Argument = new Argument$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Call$Type extends MessageType { + constructor() { + super("base.v1.Call", [ + { no: 1, name: "rule_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "arguments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Argument } + ]); + } + create(value?: PartialMessage): Call { + const message = { ruleName: "", arguments: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Call): Call { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string rule_name */ 1: + message.ruleName = reader.string(); + break; + case /* repeated base.v1.Argument arguments */ 2: + message.arguments.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: Call, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string rule_name = 1; */ + if (message.ruleName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.ruleName); + /* repeated base.v1.Argument arguments = 2; */ + for (let i = 0; i < message.arguments.length; i++) + Argument.internalBinaryWrite(message.arguments[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Call + */ +export const Call = new Call$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ComputedAttribute$Type extends MessageType { + constructor() { + super("base.v1.ComputedAttribute", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } } + ]); + } + create(value?: PartialMessage): ComputedAttribute { + const message = { name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ComputedAttribute): ComputedAttribute { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: ComputedAttribute, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.ComputedAttribute + */ +export const ComputedAttribute = new ComputedAttribute$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ComputedUserSet$Type extends MessageType { + constructor() { + super("base.v1.ComputedUserSet", [ + { no: 1, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } } + ]); + } + create(value?: PartialMessage): ComputedUserSet { + const message = { relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ComputedUserSet): ComputedUserSet { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string relation */ 1: + message.relation = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: ComputedUserSet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string relation = 1; */ + if (message.relation !== "") + writer.tag(1, WireType.LengthDelimited).string(message.relation); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.ComputedUserSet + */ +export const ComputedUserSet = new ComputedUserSet$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TupleToUserSet$Type extends MessageType { + constructor() { + super("base.v1.TupleToUserSet", [ + { no: 1, name: "tupleSet", kind: "message", T: () => TupleSet }, + { no: 2, name: "computed", kind: "message", T: () => ComputedUserSet } + ]); + } + create(value?: PartialMessage): TupleToUserSet { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TupleToUserSet): TupleToUserSet { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.TupleSet tupleSet */ 1: + message.tupleSet = TupleSet.internalBinaryRead(reader, reader.uint32(), options, message.tupleSet); + break; + case /* base.v1.ComputedUserSet computed */ 2: + message.computed = ComputedUserSet.internalBinaryRead(reader, reader.uint32(), options, message.computed); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: TupleToUserSet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.TupleSet tupleSet = 1; */ + if (message.tupleSet) + TupleSet.internalBinaryWrite(message.tupleSet, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.ComputedUserSet computed = 2; */ + if (message.computed) + ComputedUserSet.internalBinaryWrite(message.computed, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.TupleToUserSet + */ +export const TupleToUserSet = new TupleToUserSet$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TupleSet$Type extends MessageType { + constructor() { + super("base.v1.TupleSet", [ + { no: 1, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } } + ]); + } + create(value?: PartialMessage): TupleSet { + const message = { relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TupleSet): TupleSet { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string relation */ 1: + message.relation = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: TupleSet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string relation = 1; */ + if (message.relation !== "") + writer.tag(1, WireType.LengthDelimited).string(message.relation); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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), - }; +/** + * @generated MessageType for protobuf message base.v1.TupleSet + */ +export const TupleSet = new TupleSet$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Tuple$Type extends MessageType { + constructor() { + super("base.v1.Tuple", [ + { no: 1, name: "entity", kind: "message", T: () => Entity, options: { "validate.rules": { message: { required: true } } } }, + { no: 2, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 3, name: "subject", kind: "message", T: () => Subject, options: { "validate.rules": { message: { required: true } } } } + ]); + } + create(value?: PartialMessage): Tuple { + const message = { relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Tuple): Tuple { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Entity entity */ 1: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string relation */ 2: + message.relation = reader.string(); + break; + case /* base.v1.Subject subject */ 3: + message.subject = Subject.internalBinaryRead(reader, reader.uint32(), options, message.subject); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } - } - return message; - }, -}; - -function createBaseCall(): Call { - return { ruleName: "", arguments: [] }; + return message; + } + internalBinaryWrite(message: Tuple, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Entity entity = 1; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string relation = 2; */ + if (message.relation !== "") + writer.tag(2, WireType.LengthDelimited).string(message.relation); + /* base.v1.Subject subject = 3; */ + if (message.subject) + Subject.internalBinaryWrite(message.subject, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Tuple + */ +export const Tuple = new Tuple$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Attribute$Type extends MessageType { + constructor() { + super("base.v1.Attribute", [ + { no: 1, name: "entity", kind: "message", T: () => Entity, options: { "validate.rules": { message: { required: true } } } }, + { no: 2, name: "attribute", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "value", kind: "message", T: () => Any } + ]); + } + create(value?: PartialMessage): Attribute { + const message = { attribute: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Attribute): Attribute { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Entity entity */ 1: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string attribute */ 2: + message.attribute = reader.string(); + break; + case /* google.protobuf.Any value */ 3: + message.value = Any.internalBinaryRead(reader, reader.uint32(), options, message.value); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: Attribute, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Entity entity = 1; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string attribute = 2; */ + if (message.attribute !== "") + writer.tag(2, WireType.LengthDelimited).string(message.attribute); + /* google.protobuf.Any value = 3; */ + if (message.value) + Any.internalBinaryWrite(message.value, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Attribute + */ +export const Attribute = new Attribute$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Tuples$Type extends MessageType { + constructor() { + super("base.v1.Tuples", [ + { no: 1, name: "tuples", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tuple } + ]); + } + create(value?: PartialMessage): Tuples { + const message = { tuples: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Tuples): Tuples { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated base.v1.Tuple tuples */ 1: + message.tuples.push(Tuple.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: Tuples, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated base.v1.Tuple tuples = 1; */ + for (let i = 0; i < message.tuples.length; i++) + Tuple.internalBinaryWrite(message.tuples[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Tuples + */ +export const Tuples = new Tuples$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Attributes$Type extends MessageType { + constructor() { + super("base.v1.Attributes", [ + { no: 1, name: "attributes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Attribute } + ]); + } + create(value?: PartialMessage): Attributes { + const message = { attributes: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Attributes): Attributes { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated base.v1.Attribute attributes */ 1: + message.attributes.push(Attribute.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: Attributes, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated base.v1.Attribute attributes = 1; */ + for (let i = 0; i < message.attributes.length; i++) + Attribute.internalBinaryWrite(message.attributes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Attributes + */ +export const Attributes = new Attributes$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Entity$Type extends MessageType { + constructor() { + super("base.v1.Entity", [ + { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$" } } } } + ]); + } + create(value?: PartialMessage): Entity { + const message = { type: "", id: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Entity): Entity { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string type */ 1: + message.type = reader.string(); + break; + case /* string id */ 2: + message.id = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: Entity, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string type = 1; */ + if (message.type !== "") + writer.tag(1, WireType.LengthDelimited).string(message.type); + /* string id = 2; */ + if (message.id !== "") + writer.tag(2, WireType.LengthDelimited).string(message.id); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Entity + */ +export const Entity = new Entity$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EntityAndRelation$Type extends MessageType { + constructor() { + super("base.v1.EntityAndRelation", [ + { no: 1, name: "entity", kind: "message", T: () => Entity, options: { "validate.rules": { message: { required: true } } } }, + { no: 2, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } } + ]); + } + create(value?: PartialMessage): EntityAndRelation { + const message = { relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EntityAndRelation): EntityAndRelation { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Entity entity */ 1: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string relation */ 2: + message.relation = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: EntityAndRelation, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Entity entity = 1; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string relation = 2; */ + if (message.relation !== "") + writer.tag(2, WireType.LengthDelimited).string(message.relation); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.EntityAndRelation + */ +export const EntityAndRelation = new EntityAndRelation$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Subject$Type extends MessageType { + constructor() { + super("base.v1.Subject", [ + { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$" } } } }, + { no: 2, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$" } } } }, + { no: 3, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): Subject { + const message = { type: "", id: "", relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Subject): Subject { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string type */ 1: + message.type = reader.string(); + break; + case /* string id */ 2: + message.id = reader.string(); + break; + case /* string relation */ 3: + message.relation = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: Subject, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string type = 1; */ + if (message.type !== "") + writer.tag(1, WireType.LengthDelimited).string(message.type); + /* string id = 2; */ + if (message.id !== "") + writer.tag(2, WireType.LengthDelimited).string(message.id); + /* string relation = 3; */ + if (message.relation !== "") + writer.tag(3, WireType.LengthDelimited).string(message.relation); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Subject + */ +export const Subject = new Subject$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AttributeFilter$Type extends MessageType { + constructor() { + super("base.v1.AttributeFilter", [ + { no: 1, name: "entity", kind: "message", T: () => EntityFilter }, + { no: 2, name: "attributes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): AttributeFilter { + const message = { attributes: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AttributeFilter): AttributeFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.EntityFilter entity */ 1: + message.entity = EntityFilter.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* repeated string attributes */ 2: + message.attributes.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: [] }; + return message; + } + internalBinaryWrite(message: AttributeFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.EntityFilter entity = 1; */ + if (message.entity) + EntityFilter.internalBinaryWrite(message.entity, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated string attributes = 2; */ + for (let i = 0; i < message.attributes.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.attributes[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.AttributeFilter + */ +export const AttributeFilter = new AttributeFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TupleFilter$Type extends MessageType { + constructor() { + super("base.v1.TupleFilter", [ + { no: 1, name: "entity", kind: "message", T: () => EntityFilter }, + { no: 2, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: true } } } }, + { no: 3, name: "subject", kind: "message", T: () => SubjectFilter } + ]); + } + create(value?: PartialMessage): TupleFilter { + const message = { relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TupleFilter): TupleFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.EntityFilter entity */ 1: + message.entity = EntityFilter.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string relation */ 2: + message.relation = reader.string(); + break; + case /* base.v1.SubjectFilter subject */ 3: + message.subject = SubjectFilter.internalBinaryRead(reader, reader.uint32(), options, message.subject); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: [] }; + return message; + } + internalBinaryWrite(message: TupleFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.EntityFilter entity = 1; */ + if (message.entity) + EntityFilter.internalBinaryWrite(message.entity, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string relation = 2; */ + if (message.relation !== "") + writer.tag(2, WireType.LengthDelimited).string(message.relation); + /* base.v1.SubjectFilter subject = 3; */ + if (message.subject) + SubjectFilter.internalBinaryWrite(message.subject, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.TupleFilter + */ +export const TupleFilter = new TupleFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EntityFilter$Type extends MessageType { + constructor() { + super("base.v1.EntityFilter", [ + { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): EntityFilter { + const message = { type: "", ids: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EntityFilter): EntityFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string type */ 1: + message.type = reader.string(); + break; + case /* repeated string ids */ 2: + message.ids.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: EntityFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string type = 1; */ + if (message.type !== "") + writer.tag(1, WireType.LengthDelimited).string(message.type); + /* repeated string ids = 2; */ + for (let i = 0; i < message.ids.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.ids[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.EntityFilter + */ +export const EntityFilter = new EntityFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SubjectFilter$Type extends MessageType { + constructor() { + super("base.v1.SubjectFilter", [ + { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "ids", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "relation", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): SubjectFilter { + const message = { type: "", ids: [], relation: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SubjectFilter): SubjectFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string type */ 1: + message.type = reader.string(); + break; + case /* repeated string ids */ 2: + message.ids.push(reader.string()); + break; + case /* string relation */ 3: + message.relation = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: SubjectFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string type = 1; */ + if (message.type !== "") + writer.tag(1, WireType.LengthDelimited).string(message.type); + /* repeated string ids = 2; */ + for (let i = 0; i < message.ids.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.ids[i]); + /* string relation = 3; */ + if (message.relation !== "") + writer.tag(3, WireType.LengthDelimited).string(message.relation); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.SubjectFilter + */ +export const SubjectFilter = new SubjectFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExpandTreeNode$Type extends MessageType { + constructor() { + super("base.v1.ExpandTreeNode", [ + { no: 1, name: "operation", kind: "enum", T: () => ["base.v1.ExpandTreeNode.Operation", ExpandTreeNode_Operation, "OPERATION_"] }, + { no: 2, name: "children", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Expand } + ]); + } + create(value?: PartialMessage): ExpandTreeNode { + const message = { operation: 0, children: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExpandTreeNode): ExpandTreeNode { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.ExpandTreeNode.Operation operation */ 1: + message.operation = reader.int32(); + break; + case /* repeated base.v1.Expand children */ 2: + message.children.push(Expand.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: "" }; + return message; + } + internalBinaryWrite(message: ExpandTreeNode, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.ExpandTreeNode.Operation operation = 1; */ + if (message.operation !== 0) + writer.tag(1, WireType.Varint).int32(message.operation); + /* repeated base.v1.Expand children = 2; */ + for (let i = 0; i < message.children.length; i++) + Expand.internalBinaryWrite(message.children[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.ExpandTreeNode + */ +export const ExpandTreeNode = new ExpandTreeNode$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expand$Type extends MessageType { + constructor() { + super("base.v1.Expand", [ + { no: 1, name: "entity", kind: "message", T: () => Entity }, + { no: 2, name: "permission", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "arguments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Argument }, + { no: 4, name: "expand", kind: "message", oneof: "node", T: () => ExpandTreeNode }, + { no: 5, name: "leaf", kind: "message", oneof: "node", T: () => ExpandLeaf } + ]); + } + create(value?: PartialMessage): Expand { + const message = { permission: "", arguments: [], node: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expand): Expand { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Entity entity */ 1: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string permission */ 2: + message.permission = reader.string(); + break; + case /* repeated base.v1.Argument arguments */ 3: + message.arguments.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* base.v1.ExpandTreeNode expand */ 4: + message.node = { + oneofKind: "expand", + expand: ExpandTreeNode.internalBinaryRead(reader, reader.uint32(), options, (message.node as any).expand) + }; + break; + case /* base.v1.ExpandLeaf leaf */ 5: + message.node = { + oneofKind: "leaf", + leaf: ExpandLeaf.internalBinaryRead(reader, reader.uint32(), options, (message.node as any).leaf) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: [] }; + return message; + } + internalBinaryWrite(message: Expand, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Entity entity = 1; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string permission = 2; */ + if (message.permission !== "") + writer.tag(2, WireType.LengthDelimited).string(message.permission); + /* repeated base.v1.Argument arguments = 3; */ + for (let i = 0; i < message.arguments.length; i++) + Argument.internalBinaryWrite(message.arguments[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.ExpandTreeNode expand = 4; */ + if (message.node.oneofKind === "expand") + ExpandTreeNode.internalBinaryWrite(message.node.expand, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.ExpandLeaf leaf = 5; */ + if (message.node.oneofKind === "leaf") + ExpandLeaf.internalBinaryWrite(message.node.leaf, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Expand + */ +export const Expand = new Expand$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExpandLeaf$Type extends MessageType { + constructor() { + super("base.v1.ExpandLeaf", [ + { no: 1, name: "subjects", kind: "message", oneof: "type", T: () => Subjects }, + { no: 2, name: "values", kind: "message", oneof: "type", T: () => Values }, + { no: 3, name: "value", kind: "message", oneof: "type", T: () => Any } + ]); + } + create(value?: PartialMessage): ExpandLeaf { + const message = { type: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExpandLeaf): ExpandLeaf { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Subjects subjects */ 1: + message.type = { + oneofKind: "subjects", + subjects: Subjects.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).subjects) + }; + break; + case /* base.v1.Values values */ 2: + message.type = { + oneofKind: "values", + values: Values.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).values) + }; + break; + case /* google.protobuf.Any value */ 3: + message.type = { + oneofKind: "value", + value: Any.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).value) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: ExpandLeaf, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Subjects subjects = 1; */ + if (message.type.oneofKind === "subjects") + Subjects.internalBinaryWrite(message.type.subjects, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Values values = 2; */ + if (message.type.oneofKind === "values") + Values.internalBinaryWrite(message.type.values, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Any value = 3; */ + if (message.type.oneofKind === "value") + Any.internalBinaryWrite(message.type.value, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.ExpandLeaf + */ +export const ExpandLeaf = new ExpandLeaf$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Values$Type extends MessageType { + constructor() { + super("base.v1.Values", [ + { no: 1, name: "values", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Any } } + ]); + } + create(value?: PartialMessage): Values { + const message = { values: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Values): Values { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map values */ 1: + this.binaryReadMap1(message.values, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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; + return message; + } + private binaryReadMap1(map: Values["values"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Values["values"] | undefined, val: Values["values"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Any.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.Values.values"); + } } - case 2: { - if (tag !== 18) { - break; - } - - message.ids.push(reader.string()); - continue; + map[key ?? ""] = val ?? Any.create(); + } + internalBinaryWrite(message: Values, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map values = 1; */ + for (let k of Object.keys(message.values)) { + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Any.internalBinaryWrite(message.values[k], writer, options); + writer.join().join(); } - } - 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: "" }; + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Values + */ +export const Values = new Values$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Subjects$Type extends MessageType { + constructor() { + super("base.v1.Subjects", [ + { no: 1, name: "subjects", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Subject } + ]); + } + create(value?: PartialMessage): Subjects { + const message = { subjects: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Subjects): Subjects { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated base.v1.Subject subjects */ 1: + message.subjects.push(Subject.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: [] }; + return message; + } + internalBinaryWrite(message: Subjects, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated base.v1.Subject subjects = 1; */ + for (let i = 0; i < message.subjects.length; i++) + Subject.internalBinaryWrite(message.subjects[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.Subjects + */ +export const Subjects = new Subjects$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Tenant$Type extends MessageType { + constructor() { + super("base.v1.Tenant", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "created_at", kind: "message", jsonName: "created_at", T: () => Timestamp } + ]); + } + create(value?: PartialMessage): Tenant { + const message = { id: "", name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Tenant): Tenant { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + case /* google.protobuf.Timestamp created_at = 3 [json_name = "created_at"];*/ 3: + message.createdAt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.createdAt); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: Tenant, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + /* google.protobuf.Timestamp created_at = 3 [json_name = "created_at"]; */ + if (message.createdAt) + Timestamp.internalBinaryWrite(message.createdAt, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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) }; +/** + * @generated MessageType for protobuf message base.v1.Tenant + */ +export const Tenant = new Tenant$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataChanges$Type extends MessageType { + constructor() { + super("base.v1.DataChanges", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "data_changes", kind: "message", jsonName: "data_changes", repeat: 1 /*RepeatType.PACKED*/, T: () => DataChange } + ]); + } + create(value?: PartialMessage): DataChanges { + const message = { snapToken: "", dataChanges: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataChanges): DataChanges { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + case /* repeated base.v1.DataChange data_changes = 2 [json_name = "data_changes"];*/ 2: + message.dataChanges.push(DataChange.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } - } - return message; - }, -}; - -function createBaseExpandLeaf(): ExpandLeaf { - return { type: undefined }; + return message; + } + internalBinaryWrite(message: DataChanges, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + /* repeated base.v1.DataChange data_changes = 2 [json_name = "data_changes"]; */ + for (let i = 0; i < message.dataChanges.length; i++) + DataChange.internalBinaryWrite(message.dataChanges[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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) }; +/** + * @generated MessageType for protobuf message base.v1.DataChanges + */ +export const DataChanges = new DataChanges$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataChange$Type extends MessageType { + constructor() { + super("base.v1.DataChange", [ + { no: 1, name: "operation", kind: "enum", T: () => ["base.v1.DataChange.Operation", DataChange_Operation, "OPERATION_"] }, + { no: 2, name: "tuple", kind: "message", oneof: "type", T: () => Tuple }, + { no: 3, name: "attribute", kind: "message", oneof: "type", T: () => Attribute } + ]); + } + create(value?: PartialMessage): DataChange { + const message = { operation: 0, type: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataChange): DataChange { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.DataChange.Operation operation */ 1: + message.operation = reader.int32(); + break; + case /* base.v1.Tuple tuple */ 2: + message.type = { + oneofKind: "tuple", + tuple: Tuple.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).tuple) + }; + break; + case /* base.v1.Attribute attribute */ 3: + message.type = { + oneofKind: "attribute", + attribute: Attribute.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).attribute) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } - } - return message; - }, -}; - -function createBaseValues(): Values { - return { values: {} }; + return message; + } + internalBinaryWrite(message: DataChange, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.DataChange.Operation operation = 1; */ + if (message.operation !== 0) + writer.tag(1, WireType.Varint).int32(message.operation); + /* base.v1.Tuple tuple = 2; */ + if (message.type.oneofKind === "tuple") + Tuple.internalBinaryWrite(message.type.tuple, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Attribute attribute = 3; */ + if (message.type.oneofKind === "attribute") + Attribute.internalBinaryWrite(message.type.attribute, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.DataChange + */ +export const DataChange = new DataChange$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StringValue$Type extends MessageType { + constructor() { + super("base.v1.StringValue", [ + { no: 1, name: "data", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): StringValue { + const message = { data: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringValue): StringValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string data */ 1: + message.data = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: StringValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string data = 1; */ + if (message.data !== "") + writer.tag(1, WireType.LengthDelimited).string(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.StringValue + */ +export const StringValue = new StringValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class IntegerValue$Type extends MessageType { + constructor() { + super("base.v1.IntegerValue", [ + { no: 1, name: "data", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): IntegerValue { + const message = { data: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: IntegerValue): IntegerValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 data */ 1: + message.data = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: [] }; + return message; + } + internalBinaryWrite(message: IntegerValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int32 data = 1; */ + if (message.data !== 0) + writer.tag(1, WireType.Varint).int32(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.IntegerValue + */ +export const IntegerValue = new IntegerValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DoubleValue$Type extends MessageType { + constructor() { + super("base.v1.DoubleValue", [ + { no: 1, name: "data", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): DoubleValue { + const message = { data: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DoubleValue): DoubleValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* double data */ 1: + message.data = reader.double(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: DoubleValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* double data = 1; */ + if (message.data !== 0) + writer.tag(1, WireType.Bit64).double(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.DoubleValue + */ +export const DoubleValue = new DoubleValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BooleanValue$Type extends MessageType { + constructor() { + super("base.v1.BooleanValue", [ + { no: 1, name: "data", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): BooleanValue { + const message = { data: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BooleanValue): BooleanValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool data */ 1: + message.data = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: [] }; + return message; + } + internalBinaryWrite(message: BooleanValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool data = 1; */ + if (message.data !== false) + writer.tag(1, WireType.Varint).bool(message.data); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.BooleanValue + */ +export const BooleanValue = new BooleanValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StringArrayValue$Type extends MessageType { + constructor() { + super("base.v1.StringArrayValue", [ + { no: 1, name: "data", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): StringArrayValue { + const message = { data: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringArrayValue): StringArrayValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string data */ 1: + message.data.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 }; + return message; + } + internalBinaryWrite(message: StringArrayValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string data = 1; */ + for (let i = 0; i < message.data.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.data[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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) }; +/** + * @generated MessageType for protobuf message base.v1.StringArrayValue + */ +export const StringArrayValue = new StringArrayValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class IntegerArrayValue$Type extends MessageType { + constructor() { + super("base.v1.IntegerArrayValue", [ + { no: 1, name: "data", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): IntegerArrayValue { + const message = { data: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: IntegerArrayValue): IntegerArrayValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated int32 data */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.data.push(reader.int32()); + else + message.data.push(reader.int32()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - 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; + return message; + } + internalBinaryWrite(message: IntegerArrayValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated int32 data = 1; */ + if (message.data.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.data.length; i++) + writer.int32(message.data[i]); + writer.join(); } - } - 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 }; + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.IntegerArrayValue + */ +export const IntegerArrayValue = new IntegerArrayValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DoubleArrayValue$Type extends MessageType { + constructor() { + super("base.v1.DoubleArrayValue", [ + { no: 1, name: "data", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 1 /*ScalarType.DOUBLE*/ } + ]); + } + create(value?: PartialMessage): DoubleArrayValue { + const message = { data: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DoubleArrayValue): DoubleArrayValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated double data */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.data.push(reader.double()); + else + message.data.push(reader.double()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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; + return message; + } + internalBinaryWrite(message: DoubleArrayValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated double data = 1; */ + if (message.data.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.data.length; i++) + writer.double(message.data[i]); + writer.join(); } - } - 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 }; + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.DoubleArrayValue + */ +export const DoubleArrayValue = new DoubleArrayValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BooleanArrayValue$Type extends MessageType { + constructor() { + super("base.v1.BooleanArrayValue", [ + { no: 1, name: "data", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): BooleanArrayValue { + const message = { data: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BooleanArrayValue): BooleanArrayValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated bool data */ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.data.push(reader.bool()); + else + message.data.push(reader.bool()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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; + return message; + } + internalBinaryWrite(message: BooleanArrayValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated bool data = 1; */ + if (message.data.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.data.length; i++) + writer.bool(message.data[i]); + writer.join(); } - } - 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: [] }; + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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()); +/** + * @generated MessageType for protobuf message base.v1.BooleanArrayValue + */ +export const BooleanArrayValue = new BooleanArrayValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataBundle$Type extends MessageType { + constructor() { + super("base.v1.DataBundle", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "arguments", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "operations", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Operation } + ]); + } + create(value?: PartialMessage): DataBundle { + const message = { name: "", arguments: [], operations: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataBundle): DataBundle { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* repeated string arguments */ 2: + message.arguments.push(reader.string()); + break; + case /* repeated base.v1.Operation operations */ 3: + message.operations.push(Operation.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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: [] }; + return message; + } + internalBinaryWrite(message: DataBundle, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated string arguments = 2; */ + for (let i = 0; i < message.arguments.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.arguments[i]); + /* repeated base.v1.Operation operations = 3; */ + for (let i = 0; i < message.operations.length; i++) + Operation.internalBinaryWrite(message.operations[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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()); +/** + * @generated MessageType for protobuf message base.v1.DataBundle + */ +export const DataBundle = new DataBundle$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Operation$Type extends MessageType { + constructor() { + super("base.v1.Operation", [ + { no: 1, name: "relationships_write", kind: "scalar", jsonName: "relationships_write", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "relationships_delete", kind: "scalar", jsonName: "relationships_delete", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "attributes_write", kind: "scalar", jsonName: "attributes_write", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "attributes_delete", kind: "scalar", jsonName: "attributes_delete", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Operation { + const message = { relationshipsWrite: [], relationshipsDelete: [], attributesWrite: [], attributesDelete: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Operation): Operation { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string relationships_write = 1 [json_name = "relationships_write"];*/ 1: + message.relationshipsWrite.push(reader.string()); + break; + case /* repeated string relationships_delete = 2 [json_name = "relationships_delete"];*/ 2: + message.relationshipsDelete.push(reader.string()); + break; + case /* repeated string attributes_write = 3 [json_name = "attributes_write"];*/ 3: + message.attributesWrite.push(reader.string()); + break; + case /* repeated string attributes_delete = 4 [json_name = "attributes_delete"];*/ 4: + message.attributesDelete.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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: [] }; + return message; + } + internalBinaryWrite(message: Operation, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string relationships_write = 1 [json_name = "relationships_write"]; */ + for (let i = 0; i < message.relationshipsWrite.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.relationshipsWrite[i]); + /* repeated string relationships_delete = 2 [json_name = "relationships_delete"]; */ + for (let i = 0; i < message.relationshipsDelete.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.relationshipsDelete[i]); + /* repeated string attributes_write = 3 [json_name = "attributes_write"]; */ + for (let i = 0; i < message.attributesWrite.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.attributesWrite[i]); + /* repeated string attributes_delete = 4 [json_name = "attributes_delete"]; */ + for (let i = 0; i < message.attributesDelete.length; i++) + writer.tag(4, WireType.LengthDelimited).string(message.attributesDelete[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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()); +/** + * @generated MessageType for protobuf message base.v1.Operation + */ +export const Operation = new Operation$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Partials$Type extends MessageType { + constructor() { + super("base.v1.Partials", [ + { no: 1, name: "write", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "delete", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "update", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Partials { + const message = { write: [], delete: [], update: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Partials): Partials { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string write */ 1: + message.write.push(reader.string()); + break; + case /* repeated string delete */ 2: + message.delete.push(reader.string()); + break; + case /* repeated string update */ 3: + message.update.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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; + return message; + } + internalBinaryWrite(message: Partials, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string write = 1; */ + for (let i = 0; i < message.write.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.write[i]); + /* repeated string delete = 2; */ + for (let i = 0; i < message.delete.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.delete[i]); + /* repeated string update = 3; */ + for (let i = 0; i < message.update.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.update[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } +/** + * @generated MessageType for protobuf message base.v1.Partials + */ +export const Partials = new Partials$Type(); diff --git a/src/grpc/generated/base/v1/errors.ts b/src/grpc/generated/base/v1/errors.ts index 4c5e3b9..d262552 100644 --- a/src/grpc/generated/base/v1/errors.ts +++ b/src/grpc/generated/base/v1/errors.ts @@ -1,566 +1,379 @@ -// 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 */ +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "base/v1/errors.proto" (package "base.v1", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +/** + * ErrorResponse + * + * @generated from protobuf message base.v1.ErrorResponse + */ export interface ErrorResponse { - code: ErrorCode; - message: string; + /** + * @generated from protobuf field: base.v1.ErrorCode code = 1; + */ + code: ErrorCode; + /** + * @generated from protobuf field: string message = 2; + */ + message: string; } - -function createBaseErrorResponse(): ErrorResponse { - return { code: 0, message: "" }; +/** + * @generated from protobuf enum base.v1.ErrorCode + */ +export enum ErrorCode { + /** + * @generated from protobuf enum value: ERROR_CODE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * authn + * + * @generated from protobuf enum value: ERROR_CODE_MISSING_BEARER_TOKEN = 1001; + */ + MISSING_BEARER_TOKEN = 1001, + /** + * @generated from protobuf enum value: ERROR_CODE_UNAUTHENTICATED = 1002; + */ + UNAUTHENTICATED = 1002, + /** + * @generated from protobuf enum value: ERROR_CODE_MISSING_TENANT_ID = 1003; + */ + MISSING_TENANT_ID = 1003, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_AUDIENCE = 1004; + */ + INVALID_AUDIENCE = 1004, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_CLAIMS = 1005; + */ + INVALID_CLAIMS = 1005, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_ISSUER = 1006; + */ + INVALID_ISSUER = 1006, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_BEARER_TOKEN = 1007; + */ + INVALID_BEARER_TOKEN = 1007, + /** + * validation + * + * @generated from protobuf enum value: ERROR_CODE_VALIDATION = 2000; + */ + VALIDATION = 2000, + /** + * @generated from protobuf enum value: ERROR_CODE_UNDEFINED_CHILD_TYPE = 2002; + */ + UNDEFINED_CHILD_TYPE = 2002, + /** + * @generated from protobuf enum value: ERROR_CODE_UNDEFINED_CHILD_KIND = 2003; + */ + UNDEFINED_CHILD_KIND = 2003, + /** + * @generated from protobuf enum value: ERROR_CODE_UNDEFINED_RELATION_REFERENCE = 2006; + */ + UNDEFINED_RELATION_REFERENCE = 2006, + /** + * @generated from protobuf enum value: ERROR_CODE_NOT_SUPPORTED_RELATION_WALK = 2007; + */ + NOT_SUPPORTED_RELATION_WALK = 2007, + /** + * @generated from protobuf enum value: ERROR_CODE_ENTITY_AND_SUBJECT_CANNOT_BE_EQUAL = 2008; + */ + ENTITY_AND_SUBJECT_CANNOT_BE_EQUAL = 2008, + /** + * @generated from protobuf enum value: ERROR_CODE_DEPTH_NOT_ENOUGH = 2009; + */ + DEPTH_NOT_ENOUGH = 2009, + /** + * @generated from protobuf enum value: ERROR_CODE_RELATION_REFERENCE_NOT_FOUND_IN_ENTITY_REFERENCES = 2010; + */ + RELATION_REFERENCE_NOT_FOUND_IN_ENTITY_REFERENCES = 2010, + /** + * @generated from protobuf enum value: ERROR_CODE_RELATION_REFERENCE_MUST_HAVE_ONE_ENTITY_REFERENCE = 2011; + */ + RELATION_REFERENCE_MUST_HAVE_ONE_ENTITY_REFERENCE = 2011, + /** + * @generated from protobuf enum value: ERROR_CODE_DUPLICATED_ENTITY_REFERENCE = 2012; + */ + DUPLICATED_ENTITY_REFERENCE = 2012, + /** + * @generated from protobuf enum value: ERROR_CODE_DUPLICATED_RELATION_REFERENCE = 2013; + */ + DUPLICATED_RELATION_REFERENCE = 2013, + /** + * @generated from protobuf enum value: ERROR_CODE_DUPLICATED_PERMISSION_REFERENCE = 2014; + */ + DUPLICATED_PERMISSION_REFERENCE = 2014, + /** + * @generated from protobuf enum value: ERROR_CODE_SCHEMA_PARSE = 2015; + */ + SCHEMA_PARSE = 2015, + /** + * @generated from protobuf enum value: ERROR_CODE_SCHEMA_COMPILE = 2016; + */ + SCHEMA_COMPILE = 2016, + /** + * @generated from protobuf enum value: ERROR_CODE_SUBJECT_RELATION_MUST_BE_EMPTY = 2017; + */ + SUBJECT_RELATION_MUST_BE_EMPTY = 2017, + /** + * @generated from protobuf enum value: ERROR_CODE_SUBJECT_RELATION_CANNOT_BE_EMPTY = 2018; + */ + SUBJECT_RELATION_CANNOT_BE_EMPTY = 2018, + /** + * @generated from protobuf enum value: ERROR_CODE_SCHEMA_MUST_HAVE_USER_ENTITY_DEFINITION = 2019; + */ + SCHEMA_MUST_HAVE_USER_ENTITY_DEFINITION = 2019, + /** + * @generated from protobuf enum value: ERROR_CODE_UNIQUE_CONSTRAINT = 2020; + */ + UNIQUE_CONSTRAINT = 2020, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_CONTINUOUS_TOKEN = 2021; + */ + INVALID_CONTINUOUS_TOKEN = 2021, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_KEY = 2022; + */ + INVALID_KEY = 2022, + /** + * @generated from protobuf enum value: ERROR_CODE_ENTITY_TYPE_REQUIRED = 2023; + */ + ENTITY_TYPE_REQUIRED = 2023, + /** + * @generated from protobuf enum value: ERROR_CODE_NO_ENTITY_REFERENCES_FOUND_IN_SCHEMA = 2024; + */ + NO_ENTITY_REFERENCES_FOUND_IN_SCHEMA = 2024, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_ARGUMENT = 2025; + */ + INVALID_ARGUMENT = 2025, + /** + * @generated from protobuf enum value: ERROR_CODE_INVALID_RULE_REFERENCE = 2026; + */ + INVALID_RULE_REFERENCE = 2026, + /** + * @generated from protobuf enum value: ERROR_CODE_NOT_SUPPORTED_WALK = 2027; + */ + NOT_SUPPORTED_WALK = 2027, + /** + * @generated from protobuf enum value: ERROR_CODE_MISSING_ARGUMENT = 2028; + */ + MISSING_ARGUMENT = 2028, + /** + * @generated from protobuf enum value: ERROR_CODE_ALREADY_EXIST = 2029; + */ + ALREADY_EXIST = 2029, + /** + * @generated from protobuf enum value: ERROR_CODE_MAX_DATA_PER_WRITE_EXCEEDED = 2030; + */ + MAX_DATA_PER_WRITE_EXCEEDED = 2030, + /** + * not found + * + * @generated from protobuf enum value: ERROR_CODE_NOT_FOUND = 4000; + */ + NOT_FOUND = 4000, + /** + * @generated from protobuf enum value: ERROR_CODE_ENTITY_TYPE_NOT_FOUND = 4001; + */ + ENTITY_TYPE_NOT_FOUND = 4001, + /** + * @generated from protobuf enum value: ERROR_CODE_PERMISSION_NOT_FOUND = 4002; + */ + PERMISSION_NOT_FOUND = 4002, + /** + * @generated from protobuf enum value: ERROR_CODE_SCHEMA_NOT_FOUND = 4003; + */ + SCHEMA_NOT_FOUND = 4003, + /** + * @generated from protobuf enum value: ERROR_CODE_SUBJECT_TYPE_NOT_FOUND = 4004; + */ + SUBJECT_TYPE_NOT_FOUND = 4004, + /** + * @generated from protobuf enum value: ERROR_CODE_ENTITY_DEFINITION_NOT_FOUND = 4005; + */ + ENTITY_DEFINITION_NOT_FOUND = 4005, + /** + * @generated from protobuf enum value: ERROR_CODE_PERMISSION_DEFINITION_NOT_FOUND = 4006; + */ + PERMISSION_DEFINITION_NOT_FOUND = 4006, + /** + * @generated from protobuf enum value: ERROR_CODE_RELATION_DEFINITION_NOT_FOUND = 4007; + */ + RELATION_DEFINITION_NOT_FOUND = 4007, + /** + * @generated from protobuf enum value: ERROR_CODE_RECORD_NOT_FOUND = 4008; + */ + RECORD_NOT_FOUND = 4008, + /** + * @generated from protobuf enum value: ERROR_CODE_TENANT_NOT_FOUND = 4009; + */ + TENANT_NOT_FOUND = 4009, + /** + * @generated from protobuf enum value: ERROR_CODE_ATTRIBUTE_DEFINITION_NOT_FOUND = 4010; + */ + ATTRIBUTE_DEFINITION_NOT_FOUND = 4010, + /** + * @generated from protobuf enum value: ERROR_CODE_ATTRIBUTE_TYPE_MISMATCH = 4011; + */ + ATTRIBUTE_TYPE_MISMATCH = 4011, + /** + * @generated from protobuf enum value: ERROR_CODE_BUNDLE_NOT_FOUND = 4012; + */ + BUNDLE_NOT_FOUND = 4012, + /** + * @generated from protobuf enum value: ERROR_CODE_RULE_DEFINITION_NOT_FOUND = 4013; + */ + RULE_DEFINITION_NOT_FOUND = 4013, + /** + * @generated from protobuf enum value: ERROR_CODE_ENTITY_STATEMENT_NOT_FOUND = 4014; + */ + ENTITY_STATEMENT_NOT_FOUND = 4014, + /** + * @generated from protobuf enum value: ERROR_CODE_REFERENCE_NOT_FOUND = 4015; + */ + REFERENCE_NOT_FOUND = 4015, + /** + * internal + * + * @generated from protobuf enum value: ERROR_CODE_INTERNAL = 5000; + */ + INTERNAL = 5000, + /** + * @generated from protobuf enum value: ERROR_CODE_CANCELLED = 5001; + */ + CANCELLED = 5001, + /** + * @generated from protobuf enum value: ERROR_CODE_SQL_BUILDER = 5002; + */ + SQL_BUILDER = 5002, + /** + * @generated from protobuf enum value: ERROR_CODE_CIRCUIT_BREAKER = 5003; + */ + CIRCUIT_BREAKER = 5003, + /** + * @generated from protobuf enum value: ERROR_CODE_EXECUTION = 5005; + */ + EXECUTION = 5005, + /** + * @generated from protobuf enum value: ERROR_CODE_SCAN = 5006; + */ + SCAN = 5006, + /** + * @generated from protobuf enum value: ERROR_CODE_MIGRATION = 5007; + */ + MIGRATION = 5007, + /** + * @generated from protobuf enum value: ERROR_CODE_TYPE_CONVERSATION = 5008; + */ + TYPE_CONVERSATION = 5008, + /** + * @generated from protobuf enum value: ERROR_CODE_ERROR_MAX_RETRIES = 5009; + */ + ERROR_MAX_RETRIES = 5009, + /** + * @generated from protobuf enum value: ERROR_CODE_ROLLBACK = 5010; + */ + ROLLBACK = 5010, + /** + * @generated from protobuf enum value: ERROR_CODE_EXCLUSION_REQUIRES_MORE_THAN_ONE_FUNCTION = 5011; + */ + EXCLUSION_REQUIRES_MORE_THAN_ONE_FUNCTION = 5011, + /** + * @generated from protobuf enum value: ERROR_CODE_NOT_IMPLEMENTED = 5012; + */ + NOT_IMPLEMENTED = 5012, + /** + * @generated from protobuf enum value: ERROR_CODE_DATASTORE = 5013; + */ + DATASTORE = 5013, + /** + * @generated from protobuf enum value: ERROR_CODE_UNKNOWN_STATEMENT_TYPE = 5014; + */ + UNKNOWN_STATEMENT_TYPE = 5014, + /** + * @generated from protobuf enum value: ERROR_CODE_UNKNOWN_REFERENCE_TYPE = 5015; + */ + UNKNOWN_REFERENCE_TYPE = 5015, + /** + * @generated from protobuf enum value: ERROR_CODE_CANNOT_CONVERT_TO_ENTITY_STATEMENT = 5016; + */ + CANNOT_CONVERT_TO_ENTITY_STATEMENT = 5016, + /** + * @generated from protobuf enum value: ERROR_CODE_CANNOT_CONVERT_TO_RELATION_STATEMENT = 5017; + */ + CANNOT_CONVERT_TO_RELATION_STATEMENT = 5017, + /** + * @generated from protobuf enum value: ERROR_CODE_CANNOT_CONVERT_TO_ATTRIBUTE_STATEMENT = 5018; + */ + CANNOT_CONVERT_TO_ATTRIBUTE_STATEMENT = 5018, + /** + * @generated from protobuf enum value: ERROR_CODE_SERIALIZATION = 5019; + */ + SERIALIZATION = 5019 } - -export const ErrorResponse: MessageFns = { - encode(message: ErrorResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.code !== 0) { - writer.uint32(8).int32(message.code); +// @generated message type with reflection information, may provide speed optimized methods +class ErrorResponse$Type extends MessageType { + constructor() { + super("base.v1.ErrorResponse", [ + { no: 1, name: "code", kind: "enum", T: () => ["base.v1.ErrorCode", ErrorCode, "ERROR_CODE_"] }, + { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); } - if (message.message !== "") { - writer.uint32(18).string(message.message); + create(value?: PartialMessage): ErrorResponse { + const message = { code: 0, message: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return 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; + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ErrorResponse): ErrorResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.ErrorCode code */ 1: + message.code = reader.int32(); + break; + case /* string message */ 2: + message.message = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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); + internalBinaryWrite(message: ErrorResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.ErrorCode code = 1; */ + if (message.code !== 0) + writer.tag(1, WireType.Varint).int32(message.code); + /* string message = 2; */ + if (message.message !== "") + writer.tag(2, WireType.LengthDelimited).string(message.message); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message base.v1.ErrorResponse + */ +export const ErrorResponse = new ErrorResponse$Type(); diff --git a/src/grpc/generated/base/v1/service.grpc-client.ts b/src/grpc/generated/base/v1/service.grpc-client.ts new file mode 100644 index 0000000..bf0c43f --- /dev/null +++ b/src/grpc/generated/base/v1/service.grpc-client.ts @@ -0,0 +1,647 @@ +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "base/v1/service.proto" (package "base.v1", syntax proto3) +// tslint:disable +import { Tenancy } from "./service"; +import type { TenantListResponse } from "./service"; +import type { TenantListRequest } from "./service"; +import type { TenantDeleteResponse } from "./service"; +import type { TenantDeleteRequest } from "./service"; +import type { TenantCreateResponse } from "./service"; +import type { TenantCreateRequest } from "./service"; +import { Bundle } from "./service"; +import type { BundleDeleteResponse } from "./service"; +import type { BundleDeleteRequest } from "./service"; +import type { BundleReadResponse } from "./service"; +import type { BundleReadRequest } from "./service"; +import type { BundleWriteResponse } from "./service"; +import type { BundleWriteRequest } from "./service"; +import { Data } from "./service"; +import type { BundleRunResponse } from "./service"; +import type { BundleRunRequest } from "./service"; +import type { RelationshipDeleteResponse } from "./service"; +import type { RelationshipDeleteRequest } from "./service"; +import type { DataDeleteResponse } from "./service"; +import type { DataDeleteRequest } from "./service"; +import type { AttributeReadResponse } from "./service"; +import type { AttributeReadRequest } from "./service"; +import type { RelationshipReadResponse } from "./service"; +import type { RelationshipReadRequest } from "./service"; +import type { RelationshipWriteResponse } from "./service"; +import type { RelationshipWriteRequest } from "./service"; +import type { DataWriteResponse } from "./service"; +import type { DataWriteRequest } from "./service"; +import { Schema } from "./service"; +import type { SchemaListResponse } from "./service"; +import type { SchemaListRequest } from "./service"; +import type { SchemaReadResponse } from "./service"; +import type { SchemaReadRequest } from "./service"; +import type { SchemaPartialWriteResponse } from "./service"; +import type { SchemaPartialWriteRequest } from "./service"; +import type { SchemaWriteResponse } from "./service"; +import type { SchemaWriteRequest } from "./service"; +import { Watch } from "./service"; +import type { WatchResponse } from "./service"; +import type { WatchRequest } from "./service"; +import { Permission } from "./service"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { PermissionSubjectPermissionResponse } from "./service"; +import type { PermissionSubjectPermissionRequest } from "./service"; +import type { PermissionLookupSubjectResponse } from "./service"; +import type { PermissionLookupSubjectRequest } from "./service"; +import type { PermissionLookupEntityStreamResponse } from "./service"; +import type { PermissionLookupEntityResponse } from "./service"; +import type { PermissionLookupEntityRequest } from "./service"; +import type { PermissionExpandResponse } from "./service"; +import type { PermissionExpandRequest } from "./service"; +import type { PermissionCheckResponse } from "./service"; +import type { PermissionCheckRequest } from "./service"; +import * as grpc from "@grpc/grpc-js"; +/** + * ** PERMISSION SERVICE ** + * Permission service contains methods to interact with permissions. + * + * @generated from protobuf service base.v1.Permission + */ +export interface IPermissionClient { + /** + * 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?" + * + * @generated from protobuf rpc: Check(base.v1.PermissionCheckRequest) returns (base.v1.PermissionCheckResponse); + */ + check(input: PermissionCheckRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionCheckResponse) => void): grpc.ClientUnaryCall; + check(input: PermissionCheckRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: PermissionCheckResponse) => void): grpc.ClientUnaryCall; + check(input: PermissionCheckRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionCheckResponse) => void): grpc.ClientUnaryCall; + check(input: PermissionCheckRequest, callback: (err: grpc.ServiceError | null, value?: PermissionCheckResponse) => void): grpc.ClientUnaryCall; + /** + * Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse. + * It expands relationships according to the schema provided. + * + * @generated from protobuf rpc: Expand(base.v1.PermissionExpandRequest) returns (base.v1.PermissionExpandResponse); + */ + expand(input: PermissionExpandRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionExpandResponse) => void): grpc.ClientUnaryCall; + expand(input: PermissionExpandRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: PermissionExpandResponse) => void): grpc.ClientUnaryCall; + expand(input: PermissionExpandRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionExpandResponse) => void): grpc.ClientUnaryCall; + expand(input: PermissionExpandRequest, callback: (err: grpc.ServiceError | null, value?: PermissionExpandResponse) => void): grpc.ClientUnaryCall; + /** + * LookupEntity method receives a PermissionLookupEntityRequest and returns a PermissionLookupEntityResponse. + * It is used to retrieve an entity by its identifier. + * + * @generated from protobuf rpc: LookupEntity(base.v1.PermissionLookupEntityRequest) returns (base.v1.PermissionLookupEntityResponse); + */ + lookupEntity(input: PermissionLookupEntityRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionLookupEntityResponse) => void): grpc.ClientUnaryCall; + lookupEntity(input: PermissionLookupEntityRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: PermissionLookupEntityResponse) => void): grpc.ClientUnaryCall; + lookupEntity(input: PermissionLookupEntityRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionLookupEntityResponse) => void): grpc.ClientUnaryCall; + lookupEntity(input: PermissionLookupEntityRequest, callback: (err: grpc.ServiceError | null, value?: PermissionLookupEntityResponse) => void): grpc.ClientUnaryCall; + /** + * 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. + * + * @generated from protobuf rpc: LookupEntityStream(base.v1.PermissionLookupEntityRequest) returns (stream base.v1.PermissionLookupEntityStreamResponse); + */ + lookupEntityStream(input: PermissionLookupEntityRequest, metadata?: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientReadableStream; + lookupEntityStream(input: PermissionLookupEntityRequest, options?: grpc.CallOptions): grpc.ClientReadableStream; + /** + * LookupSubject method receives a PermissionLookupSubjectRequest and returns a PermissionLookupSubjectResponse. + * It is used to retrieve a subject by its identifier. + * + * @generated from protobuf rpc: LookupSubject(base.v1.PermissionLookupSubjectRequest) returns (base.v1.PermissionLookupSubjectResponse); + */ + lookupSubject(input: PermissionLookupSubjectRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionLookupSubjectResponse) => void): grpc.ClientUnaryCall; + lookupSubject(input: PermissionLookupSubjectRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: PermissionLookupSubjectResponse) => void): grpc.ClientUnaryCall; + lookupSubject(input: PermissionLookupSubjectRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionLookupSubjectResponse) => void): grpc.ClientUnaryCall; + lookupSubject(input: PermissionLookupSubjectRequest, callback: (err: grpc.ServiceError | null, value?: PermissionLookupSubjectResponse) => void): grpc.ClientUnaryCall; + /** + * SubjectPermission method receives a PermissionSubjectPermissionRequest and returns a PermissionSubjectPermissionResponse. + * It is used to retrieve permissions related to a specific subject. + * + * @generated from protobuf rpc: SubjectPermission(base.v1.PermissionSubjectPermissionRequest) returns (base.v1.PermissionSubjectPermissionResponse); + */ + subjectPermission(input: PermissionSubjectPermissionRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionSubjectPermissionResponse) => void): grpc.ClientUnaryCall; + subjectPermission(input: PermissionSubjectPermissionRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: PermissionSubjectPermissionResponse) => void): grpc.ClientUnaryCall; + subjectPermission(input: PermissionSubjectPermissionRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: PermissionSubjectPermissionResponse) => void): grpc.ClientUnaryCall; + subjectPermission(input: PermissionSubjectPermissionRequest, callback: (err: grpc.ServiceError | null, value?: PermissionSubjectPermissionResponse) => void): grpc.ClientUnaryCall; +} +/** + * ** PERMISSION SERVICE ** + * Permission service contains methods to interact with permissions. + * + * @generated from protobuf service base.v1.Permission + */ +export class PermissionClient extends grpc.Client implements IPermissionClient { + private readonly _binaryOptions: Partial; + constructor(address: string, credentials: grpc.ChannelCredentials, options: grpc.ClientOptions = {}, binaryOptions: Partial = {}) { + super(address, credentials, options); + this._binaryOptions = binaryOptions; + } + /** + * 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?" + * + * @generated from protobuf rpc: Check(base.v1.PermissionCheckRequest) returns (base.v1.PermissionCheckResponse); + */ + check(input: PermissionCheckRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionCheckResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionCheckResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: PermissionCheckResponse) => void)): grpc.ClientUnaryCall { + const method = Permission.methods[0]; + return this.makeUnaryRequest(`/${Permission.typeName}/${method.name}`, (value: PermissionCheckRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): PermissionCheckResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * Expand method receives a PermissionExpandRequest and returns a PermissionExpandResponse. + * It expands relationships according to the schema provided. + * + * @generated from protobuf rpc: Expand(base.v1.PermissionExpandRequest) returns (base.v1.PermissionExpandResponse); + */ + expand(input: PermissionExpandRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionExpandResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionExpandResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: PermissionExpandResponse) => void)): grpc.ClientUnaryCall { + const method = Permission.methods[1]; + return this.makeUnaryRequest(`/${Permission.typeName}/${method.name}`, (value: PermissionExpandRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): PermissionExpandResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * LookupEntity method receives a PermissionLookupEntityRequest and returns a PermissionLookupEntityResponse. + * It is used to retrieve an entity by its identifier. + * + * @generated from protobuf rpc: LookupEntity(base.v1.PermissionLookupEntityRequest) returns (base.v1.PermissionLookupEntityResponse); + */ + lookupEntity(input: PermissionLookupEntityRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionLookupEntityResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionLookupEntityResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: PermissionLookupEntityResponse) => void)): grpc.ClientUnaryCall { + const method = Permission.methods[2]; + return this.makeUnaryRequest(`/${Permission.typeName}/${method.name}`, (value: PermissionLookupEntityRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): PermissionLookupEntityResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * 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. + * + * @generated from protobuf rpc: LookupEntityStream(base.v1.PermissionLookupEntityRequest) returns (stream base.v1.PermissionLookupEntityStreamResponse); + */ + lookupEntityStream(input: PermissionLookupEntityRequest, metadata?: grpc.Metadata | grpc.CallOptions, options?: grpc.CallOptions): grpc.ClientReadableStream { + const method = Permission.methods[3]; + return this.makeServerStreamRequest(`/${Permission.typeName}/${method.name}`, (value: PermissionLookupEntityRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): PermissionLookupEntityStreamResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), options); + } + /** + * LookupSubject method receives a PermissionLookupSubjectRequest and returns a PermissionLookupSubjectResponse. + * It is used to retrieve a subject by its identifier. + * + * @generated from protobuf rpc: LookupSubject(base.v1.PermissionLookupSubjectRequest) returns (base.v1.PermissionLookupSubjectResponse); + */ + lookupSubject(input: PermissionLookupSubjectRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionLookupSubjectResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionLookupSubjectResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: PermissionLookupSubjectResponse) => void)): grpc.ClientUnaryCall { + const method = Permission.methods[4]; + return this.makeUnaryRequest(`/${Permission.typeName}/${method.name}`, (value: PermissionLookupSubjectRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): PermissionLookupSubjectResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * SubjectPermission method receives a PermissionSubjectPermissionRequest and returns a PermissionSubjectPermissionResponse. + * It is used to retrieve permissions related to a specific subject. + * + * @generated from protobuf rpc: SubjectPermission(base.v1.PermissionSubjectPermissionRequest) returns (base.v1.PermissionSubjectPermissionResponse); + */ + subjectPermission(input: PermissionSubjectPermissionRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionSubjectPermissionResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: PermissionSubjectPermissionResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: PermissionSubjectPermissionResponse) => void)): grpc.ClientUnaryCall { + const method = Permission.methods[5]; + return this.makeUnaryRequest(`/${Permission.typeName}/${method.name}`, (value: PermissionSubjectPermissionRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): PermissionSubjectPermissionResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } +} +// ** WATCH SERVICE ** + +// Watch service provides a streaming RPC that can be used to watch changes in the data. + +/** + * 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. + * + * @generated from protobuf service base.v1.Watch + */ +export interface IWatchClient { + /** + * @generated from protobuf rpc: Watch(base.v1.WatchRequest) returns (stream base.v1.WatchResponse); + */ + watch(input: WatchRequest, metadata?: grpc.Metadata, options?: grpc.CallOptions): grpc.ClientReadableStream; + watch(input: WatchRequest, options?: grpc.CallOptions): grpc.ClientReadableStream; +} +// ** WATCH SERVICE ** + +// Watch service provides a streaming RPC that can be used to watch changes in the data. + +/** + * 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. + * + * @generated from protobuf service base.v1.Watch + */ +export class WatchClient extends grpc.Client implements IWatchClient { + private readonly _binaryOptions: Partial; + constructor(address: string, credentials: grpc.ChannelCredentials, options: grpc.ClientOptions = {}, binaryOptions: Partial = {}) { + super(address, credentials, options); + this._binaryOptions = binaryOptions; + } + /** + * @generated from protobuf rpc: Watch(base.v1.WatchRequest) returns (stream base.v1.WatchResponse); + */ + watch(input: WatchRequest, metadata?: grpc.Metadata | grpc.CallOptions, options?: grpc.CallOptions): grpc.ClientReadableStream { + const method = Watch.methods[0]; + return this.makeServerStreamRequest(`/${Watch.typeName}/${method.name}`, (value: WatchRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): WatchResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), options); + } +} +// ** SCHEMA SERVICE ** + +// Schema service provides methods to manage the authorization model of your application. +// It allows you to read and write the schema of your authorization model. + +/** + * The Schema service definition. + * + * @generated from protobuf service base.v1.Schema + */ +export interface ISchemaClient { + /** + * Write is an RPC that allows you to write your authorization model. + * + * @generated from protobuf rpc: Write(base.v1.SchemaWriteRequest) returns (base.v1.SchemaWriteResponse); + */ + write(input: SchemaWriteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaWriteResponse) => void): grpc.ClientUnaryCall; + write(input: SchemaWriteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: SchemaWriteResponse) => void): grpc.ClientUnaryCall; + write(input: SchemaWriteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaWriteResponse) => void): grpc.ClientUnaryCall; + write(input: SchemaWriteRequest, callback: (err: grpc.ServiceError | null, value?: SchemaWriteResponse) => void): grpc.ClientUnaryCall; + /** + * PartialWrite is an RPC that allows you to partially update an existing authorization model. + * + * @generated from protobuf rpc: PartialWrite(base.v1.SchemaPartialWriteRequest) returns (base.v1.SchemaPartialWriteResponse); + */ + partialWrite(input: SchemaPartialWriteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaPartialWriteResponse) => void): grpc.ClientUnaryCall; + partialWrite(input: SchemaPartialWriteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: SchemaPartialWriteResponse) => void): grpc.ClientUnaryCall; + partialWrite(input: SchemaPartialWriteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaPartialWriteResponse) => void): grpc.ClientUnaryCall; + partialWrite(input: SchemaPartialWriteRequest, callback: (err: grpc.ServiceError | null, value?: SchemaPartialWriteResponse) => void): grpc.ClientUnaryCall; + /** + * Read is an RPC that allows you to read your authorization model. + * + * @generated from protobuf rpc: Read(base.v1.SchemaReadRequest) returns (base.v1.SchemaReadResponse); + */ + read(input: SchemaReadRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaReadResponse) => void): grpc.ClientUnaryCall; + read(input: SchemaReadRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: SchemaReadResponse) => void): grpc.ClientUnaryCall; + read(input: SchemaReadRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaReadResponse) => void): grpc.ClientUnaryCall; + read(input: SchemaReadRequest, callback: (err: grpc.ServiceError | null, value?: SchemaReadResponse) => void): grpc.ClientUnaryCall; + /** + * List is an RPC that allows you to list all authorization models. + * + * @generated from protobuf rpc: List(base.v1.SchemaListRequest) returns (base.v1.SchemaListResponse); + */ + list(input: SchemaListRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaListResponse) => void): grpc.ClientUnaryCall; + list(input: SchemaListRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: SchemaListResponse) => void): grpc.ClientUnaryCall; + list(input: SchemaListRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: SchemaListResponse) => void): grpc.ClientUnaryCall; + list(input: SchemaListRequest, callback: (err: grpc.ServiceError | null, value?: SchemaListResponse) => void): grpc.ClientUnaryCall; +} +// ** SCHEMA SERVICE ** + +// Schema service provides methods to manage the authorization model of your application. +// It allows you to read and write the schema of your authorization model. + +/** + * The Schema service definition. + * + * @generated from protobuf service base.v1.Schema + */ +export class SchemaClient extends grpc.Client implements ISchemaClient { + private readonly _binaryOptions: Partial; + constructor(address: string, credentials: grpc.ChannelCredentials, options: grpc.ClientOptions = {}, binaryOptions: Partial = {}) { + super(address, credentials, options); + this._binaryOptions = binaryOptions; + } + /** + * Write is an RPC that allows you to write your authorization model. + * + * @generated from protobuf rpc: Write(base.v1.SchemaWriteRequest) returns (base.v1.SchemaWriteResponse); + */ + write(input: SchemaWriteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaWriteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaWriteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: SchemaWriteResponse) => void)): grpc.ClientUnaryCall { + const method = Schema.methods[0]; + return this.makeUnaryRequest(`/${Schema.typeName}/${method.name}`, (value: SchemaWriteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): SchemaWriteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * PartialWrite is an RPC that allows you to partially update an existing authorization model. + * + * @generated from protobuf rpc: PartialWrite(base.v1.SchemaPartialWriteRequest) returns (base.v1.SchemaPartialWriteResponse); + */ + partialWrite(input: SchemaPartialWriteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaPartialWriteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaPartialWriteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: SchemaPartialWriteResponse) => void)): grpc.ClientUnaryCall { + const method = Schema.methods[1]; + return this.makeUnaryRequest(`/${Schema.typeName}/${method.name}`, (value: SchemaPartialWriteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): SchemaPartialWriteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * Read is an RPC that allows you to read your authorization model. + * + * @generated from protobuf rpc: Read(base.v1.SchemaReadRequest) returns (base.v1.SchemaReadResponse); + */ + read(input: SchemaReadRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaReadResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaReadResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: SchemaReadResponse) => void)): grpc.ClientUnaryCall { + const method = Schema.methods[2]; + return this.makeUnaryRequest(`/${Schema.typeName}/${method.name}`, (value: SchemaReadRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): SchemaReadResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * List is an RPC that allows you to list all authorization models. + * + * @generated from protobuf rpc: List(base.v1.SchemaListRequest) returns (base.v1.SchemaListResponse); + */ + list(input: SchemaListRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaListResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: SchemaListResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: SchemaListResponse) => void)): grpc.ClientUnaryCall { + const method = Schema.methods[3]; + return this.makeUnaryRequest(`/${Schema.typeName}/${method.name}`, (value: SchemaListRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): SchemaListResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } +} +// ** DATA SERVICE ** + +/** + * The Data service provides RPC methods for managing data in the context of relationships and attributes. + * + * @generated from protobuf service base.v1.Data + */ +export interface IDataClient { + /** + * The Write RPC method creates a new relation tuple. + * + * @generated from protobuf rpc: Write(base.v1.DataWriteRequest) returns (base.v1.DataWriteResponse); + */ + write(input: DataWriteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: DataWriteResponse) => void): grpc.ClientUnaryCall; + write(input: DataWriteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: DataWriteResponse) => void): grpc.ClientUnaryCall; + write(input: DataWriteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: DataWriteResponse) => void): grpc.ClientUnaryCall; + write(input: DataWriteRequest, callback: (err: grpc.ServiceError | null, value?: DataWriteResponse) => void): grpc.ClientUnaryCall; + /** + * 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. + * + * @generated from protobuf rpc: WriteRelationships(base.v1.RelationshipWriteRequest) returns (base.v1.RelationshipWriteResponse); + */ + writeRelationships(input: RelationshipWriteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: RelationshipWriteResponse) => void): grpc.ClientUnaryCall; + writeRelationships(input: RelationshipWriteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: RelationshipWriteResponse) => void): grpc.ClientUnaryCall; + writeRelationships(input: RelationshipWriteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: RelationshipWriteResponse) => void): grpc.ClientUnaryCall; + writeRelationships(input: RelationshipWriteRequest, callback: (err: grpc.ServiceError | null, value?: RelationshipWriteResponse) => void): grpc.ClientUnaryCall; + /** + * The ReadRelationships RPC method reads relation tuple(s). + * + * @generated from protobuf rpc: ReadRelationships(base.v1.RelationshipReadRequest) returns (base.v1.RelationshipReadResponse); + */ + readRelationships(input: RelationshipReadRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: RelationshipReadResponse) => void): grpc.ClientUnaryCall; + readRelationships(input: RelationshipReadRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: RelationshipReadResponse) => void): grpc.ClientUnaryCall; + readRelationships(input: RelationshipReadRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: RelationshipReadResponse) => void): grpc.ClientUnaryCall; + readRelationships(input: RelationshipReadRequest, callback: (err: grpc.ServiceError | null, value?: RelationshipReadResponse) => void): grpc.ClientUnaryCall; + /** + * The ReadAttributes RPC method reads attribute(s) of a relation. + * + * @generated from protobuf rpc: ReadAttributes(base.v1.AttributeReadRequest) returns (base.v1.AttributeReadResponse); + */ + readAttributes(input: AttributeReadRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: AttributeReadResponse) => void): grpc.ClientUnaryCall; + readAttributes(input: AttributeReadRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: AttributeReadResponse) => void): grpc.ClientUnaryCall; + readAttributes(input: AttributeReadRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: AttributeReadResponse) => void): grpc.ClientUnaryCall; + readAttributes(input: AttributeReadRequest, callback: (err: grpc.ServiceError | null, value?: AttributeReadResponse) => void): grpc.ClientUnaryCall; + /** + * The Delete RPC method deletes a relation tuple. + * + * @generated from protobuf rpc: Delete(base.v1.DataDeleteRequest) returns (base.v1.DataDeleteResponse); + */ + delete(input: DataDeleteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: DataDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: DataDeleteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: DataDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: DataDeleteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: DataDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: DataDeleteRequest, callback: (err: grpc.ServiceError | null, value?: DataDeleteResponse) => void): grpc.ClientUnaryCall; + /** + * RPC method to delete relationships for a tenant, accessed via a POST request to the specified path, tagged as "Data" in OpenAPI documentation. + * + * @generated from protobuf rpc: DeleteRelationships(base.v1.RelationshipDeleteRequest) returns (base.v1.RelationshipDeleteResponse); + */ + deleteRelationships(input: RelationshipDeleteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: RelationshipDeleteResponse) => void): grpc.ClientUnaryCall; + deleteRelationships(input: RelationshipDeleteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: RelationshipDeleteResponse) => void): grpc.ClientUnaryCall; + deleteRelationships(input: RelationshipDeleteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: RelationshipDeleteResponse) => void): grpc.ClientUnaryCall; + deleteRelationships(input: RelationshipDeleteRequest, callback: (err: grpc.ServiceError | null, value?: RelationshipDeleteResponse) => void): grpc.ClientUnaryCall; + /** + * Executes or runs a specific bundle. This method is useful for processing or triggering actions based on the bundle's data. + * + * @generated from protobuf rpc: RunBundle(base.v1.BundleRunRequest) returns (base.v1.BundleRunResponse); + */ + runBundle(input: BundleRunRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleRunResponse) => void): grpc.ClientUnaryCall; + runBundle(input: BundleRunRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: BundleRunResponse) => void): grpc.ClientUnaryCall; + runBundle(input: BundleRunRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleRunResponse) => void): grpc.ClientUnaryCall; + runBundle(input: BundleRunRequest, callback: (err: grpc.ServiceError | null, value?: BundleRunResponse) => void): grpc.ClientUnaryCall; +} +// ** DATA SERVICE ** + +/** + * The Data service provides RPC methods for managing data in the context of relationships and attributes. + * + * @generated from protobuf service base.v1.Data + */ +export class DataClient extends grpc.Client implements IDataClient { + private readonly _binaryOptions: Partial; + constructor(address: string, credentials: grpc.ChannelCredentials, options: grpc.ClientOptions = {}, binaryOptions: Partial = {}) { + super(address, credentials, options); + this._binaryOptions = binaryOptions; + } + /** + * The Write RPC method creates a new relation tuple. + * + * @generated from protobuf rpc: Write(base.v1.DataWriteRequest) returns (base.v1.DataWriteResponse); + */ + write(input: DataWriteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: DataWriteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: DataWriteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: DataWriteResponse) => void)): grpc.ClientUnaryCall { + const method = Data.methods[0]; + return this.makeUnaryRequest(`/${Data.typeName}/${method.name}`, (value: DataWriteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): DataWriteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * 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. + * + * @generated from protobuf rpc: WriteRelationships(base.v1.RelationshipWriteRequest) returns (base.v1.RelationshipWriteResponse); + */ + writeRelationships(input: RelationshipWriteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: RelationshipWriteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: RelationshipWriteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: RelationshipWriteResponse) => void)): grpc.ClientUnaryCall { + const method = Data.methods[1]; + return this.makeUnaryRequest(`/${Data.typeName}/${method.name}`, (value: RelationshipWriteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): RelationshipWriteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * The ReadRelationships RPC method reads relation tuple(s). + * + * @generated from protobuf rpc: ReadRelationships(base.v1.RelationshipReadRequest) returns (base.v1.RelationshipReadResponse); + */ + readRelationships(input: RelationshipReadRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: RelationshipReadResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: RelationshipReadResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: RelationshipReadResponse) => void)): grpc.ClientUnaryCall { + const method = Data.methods[2]; + return this.makeUnaryRequest(`/${Data.typeName}/${method.name}`, (value: RelationshipReadRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): RelationshipReadResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * The ReadAttributes RPC method reads attribute(s) of a relation. + * + * @generated from protobuf rpc: ReadAttributes(base.v1.AttributeReadRequest) returns (base.v1.AttributeReadResponse); + */ + readAttributes(input: AttributeReadRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: AttributeReadResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: AttributeReadResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: AttributeReadResponse) => void)): grpc.ClientUnaryCall { + const method = Data.methods[3]; + return this.makeUnaryRequest(`/${Data.typeName}/${method.name}`, (value: AttributeReadRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): AttributeReadResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * The Delete RPC method deletes a relation tuple. + * + * @generated from protobuf rpc: Delete(base.v1.DataDeleteRequest) returns (base.v1.DataDeleteResponse); + */ + delete(input: DataDeleteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: DataDeleteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: DataDeleteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: DataDeleteResponse) => void)): grpc.ClientUnaryCall { + const method = Data.methods[4]; + return this.makeUnaryRequest(`/${Data.typeName}/${method.name}`, (value: DataDeleteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): DataDeleteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * RPC method to delete relationships for a tenant, accessed via a POST request to the specified path, tagged as "Data" in OpenAPI documentation. + * + * @generated from protobuf rpc: DeleteRelationships(base.v1.RelationshipDeleteRequest) returns (base.v1.RelationshipDeleteResponse); + */ + deleteRelationships(input: RelationshipDeleteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: RelationshipDeleteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: RelationshipDeleteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: RelationshipDeleteResponse) => void)): grpc.ClientUnaryCall { + const method = Data.methods[5]; + return this.makeUnaryRequest(`/${Data.typeName}/${method.name}`, (value: RelationshipDeleteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): RelationshipDeleteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * Executes or runs a specific bundle. This method is useful for processing or triggering actions based on the bundle's data. + * + * @generated from protobuf rpc: RunBundle(base.v1.BundleRunRequest) returns (base.v1.BundleRunResponse); + */ + runBundle(input: BundleRunRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleRunResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleRunResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: BundleRunResponse) => void)): grpc.ClientUnaryCall { + const method = Data.methods[6]; + return this.makeUnaryRequest(`/${Data.typeName}/${method.name}`, (value: BundleRunRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): BundleRunResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } +} +// ** BUNDLE SERVICE ** + +/** + * @generated from protobuf service base.v1.Bundle + */ +export interface IBundleClient { + /** + * Writes a bundle of data for a specific operation. This is a general purpose method to handle writing data bundles. + * + * @generated from protobuf rpc: Write(base.v1.BundleWriteRequest) returns (base.v1.BundleWriteResponse); + */ + write(input: BundleWriteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleWriteResponse) => void): grpc.ClientUnaryCall; + write(input: BundleWriteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: BundleWriteResponse) => void): grpc.ClientUnaryCall; + write(input: BundleWriteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleWriteResponse) => void): grpc.ClientUnaryCall; + write(input: BundleWriteRequest, callback: (err: grpc.ServiceError | null, value?: BundleWriteResponse) => void): grpc.ClientUnaryCall; + /** + * Reads a data bundle based on a specified request. This method is tailored for retrieving data bundles. + * + * @generated from protobuf rpc: Read(base.v1.BundleReadRequest) returns (base.v1.BundleReadResponse); + */ + read(input: BundleReadRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleReadResponse) => void): grpc.ClientUnaryCall; + read(input: BundleReadRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: BundleReadResponse) => void): grpc.ClientUnaryCall; + read(input: BundleReadRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleReadResponse) => void): grpc.ClientUnaryCall; + read(input: BundleReadRequest, callback: (err: grpc.ServiceError | null, value?: BundleReadResponse) => void): grpc.ClientUnaryCall; + /** + * Deletes a specific data bundle. This method is used to remove existing bundles from the system. + * + * @generated from protobuf rpc: Delete(base.v1.BundleDeleteRequest) returns (base.v1.BundleDeleteResponse); + */ + delete(input: BundleDeleteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: BundleDeleteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: BundleDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: BundleDeleteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: BundleDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: BundleDeleteRequest, callback: (err: grpc.ServiceError | null, value?: BundleDeleteResponse) => void): grpc.ClientUnaryCall; +} +// ** BUNDLE SERVICE ** + +/** + * @generated from protobuf service base.v1.Bundle + */ +export class BundleClient extends grpc.Client implements IBundleClient { + private readonly _binaryOptions: Partial; + constructor(address: string, credentials: grpc.ChannelCredentials, options: grpc.ClientOptions = {}, binaryOptions: Partial = {}) { + super(address, credentials, options); + this._binaryOptions = binaryOptions; + } + /** + * Writes a bundle of data for a specific operation. This is a general purpose method to handle writing data bundles. + * + * @generated from protobuf rpc: Write(base.v1.BundleWriteRequest) returns (base.v1.BundleWriteResponse); + */ + write(input: BundleWriteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleWriteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleWriteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: BundleWriteResponse) => void)): grpc.ClientUnaryCall { + const method = Bundle.methods[0]; + return this.makeUnaryRequest(`/${Bundle.typeName}/${method.name}`, (value: BundleWriteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): BundleWriteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * Reads a data bundle based on a specified request. This method is tailored for retrieving data bundles. + * + * @generated from protobuf rpc: Read(base.v1.BundleReadRequest) returns (base.v1.BundleReadResponse); + */ + read(input: BundleReadRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleReadResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleReadResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: BundleReadResponse) => void)): grpc.ClientUnaryCall { + const method = Bundle.methods[1]; + return this.makeUnaryRequest(`/${Bundle.typeName}/${method.name}`, (value: BundleReadRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): BundleReadResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * Deletes a specific data bundle. This method is used to remove existing bundles from the system. + * + * @generated from protobuf rpc: Delete(base.v1.BundleDeleteRequest) returns (base.v1.BundleDeleteResponse); + */ + delete(input: BundleDeleteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleDeleteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: BundleDeleteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: BundleDeleteResponse) => void)): grpc.ClientUnaryCall { + const method = Bundle.methods[2]; + return this.makeUnaryRequest(`/${Bundle.typeName}/${method.name}`, (value: BundleDeleteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): BundleDeleteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } +} +// ** TENANCY SERVICE ** +// The Tenancy service defines the gRPC methods for managing tenants. + +/** + * @generated from protobuf service base.v1.Tenancy + */ +export interface ITenancyClient { + /** + * Create is a unary RPC to create a new tenant. + * It requires a TenantCreateRequest and returns a TenantCreateResponse. + * + * @generated from protobuf rpc: Create(base.v1.TenantCreateRequest) returns (base.v1.TenantCreateResponse); + */ + create(input: TenantCreateRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: TenantCreateResponse) => void): grpc.ClientUnaryCall; + create(input: TenantCreateRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: TenantCreateResponse) => void): grpc.ClientUnaryCall; + create(input: TenantCreateRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: TenantCreateResponse) => void): grpc.ClientUnaryCall; + create(input: TenantCreateRequest, callback: (err: grpc.ServiceError | null, value?: TenantCreateResponse) => void): grpc.ClientUnaryCall; + /** + * Delete is a unary RPC to delete an existing tenant. + * It requires a TenantDeleteRequest and returns a TenantDeleteResponse. + * + * @generated from protobuf rpc: Delete(base.v1.TenantDeleteRequest) returns (base.v1.TenantDeleteResponse); + */ + delete(input: TenantDeleteRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: TenantDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: TenantDeleteRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: TenantDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: TenantDeleteRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: TenantDeleteResponse) => void): grpc.ClientUnaryCall; + delete(input: TenantDeleteRequest, callback: (err: grpc.ServiceError | null, value?: TenantDeleteResponse) => void): grpc.ClientUnaryCall; + /** + * List is a unary RPC to get a list of all tenants. + * It requires a TenantListRequest and returns a TenantListResponse. + * + * @generated from protobuf rpc: List(base.v1.TenantListRequest) returns (base.v1.TenantListResponse); + */ + list(input: TenantListRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: TenantListResponse) => void): grpc.ClientUnaryCall; + list(input: TenantListRequest, metadata: grpc.Metadata, callback: (err: grpc.ServiceError | null, value?: TenantListResponse) => void): grpc.ClientUnaryCall; + list(input: TenantListRequest, options: grpc.CallOptions, callback: (err: grpc.ServiceError | null, value?: TenantListResponse) => void): grpc.ClientUnaryCall; + list(input: TenantListRequest, callback: (err: grpc.ServiceError | null, value?: TenantListResponse) => void): grpc.ClientUnaryCall; +} +// ** TENANCY SERVICE ** +// The Tenancy service defines the gRPC methods for managing tenants. + +/** + * @generated from protobuf service base.v1.Tenancy + */ +export class TenancyClient extends grpc.Client implements ITenancyClient { + private readonly _binaryOptions: Partial; + constructor(address: string, credentials: grpc.ChannelCredentials, options: grpc.ClientOptions = {}, binaryOptions: Partial = {}) { + super(address, credentials, options); + this._binaryOptions = binaryOptions; + } + /** + * Create is a unary RPC to create a new tenant. + * It requires a TenantCreateRequest and returns a TenantCreateResponse. + * + * @generated from protobuf rpc: Create(base.v1.TenantCreateRequest) returns (base.v1.TenantCreateResponse); + */ + create(input: TenantCreateRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: TenantCreateResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: TenantCreateResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: TenantCreateResponse) => void)): grpc.ClientUnaryCall { + const method = Tenancy.methods[0]; + return this.makeUnaryRequest(`/${Tenancy.typeName}/${method.name}`, (value: TenantCreateRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): TenantCreateResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * Delete is a unary RPC to delete an existing tenant. + * It requires a TenantDeleteRequest and returns a TenantDeleteResponse. + * + * @generated from protobuf rpc: Delete(base.v1.TenantDeleteRequest) returns (base.v1.TenantDeleteResponse); + */ + delete(input: TenantDeleteRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: TenantDeleteResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: TenantDeleteResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: TenantDeleteResponse) => void)): grpc.ClientUnaryCall { + const method = Tenancy.methods[1]; + return this.makeUnaryRequest(`/${Tenancy.typeName}/${method.name}`, (value: TenantDeleteRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): TenantDeleteResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } + /** + * List is a unary RPC to get a list of all tenants. + * It requires a TenantListRequest and returns a TenantListResponse. + * + * @generated from protobuf rpc: List(base.v1.TenantListRequest) returns (base.v1.TenantListResponse); + */ + list(input: TenantListRequest, metadata: grpc.Metadata | grpc.CallOptions | ((err: grpc.ServiceError | null, value?: TenantListResponse) => void), options?: grpc.CallOptions | ((err: grpc.ServiceError | null, value?: TenantListResponse) => void), callback?: ((err: grpc.ServiceError | null, value?: TenantListResponse) => void)): grpc.ClientUnaryCall { + const method = Tenancy.methods[2]; + return this.makeUnaryRequest(`/${Tenancy.typeName}/${method.name}`, (value: TenantListRequest): Buffer => Buffer.from(method.I.toBinary(value, this._binaryOptions)), (value: Buffer): TenantListResponse => method.O.fromBinary(value, this._binaryOptions), input, (metadata as any), (options as any), (callback as any)); + } +} diff --git a/src/grpc/generated/base/v1/service.ts b/src/grpc/generated/base/v1/service.ts index c399c51..fa4fbcf 100644 --- a/src/grpc/generated/base/v1/service.ts +++ b/src/grpc/generated/base/v1/service.ts @@ -1,35031 +1,5089 @@ -// 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 +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "base/v1/service.proto" (package "base.v1", syntax proto3) +// tslint:disable +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { Tenant } from "./base"; +import { DataBundle } from "./base"; +import { AttributeFilter } from "./base"; +import { TupleFilter } from "./base"; +import { Attribute } from "./base"; +import { Tuple } from "./base"; +import { SchemaDefinition } from "./base"; +import { Partials } from "./base"; +import { DataChanges } from "./base"; +import { RelationReference } from "./base"; +import { Entrance } from "./base"; +import { StringArrayValue } from "./base"; +import { Expand } from "./base"; +import { CheckResult } from "./base"; +import { Argument } from "./base"; +import { Context } from "./base"; +import { Subject } from "./base"; +import { Entity } from "./base"; +// CHECK -/* 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. */ +/** + * PermissionCheckRequest is the request message for the Check method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionCheckRequest + */ 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[]; + /** + * Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Metadata associated with this request, required. + * + * @generated from protobuf field: base.v1.PermissionCheckRequestMetadata metadata = 2; + */ + metadata?: PermissionCheckRequestMetadata; + /** + * Entity on which the permission needs to be checked, required. + * + * @generated from protobuf field: base.v1.Entity entity = 3; + */ + entity?: Entity; + /** + * Name of the permission or relation, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. + * + * @generated from protobuf field: string permission = 4; + */ + permission: string; + /** + * Subject for which the permission needs to be checked, required. + * + * @generated from protobuf field: base.v1.Subject subject = 5; + */ + subject?: Subject; + /** + * Context associated with this request. + * + * @generated from protobuf field: base.v1.Context context = 6; + */ + context?: Context; + /** + * Additional arguments associated with this request. + * + * @generated from protobuf field: repeated base.v1.Argument arguments = 7; + */ + arguments: Argument[]; } - -/** PermissionCheckRequestMetadata metadata for the PermissionCheckRequest. */ +/** + * PermissionCheckRequestMetadata metadata for the PermissionCheckRequest. + * + * @generated from protobuf message base.v1.PermissionCheckRequestMetadata + */ 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; + /** + * Version of the schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; + /** + * Token associated with the snap. + * + * @generated from protobuf field: string snap_token = 2 [json_name = "snap_token"]; + */ + snapToken: string; + /** + * Depth of the check, must be greater than or equal to 3. + * + * @generated from protobuf field: int32 depth = 3; + */ + depth: number; } - -/** PermissionCheckResponse is the response message for the Check method in the Permission service. */ +/** + * PermissionCheckResponse is the response message for the Check method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionCheckResponse + */ export interface PermissionCheckResponse { - /** Result of the permission check. */ - can: CheckResult; - /** Metadata associated with this response. */ - metadata: PermissionCheckResponseMetadata | undefined; + /** + * Result of the permission check. + * + * @generated from protobuf field: base.v1.CheckResult can = 1; + */ + can: CheckResult; + /** + * Metadata associated with this response. + * + * @generated from protobuf field: base.v1.PermissionCheckResponseMetadata metadata = 2; + */ + metadata?: PermissionCheckResponseMetadata; } - -/** PermissionCheckResponseMetadata metadata for the PermissionCheckResponse. */ +/** + * PermissionCheckResponseMetadata metadata for the PermissionCheckResponse. + * + * @generated from protobuf message base.v1.PermissionCheckResponseMetadata + */ export interface PermissionCheckResponseMetadata { - /** The count of the checks performed. */ - checkCount: number; + /** + * The count of the checks performed. + * + * @generated from protobuf field: int32 check_count = 1 [json_name = "check_count"]; + */ + checkCount: number; } +// EXPAND -/** PermissionExpandRequest is the request message for the Expand method in the Permission service. */ +/** + * PermissionExpandRequest is the request message for the Expand method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionExpandRequest + */ 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[]; + /** + * Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Metadata associated with this request, required. + * + * @generated from protobuf field: base.v1.PermissionExpandRequestMetadata metadata = 2; + */ + metadata?: PermissionExpandRequestMetadata; + /** + * Entity on which the permission needs to be expanded, required. + * + * @generated from protobuf field: base.v1.Entity entity = 3; + */ + entity?: Entity; + /** + * Name of the permission to be expanded, not required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. + * + * @generated from protobuf field: string permission = 4; + */ + permission: string; + /** + * Context associated with this request. + * + * @generated from protobuf field: base.v1.Context context = 5; + */ + context?: Context; + /** + * Additional arguments associated with this request. + * + * @generated from protobuf field: repeated base.v1.Argument arguments = 6; + */ + arguments: Argument[]; } - -/** PermissionExpandRequestMetadata metadata for the PermissionExpandRequest. */ +/** + * PermissionExpandRequestMetadata metadata for the PermissionExpandRequest. + * + * @generated from protobuf message base.v1.PermissionExpandRequestMetadata + */ export interface PermissionExpandRequestMetadata { - /** Version of the schema. */ - schemaVersion: string; - /** Token associated with the snap. */ - snapToken: string; + /** + * Version of the schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; + /** + * Token associated with the snap. + * + * @generated from protobuf field: string snap_token = 2 [json_name = "snap_token"]; + */ + snapToken: string; } - -/** PermissionExpandResponse is the response message for the Expand method in the Permission service. */ +/** + * PermissionExpandResponse is the response message for the Expand method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionExpandResponse + */ export interface PermissionExpandResponse { - /** Expansion tree. */ - tree: Expand | undefined; + /** + * Expansion tree. + * + * @generated from protobuf field: base.v1.Expand tree = 1; + */ + tree?: Expand; } +// LOOKUP ENTITY -/** PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service. */ +/** + * PermissionLookupEntityRequest is the request message for the LookupEntity method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionLookupEntityRequest + */ 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; + /** + * Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Metadata associated with this request, required. + * + * @generated from protobuf field: base.v1.PermissionLookupEntityRequestMetadata metadata = 2; + */ + metadata?: PermissionLookupEntityRequestMetadata; + /** + * Type of the entity to lookup, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. + * + * @generated from protobuf field: string entity_type = 3 [json_name = "entity_type"]; + */ + entityType: string; + /** + * Name of the permission to check, required, must start with a letter and can include alphanumeric and underscore, max 64 bytes. + * + * @generated from protobuf field: string permission = 4; + */ + permission: string; + /** + * Subject for which to check the permission, required. + * + * @generated from protobuf field: base.v1.Subject subject = 5; + */ + subject?: Subject; + /** + * Context associated with this request. + * + * @generated from protobuf field: base.v1.Context context = 6; + */ + context?: Context; + /** + * 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. + * + * @generated from protobuf field: map scope = 7; + */ + 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. + * + * @generated from protobuf field: uint32 page_size = 8 [json_name = "page_size"]; + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + * + * @generated from protobuf field: string continuous_token = 9 [json_name = "continuous_token"]; + */ + continuousToken: string; } - -/** PermissionLookupEntityRequestMetadata metadata for the PermissionLookupEntityRequest. */ +/** + * PermissionLookupEntityRequestMetadata metadata for the PermissionLookupEntityRequest. + * + * @generated from protobuf message base.v1.PermissionLookupEntityRequestMetadata + */ 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; + /** + * Version of the schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; + /** + * Token associated with the snap. + * + * @generated from protobuf field: string snap_token = 2 [json_name = "snap_token"]; + */ + snapToken: string; + /** + * Depth of lookup, required, must be greater or equal to 3. + * + * @generated from protobuf field: int32 depth = 3; + */ + depth: number; } - -/** PermissionLookupEntityResponse is the response message for the LookupEntity method in the Permission service. */ +/** + * PermissionLookupEntityResponse is the response message for the LookupEntity method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionLookupEntityResponse + */ 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; + /** + * List of identifiers for entities that match the lookup. + * + * @generated from protobuf field: repeated string entity_ids = 1 [json_name = "entity_ids"]; + */ + entityIds: string[]; + /** + * continuous_token is a string that can be used to paginate and retrieve the next set of results. + * + * @generated from protobuf field: string continuous_token = 2 [json_name = "continuous_token"]; + */ + continuousToken: string; } +// LOOKUP STREAM -/** PermissionLookupEntityStreamResponse is the response message for the LookupEntityStream method in the Permission service. */ +/** + * PermissionLookupEntityStreamResponse is the response message for the LookupEntityStream method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionLookupEntityStreamResponse + */ 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; + /** + * Identifier for an entity that matches the lookup. + * + * @generated from protobuf field: string entity_id = 1 [json_name = "entity_id"]; + */ + entityId: string; + /** + * continuous_token is a string that can be used to paginate and retrieve the next set of results. + * + * @generated from protobuf field: string continuous_token = 2 [json_name = "continuous_token"]; + */ + continuousToken: string; } - -/** PermissionEntityFilterRequest is the request message for the LookupEntityStream method in the Permission service. */ +/** + * PermissionEntityFilterRequest is the request message for the LookupEntityStream method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionEntityFilterRequest + */ 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; + /** + * Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Metadata associated with this request, required. + * + * @generated from protobuf field: base.v1.PermissionEntityFilterRequestMetadata metadata = 2; + */ + metadata?: PermissionEntityFilterRequestMetadata; + /** + * Reference to the entity to filter. + * + * @generated from protobuf field: base.v1.Entrance entrance = 3; + */ + entrance?: Entrance; + /** + * Subject for which to check the permission. + * + * @generated from protobuf field: base.v1.Subject subject = 4; + */ + subject?: Subject; + /** + * Context associated with this request. + * + * @generated from protobuf field: base.v1.Context context = 5; + */ + context?: Context; + /** + * 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. + * + * @generated from protobuf field: map scope = 6; + */ + scope: { + [key: string]: StringArrayValue; + }; + /** + * cursor is an optional parameter used for pagination. + * It should be the value received in the previous response. + * + * @generated from protobuf field: string cursor = 7; + */ + cursor: string; } - -/** PermissionEntityFilterRequestMetadata metadata for the PermissionEntityFilterRequest. */ +/** + * PermissionEntityFilterRequestMetadata metadata for the PermissionEntityFilterRequest. + * + * @generated from protobuf message base.v1.PermissionEntityFilterRequestMetadata + */ 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; + /** + * Version of the schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; + /** + * Token associated with the snap. + * + * @generated from protobuf field: string snap_token = 2 [json_name = "snap_token"]; + */ + snapToken: string; + /** + * Depth of lookup, required, must be greater or equal to 3. + * + * @generated from protobuf field: int32 depth = 3; + */ + depth: number; } +// LOOKUP SUBJECT -/** PermissionLookupSubjectRequest is the request message for the LookupSubject method in the Permission service. */ +/** + * PermissionLookupSubjectRequest is the request message for the LookupSubject method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionLookupSubjectRequest + */ 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; + /** + * Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Metadata associated with this request, required. + * + * @generated from protobuf field: base.v1.PermissionLookupSubjectRequestMetadata metadata = 2; + */ + metadata?: PermissionLookupSubjectRequestMetadata; + /** + * Entity for which to check the permission, required. + * + * @generated from protobuf field: base.v1.Entity entity = 3; + */ + entity?: Entity; + /** + * 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. + * + * @generated from protobuf field: string permission = 4; + */ + permission: string; + /** + * Reference to the subject to lookup. + * + * @generated from protobuf field: base.v1.RelationReference subject_reference = 5 [json_name = "subject_reference"]; + */ + subjectReference?: RelationReference; + /** + * Context associated with this request. + * + * @generated from protobuf field: base.v1.Context context = 6; + */ + context?: Context; + /** + * Additional arguments associated with this request. + * + * @generated from protobuf field: repeated base.v1.Argument arguments = 7; + */ + arguments: Argument[]; + /** + * page_size is the number of subjects to be returned in the response. + * The value should be between 1 and 100. + * + * @generated from protobuf field: uint32 page_size = 8 [json_name = "page_size"]; + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + * + * @generated from protobuf field: string continuous_token = 9 [json_name = "continuous_token"]; + */ + continuousToken: string; } - -/** PermissionLookupSubjectRequestMetadata metadata for the PermissionLookupSubjectRequest. */ +/** + * PermissionLookupSubjectRequestMetadata metadata for the PermissionLookupSubjectRequest. + * + * @generated from protobuf message base.v1.PermissionLookupSubjectRequestMetadata + */ 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; + /** + * Version of the schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; + /** + * Token associated with the snap. + * + * @generated from protobuf field: string snap_token = 2 [json_name = "snap_token"]; + */ + snapToken: string; + /** + * Depth of the check, must be greater than or equal to 3. + * + * @generated from protobuf field: int32 depth = 3; + */ + depth: number; } - -/** PermissionLookupSubjectResponse is the response message for the LookupSubject method in the Permission service. */ +/** + * PermissionLookupSubjectResponse is the response message for the LookupSubject method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionLookupSubjectResponse + */ 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; + /** + * List of identifiers for subjects that match the lookup. + * + * @generated from protobuf field: repeated string subject_ids = 1 [json_name = "subject_ids"]; + */ + subjectIds: string[]; + /** + * continuous_token is a string that can be used to paginate and retrieve the next set of results. + * + * @generated from protobuf field: string continuous_token = 2 [json_name = "continuous_token"]; + */ + continuousToken: string; } +// SUBJECT PERMISSION -/** PermissionSubjectPermissionRequest is the request message for the SubjectPermission method in the Permission service. */ +/** + * PermissionSubjectPermissionRequest is the request message for the SubjectPermission method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionSubjectPermissionRequest + */ 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; + /** + * Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Metadata associated with this request, required. + * + * @generated from protobuf field: base.v1.PermissionSubjectPermissionRequestMetadata metadata = 2; + */ + metadata?: PermissionSubjectPermissionRequestMetadata; + /** + * Entity for which to check the permission, required. + * + * @generated from protobuf field: base.v1.Entity entity = 3; + */ + entity?: Entity; + /** + * Subject for which to check the permission, required. + * + * @generated from protobuf field: base.v1.Subject subject = 4; + */ + subject?: Subject; + /** + * Context associated with this request. + * + * @generated from protobuf field: base.v1.Context context = 5; + */ + context?: Context; } - -/** PermissionSubjectPermissionRequestMetadata metadata for the PermissionSubjectPermissionRequest. */ +/** + * PermissionSubjectPermissionRequestMetadata metadata for the PermissionSubjectPermissionRequest. + * + * @generated from protobuf message base.v1.PermissionSubjectPermissionRequestMetadata + */ 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; + /** + * Version of the schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; + /** + * Token associated with the snap. + * + * @generated from protobuf field: string snap_token = 2 [json_name = "snap_token"]; + */ + snapToken: string; + /** + * Whether to only check permissions. + * + * @generated from protobuf field: bool only_permission = 3 [json_name = "only_permission"]; + */ + onlyPermission: boolean; + /** + * Depth of the check, must be greater than or equal to 3. + * + * @generated from protobuf field: int32 depth = 4; + */ + depth: number; } - -/** PermissionSubjectPermissionResponse is the response message for the SubjectPermission method in the Permission service. */ +/** + * PermissionSubjectPermissionResponse is the response message for the SubjectPermission method in the Permission service. + * + * @generated from protobuf message base.v1.PermissionSubjectPermissionResponse + */ export interface PermissionSubjectPermissionResponse { - /** Map of results for each permission check. */ - results: { [key: string]: CheckResult }; -} - -export interface PermissionSubjectPermissionResponse_ResultsEntry { - key: string; - value: CheckResult; + /** + * Map of results for each permission check. + * + * @generated from protobuf field: map results = 1; + */ + results: { + [key: string]: CheckResult; + }; } - /** * WatchRequest is the request message for the Watch RPC. It contains the * details needed to establish a watch stream. + * + * @generated from protobuf message base.v1.WatchRequest */ 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; + /** + * Identifier of the tenant, required, and must match the pattern "[a-zA-Z0-9-,]+", max 64 bytes. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Snap token to be used for watching. + * + * @generated from protobuf field: string snap_token = 2 [json_name = "snap_token"]; + */ + snapToken: string; } - /** * WatchResponse is the response message for the Watch RPC. It contains the * changes in the data that are being watched. + * + * @generated from protobuf message base.v1.WatchResponse */ export interface WatchResponse { - /** Changes in the data. */ - changes: DataChanges | undefined; + /** + * Changes in the data. + * + * @generated from protobuf field: base.v1.DataChanges changes = 1; + */ + changes?: DataChanges; } +// WRITE /** * SchemaWriteRequest is the request message for the Write method in the Schema service. * It contains tenant_id and the schema to be written. + * + * @generated from protobuf message base.v1.SchemaWriteRequest */ 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; + /** + * 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. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * schema is the string representation of the schema to be written. + * + * @generated from protobuf field: string schema = 2; + */ + schema: string; } - /** * SchemaWriteResponse is the response message for the Write method in the Schema service. * It returns the version of the written schema. + * + * @generated from protobuf message base.v1.SchemaWriteResponse */ export interface SchemaWriteResponse { - /** schema_version is the string that identifies the version of the written schema. */ - schemaVersion: string; + /** + * schema_version is the string that identifies the version of the written schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; } +// PARTIAL WRITE /** * It contains the tenant_id to identify the tenant and metadata of the schema to be edited, * with the corresponding edits to various entities + * + * @generated from protobuf message base.v1.SchemaPartialWriteRequest */ 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; + /** + * 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. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * metadata is the additional information needed for the Partial Write request. + * + * @generated from protobuf field: base.v1.SchemaPartialWriteRequestMetadata metadata = 2; + */ + metadata?: SchemaPartialWriteRequestMetadata; + /** + * Map of entity name with the values needed to be updated + * + * @generated from protobuf field: map partials = 3; + */ + partials: { + [key: string]: Partials; + }; } - /** * SchemaPartialWriteRequestMetadata provides additional information for the Schema Partial Write request. * It contains schema_version to specify which version of the schema should be read. + * + * @generated from protobuf message base.v1.SchemaPartialWriteRequestMetadata */ export interface SchemaPartialWriteRequestMetadata { - /** schema_version is the string that identifies the version of the schema to be read. */ - schemaVersion: string; + /** + * schema_version is the string that identifies the version of the schema to be read. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; } - /** * SchemaPartialWriteResponse is the response message for the Parietal Write method in the Schema service. * It returns the requested schema. + * + * @generated from protobuf message base.v1.SchemaPartialWriteResponse */ export interface SchemaPartialWriteResponse { - /** schema_version is the string that identifies the version of the written schema. */ - schemaVersion: string; + /** + * schema_version is the string that identifies the version of the written schema. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; } +// READ /** * 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. + * + * @generated from protobuf message base.v1.SchemaReadRequest */ 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; + /** + * 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. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * metadata is the additional information needed for the Read request. + * + * @generated from protobuf field: base.v1.SchemaReadRequestMetadata metadata = 2; + */ + metadata?: SchemaReadRequestMetadata; } - /** * SchemaReadRequestMetadata provides additional information for the Schema Read request. * It contains schema_version to specify which version of the schema should be read. + * + * @generated from protobuf message base.v1.SchemaReadRequestMetadata */ export interface SchemaReadRequestMetadata { - /** schema_version is the string that identifies the version of the schema to be read. */ - schemaVersion: string; + /** + * schema_version is the string that identifies the version of the schema to be read. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; } - /** * SchemaReadResponse is the response message for the Read method in the Schema service. * It returns the requested schema. + * + * @generated from protobuf message base.v1.SchemaReadResponse */ export interface SchemaReadResponse { - /** schema is the SchemaDefinition that represents the read schema. */ - schema: SchemaDefinition1 | undefined; + /** + * schema is the SchemaDefinition that represents the read schema. + * + * @generated from protobuf field: base.v1.SchemaDefinition schema = 1; + */ + schema?: SchemaDefinition; } +// LIST /** * 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. + * + * @generated from protobuf message base.v1.SchemaListRequest */ 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; + /** + * 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. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * page_size is the number of schemas to be returned in the response. + * The value should be between 1 and 100. + * + * @generated from protobuf field: uint32 page_size = 2 [json_name = "page_size"]; + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + * + * @generated from protobuf field: string continuous_token = 3 [json_name = "continuous_token"]; + */ + continuousToken: string; } - /** * SchemaListResponse is the response message for the List method in the Schema service. * It returns a paginated list of schemas + * + * @generated from protobuf message base.v1.SchemaListResponse */ 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; + /** + * head of the schemas is the latest version available for the tenant + * + * @generated from protobuf field: string head = 1; + */ + head: string; + /** + * list of schema versions with creation timestamps + * + * @generated from protobuf field: repeated base.v1.SchemaList schemas = 2; + */ + schemas: SchemaList[]; + /** + * continuous_token is a string that can be used to paginate and retrieve the next set of results. + * + * @generated from protobuf field: string continuous_token = 3 [json_name = "continuous_token"]; + */ + continuousToken: string; +} +/** + * SchemaList provides a list of schema versions with their corresponding creation timestamps + * + * @generated from protobuf message base.v1.SchemaList + */ +export interface SchemaList { + /** + * @generated from protobuf field: string version = 1; + */ + version: string; + /** + * @generated from protobuf field: string created_at = 2 [json_name = "created_at"]; + */ + 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. + * + * @generated from protobuf message base.v1.DataWriteRequest */ 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[]; + /** + * tenant_id represents the unique identifier of the tenant for which data is written. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * metadata holds additional data related to the request. + * + * @generated from protobuf field: base.v1.DataWriteRequestMetadata metadata = 2; + */ + metadata?: DataWriteRequestMetadata; + /** + * tuples contains the list of tuples (entity-relation-entity triples) that need to be written. + * + * @generated from protobuf field: repeated base.v1.Tuple tuples = 3; + */ + tuples: Tuple[]; + /** + * attributes contains the list of attributes (entity-attribute-value triples) that need to be written. + * + * @generated from protobuf field: repeated base.v1.Attribute attributes = 4; + */ + attributes: Attribute[]; } - /** * DataWriteRequestMetadata defines the structure of metadata for a write request. * It includes the schema version of the data to be written. + * + * @generated from protobuf message base.v1.DataWriteRequestMetadata */ export interface DataWriteRequestMetadata { - /** schema_version represents the version of the schema for the data being written. */ - schemaVersion: string; + /** + * schema_version represents the version of the schema for the data being written. + * + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; } - /** * DataWriteResponse defines the structure of the response after writing data. * It contains the snap_token generated after the write operation. + * + * @generated from protobuf message base.v1.DataWriteResponse */ export interface DataWriteResponse { - /** snap_token is the token generated after the data write operation, representing a snapshot of the data. */ - snapToken: string; + /** + * snap_token is the token generated after the data write operation, representing a snapshot of the data. + * + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + snapToken: string; } - -/** Represents a request to write relationship data. */ +/** + * Represents a request to write relationship data. + * + * @generated from protobuf message base.v1.RelationshipWriteRequest + */ 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[]; + /** + * Unique identifier for the tenant with specific constraints. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Metadata for the request. It's required. + * + * @generated from protobuf field: base.v1.RelationshipWriteRequestMetadata metadata = 2; + */ + metadata?: RelationshipWriteRequestMetadata; + /** + * List of tuples for the request. Must have between 1 and 100 items. + * + * @generated from protobuf field: repeated base.v1.Tuple tuples = 3; + */ + tuples: Tuple[]; } - -/** RelationshipWriteRequestMetadata */ +/** + * RelationshipWriteRequestMetadata + * + * @generated from protobuf message base.v1.RelationshipWriteRequestMetadata + */ export interface RelationshipWriteRequestMetadata { - schemaVersion: string; + /** + * @generated from protobuf field: string schema_version = 1 [json_name = "schema_version"]; + */ + schemaVersion: string; } - -/** RelationshipWriteResponse */ +/** + * RelationshipWriteResponse + * + * @generated from protobuf message base.v1.RelationshipWriteResponse + */ export interface RelationshipWriteResponse { - snapToken: string; + /** + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.RelationshipReadRequest */ 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; + /** + * tenant_id represents the unique identifier of the tenant for which relationships are read. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * metadata holds additional data related to the request. + * + * @generated from protobuf field: base.v1.RelationshipReadRequestMetadata metadata = 2; + */ + metadata?: RelationshipReadRequestMetadata; + /** + * filter is used to specify criteria for the data that needs to be read. + * + * @generated from protobuf field: base.v1.TupleFilter filter = 3; + */ + filter?: TupleFilter; + /** + * 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. + * + * @generated from protobuf field: uint32 page_size = 4 [json_name = "page_size"]; + */ + pageSize: number; + /** + * continuous_token is used in case of paginated reads to get the next page of results. + * + * @generated from protobuf field: string continuous_token = 5 [json_name = "continuous_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.RelationshipReadRequestMetadata */ export interface RelationshipReadRequestMetadata { - /** snap_token represents a specific state or "snapshot" of the database. */ - snapToken: string; + /** + * snap_token represents a specific state or "snapshot" of the database. + * + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.RelationshipReadResponse */ 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; + /** + * tuples is a list of the relationships retrieved in the read operation, represented as entity-relation-entity triples. + * + * @generated from protobuf field: repeated base.v1.Tuple tuples = 1; + */ + tuples: Tuple[]; + /** + * continuous_token is used in the case of paginated reads to retrieve the next page of results. + * + * @generated from protobuf field: string continuous_token = 2 [json_name = "continuous_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.AttributeReadRequest */ 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; + /** + * tenant_id represents the unique identifier of the tenant from which the attributes are being read. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * metadata holds additional information related to the request. + * + * @generated from protobuf field: base.v1.AttributeReadRequestMetadata metadata = 2; + */ + metadata?: AttributeReadRequestMetadata; + /** + * filter specifies the criteria used to select the attributes that should be returned. + * + * @generated from protobuf field: base.v1.AttributeFilter filter = 3; + */ + filter?: AttributeFilter; + /** + * 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. + * + * @generated from protobuf field: uint32 page_size = 4 [json_name = "page_size"]; + */ + pageSize: number; + /** + * continuous_token is used in case of paginated reads to get the next page of results. + * + * @generated from protobuf field: string continuous_token = 5 [json_name = "continuous_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.AttributeReadRequestMetadata */ export interface AttributeReadRequestMetadata { - /** snap_token represents a specific state or "snapshot" of the database. */ - snapToken: string; + /** + * snap_token represents a specific state or "snapshot" of the database. + * + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.AttributeReadResponse */ 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; + /** + * attributes is a list of the attributes retrieved in the read operation. + * + * @generated from protobuf field: repeated base.v1.Attribute attributes = 1; + */ + attributes: Attribute[]; + /** + * continuous_token is used in the case of paginated reads to retrieve the next page of results. + * + * @generated from protobuf field: string continuous_token = 2 [json_name = "continuous_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.DataDeleteRequest */ 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; + /** + * tenant_id represents the unique identifier of the tenant from which the data will be deleted. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * tuple_filter specifies the criteria used to select the tuples that should be deleted. + * + * @generated from protobuf field: base.v1.TupleFilter tuple_filter = 2 [json_name = "tuple_filter"]; + */ + tupleFilter?: TupleFilter; + /** + * attribute_filter specifies the criteria used to select the attributes that should be deleted. + * + * @generated from protobuf field: base.v1.AttributeFilter attribute_filter = 3 [json_name = "attribute_filter"]; + */ + attributeFilter?: AttributeFilter; } - /** * 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. + * + * @generated from protobuf message base.v1.DataDeleteResponse */ export interface DataDeleteResponse { - /** snap_token represents the state of the database after the requested deletions. */ - snapToken: string; + /** + * snap_token represents the state of the database after the requested deletions. + * + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + snapToken: string; } - -/** RelationshipDeleteRequest */ +/** + * RelationshipDeleteRequest + * + * @generated from protobuf message base.v1.RelationshipDeleteRequest + */ export interface RelationshipDeleteRequest { - tenantId: string; - filter: TupleFilter | undefined; + /** + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * @generated from protobuf field: base.v1.TupleFilter filter = 2; + */ + filter?: TupleFilter; } - -/** RelationshipDeleteResponse */ +/** + * RelationshipDeleteResponse + * + * @generated from protobuf message base.v1.RelationshipDeleteResponse + */ export interface RelationshipDeleteResponse { - snapToken: string; + /** + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.BundleRunRequest */ 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; + /** + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * Name of the bundle to be executed. + * + * @generated from protobuf field: string name = 2; + */ + name: string; + /** + * Additional key-value pairs for execution arguments. + * + * @generated from protobuf field: map arguments = 3; + */ + arguments: { + [key: string]: string; + }; } - /** * BundleRunResponse is the response for a BundleRunRequest. * It includes a snap_token, which may be used for tracking the execution or its results. + * + * @generated from protobuf message base.v1.BundleRunResponse */ export interface BundleRunResponse { - snapToken: string; + /** + * @generated from protobuf field: string snap_token = 1 [json_name = "snap_token"]; + */ + 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. + * + * @generated from protobuf message base.v1.BundleWriteRequest */ export interface BundleWriteRequest { - tenantId: string; - /** Contains the bundle data to be written. */ - bundles: DataBundle[]; + /** + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * @generated from protobuf field: repeated base.v1.DataBundle bundles = 2; + */ + bundles: DataBundle[]; // Contains the bundle data to be written. } - /** * BundleWriteResponse is the response for a BundleWriteRequest. * It includes a name which could be used as an identifier or acknowledgment. + * + * @generated from protobuf message base.v1.BundleWriteResponse */ export interface BundleWriteResponse { - /** Identifier or acknowledgment of the written bundle. */ - names: string[]; + /** + * @generated from protobuf field: repeated string names = 1; + */ + names: string[]; // Identifier or acknowledgment of the written bundle. } - +/** + * @generated from protobuf message base.v1.BundleReadRequest + */ export interface BundleReadRequest { - tenantId: string; - name: string; + /** + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * @generated from protobuf field: string name = 2; + */ + name: string; } - +/** + * @generated from protobuf message base.v1.BundleReadResponse + */ export interface BundleReadResponse { - bundle: DataBundle | undefined; + /** + * @generated from protobuf field: base.v1.DataBundle bundle = 1; + */ + bundle?: DataBundle; } - /** * 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. + * + * @generated from protobuf message base.v1.BundleDeleteRequest */ export interface BundleDeleteRequest { - tenantId: string; - /** Name of the bundle to be deleted. */ - name: string; + /** + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; + /** + * @generated from protobuf field: string name = 2; + */ + name: string; // Name of the bundle to be deleted. } - +/** + * @generated from protobuf message base.v1.BundleDeleteResponse + */ export interface BundleDeleteResponse { - name: string; + /** + * @generated from protobuf field: string name = 1; + */ + name: string; } - -/** TenantCreateRequest is the message used for the request to create a tenant. */ +/** + * TenantCreateRequest is the message used for the request to create a tenant. + * + * @generated from protobuf message base.v1.TenantCreateRequest + */ export interface TenantCreateRequest { - /** id is a unique identifier for the tenant. */ - id: string; - /** name is the name of the tenant. */ - name: string; + /** + * id is a unique identifier for the tenant. + * + * @generated from protobuf field: string id = 1; + */ + id: string; + /** + * name is the name of the tenant. + * + * @generated from protobuf field: string name = 2; + */ + name: string; } - -/** TenantCreateResponse is the message returned from the request to create a tenant. */ +/** + * TenantCreateResponse is the message returned from the request to create a tenant. + * + * @generated from protobuf message base.v1.TenantCreateResponse + */ export interface TenantCreateResponse { - /** tenant is the created tenant information. */ - tenant: Tenant | undefined; + /** + * tenant is the created tenant information. + * + * @generated from protobuf field: base.v1.Tenant tenant = 1; + */ + tenant?: Tenant; } - -/** TenantDeleteRequest is the message used for the request to delete a tenant. */ +/** + * TenantDeleteRequest is the message used for the request to delete a tenant. + * + * @generated from protobuf message base.v1.TenantDeleteRequest + */ export interface TenantDeleteRequest { - /** id is the unique identifier of the tenant to be deleted. */ - id: string; + /** + * id is the unique identifier of the tenant to be deleted. + * + * @generated from protobuf field: string id = 1; + */ + id: string; } - -/** TenantDeleteResponse is the message returned from the request to delete a tenant. */ +/** + * TenantDeleteResponse is the message returned from the request to delete a tenant. + * + * @generated from protobuf message base.v1.TenantDeleteResponse + */ export interface TenantDeleteResponse { - /** tenant_id is the tenant id that was deleted. */ - tenantId: string; + /** + * tenant_id is the tenant id that was deleted. + * + * @generated from protobuf field: string tenant_id = 1 [json_name = "tenant_id"]; + */ + tenantId: string; } - -/** TenantListRequest is the message used for the request to list all tenants. */ +/** + * TenantListRequest is the message used for the request to list all tenants. + * + * @generated from protobuf message base.v1.TenantListRequest + */ 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; + /** + * page_size is the number of tenants to be returned in the response. + * The value should be between 1 and 100. + * + * @generated from protobuf field: uint32 page_size = 1 [json_name = "page_size"]; + */ + pageSize: number; + /** + * continuous_token is an optional parameter used for pagination. + * It should be the value received in the previous response. + * + * @generated from protobuf field: string continuous_token = 2 [json_name = "continuous_token"]; + */ + continuousToken: string; } - -/** TenantListResponse is the message returned from the request to list all tenants. */ +/** + * TenantListResponse is the message returned from the request to list all tenants. + * + * @generated from protobuf message base.v1.TenantListResponse + */ 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); + /** + * tenants is a list of tenants. + * + * @generated from protobuf field: repeated base.v1.Tenant tenants = 1; + */ + tenants: Tenant[]; + /** + * continuous_token is a string that can be used to paginate and retrieve the next set of results. + * + * @generated from protobuf field: string continuous_token = 2 [json_name = "continuous_token"]; + */ + continuousToken: string; +} +// @generated message type with reflection information, may provide speed optimized methods +class PermissionCheckRequest$Type extends MessageType { + constructor() { + super("base.v1.PermissionCheckRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => PermissionCheckRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "entity", kind: "message", T: () => Entity, options: { "validate.rules": { message: { required: true } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"repository:1\"" } } }, + { no: 4, name: "permission", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The action the user wants to perform on the resource" } } }, + { no: 5, name: "subject", kind: "message", T: () => Subject, options: { "validate.rules": { message: { required: true } } } }, + { no: 6, name: "context", kind: "message", T: () => Context, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Contextual data that can be dynamically added to permission check requests. See details on [Contextual Data](../../operations/contextual-tuples)" } } }, + { no: 7, name: "arguments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Argument } + ]); + } + create(value?: PartialMessage): PermissionCheckRequest { + const message = { tenantId: "", permission: "", arguments: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionCheckRequest): PermissionCheckRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.PermissionCheckRequestMetadata metadata */ 2: + message.metadata = PermissionCheckRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* base.v1.Entity entity */ 3: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string permission */ 4: + message.permission = reader.string(); + break; + case /* base.v1.Subject subject */ 5: + message.subject = Subject.internalBinaryRead(reader, reader.uint32(), options, message.subject); + break; + case /* base.v1.Context context */ 6: + message.context = Context.internalBinaryRead(reader, reader.uint32(), options, message.context); + break; + case /* repeated base.v1.Argument arguments */ 7: + message.arguments.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionCheckRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.PermissionCheckRequestMetadata metadata = 2; */ + if (message.metadata) + PermissionCheckRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Entity entity = 3; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string permission = 4; */ + if (message.permission !== "") + writer.tag(4, WireType.LengthDelimited).string(message.permission); + /* base.v1.Subject subject = 5; */ + if (message.subject) + Subject.internalBinaryWrite(message.subject, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Context context = 6; */ + if (message.context) + Context.internalBinaryWrite(message.context, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* repeated base.v1.Argument arguments = 7; */ + for (let i = 0; i < message.arguments.length; i++) + Argument.internalBinaryWrite(message.arguments[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.metadata !== undefined) { - PermissionCheckRequestMetadata.encode(message.metadata, writer.uint32(18).fork()).join(); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionCheckRequest + */ +export const PermissionCheckRequest = new PermissionCheckRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionCheckRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.PermissionCheckRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)" } } }, + { no: 3, name: "depth", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gte: 3 } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Query limit when if recursive database queries got in loop" } } } + ]); + } + create(value?: PartialMessage): PermissionCheckRequestMetadata { + const message = { schemaVersion: "", snapToken: "", depth: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionCheckRequestMetadata): PermissionCheckRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + case /* string snap_token = 2 [json_name = "snap_token"];*/ 2: + message.snapToken = reader.string(); + break; + case /* int32 depth */ 3: + message.depth = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionCheckRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + /* string snap_token = 2 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.snapToken); + /* int32 depth = 3; */ + if (message.depth !== 0) + writer.tag(3, WireType.Varint).int32(message.depth); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.entity !== undefined) { - Entity.encode(message.entity, writer.uint32(26).fork()).join(); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionCheckRequestMetadata + */ +export const PermissionCheckRequestMetadata = new PermissionCheckRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionCheckResponse$Type extends MessageType { + constructor() { + super("base.v1.PermissionCheckResponse", [ + { no: 1, name: "can", kind: "enum", T: () => ["base.v1.CheckResult", CheckResult, "CHECK_RESULT_"] }, + { no: 2, name: "metadata", kind: "message", T: () => PermissionCheckResponseMetadata } + ]); + } + create(value?: PartialMessage): PermissionCheckResponse { + const message = { can: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionCheckResponse): PermissionCheckResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.CheckResult can */ 1: + message.can = reader.int32(); + break; + case /* base.v1.PermissionCheckResponseMetadata metadata */ 2: + message.metadata = PermissionCheckResponseMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionCheckResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.CheckResult can = 1; */ + if (message.can !== 0) + writer.tag(1, WireType.Varint).int32(message.can); + /* base.v1.PermissionCheckResponseMetadata metadata = 2; */ + if (message.metadata) + PermissionCheckResponseMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.permission !== "") { - writer.uint32(34).string(message.permission); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionCheckResponse + */ +export const PermissionCheckResponse = new PermissionCheckResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionCheckResponseMetadata$Type extends MessageType { + constructor() { + super("base.v1.PermissionCheckResponseMetadata", [ + { no: 1, name: "check_count", kind: "scalar", jsonName: "check_count", T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): PermissionCheckResponseMetadata { + const message = { checkCount: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionCheckResponseMetadata): PermissionCheckResponseMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 check_count = 1 [json_name = "check_count"];*/ 1: + message.checkCount = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionCheckResponseMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int32 check_count = 1 [json_name = "check_count"]; */ + if (message.checkCount !== 0) + writer.tag(1, WireType.Varint).int32(message.checkCount); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.subject !== undefined) { - Subject.encode(message.subject, writer.uint32(42).fork()).join(); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionCheckResponseMetadata + */ +export const PermissionCheckResponseMetadata = new PermissionCheckResponseMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionExpandRequest$Type extends MessageType { + constructor() { + super("base.v1.PermissionExpandRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => PermissionExpandRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "entity", kind: "message", T: () => Entity, options: { "validate.rules": { message: { required: true } } } }, + { no: 4, name: "permission", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: true } } } }, + { no: 5, name: "context", kind: "message", T: () => Context }, + { no: 6, name: "arguments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Argument } + ]); + } + create(value?: PartialMessage): PermissionExpandRequest { + const message = { tenantId: "", permission: "", arguments: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionExpandRequest): PermissionExpandRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.PermissionExpandRequestMetadata metadata */ 2: + message.metadata = PermissionExpandRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* base.v1.Entity entity */ 3: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string permission */ 4: + message.permission = reader.string(); + break; + case /* base.v1.Context context */ 5: + message.context = Context.internalBinaryRead(reader, reader.uint32(), options, message.context); + break; + case /* repeated base.v1.Argument arguments */ 6: + message.arguments.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionExpandRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.PermissionExpandRequestMetadata metadata = 2; */ + if (message.metadata) + PermissionExpandRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Entity entity = 3; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string permission = 4; */ + if (message.permission !== "") + writer.tag(4, WireType.LengthDelimited).string(message.permission); + /* base.v1.Context context = 5; */ + if (message.context) + Context.internalBinaryWrite(message.context, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* repeated base.v1.Argument arguments = 6; */ + for (let i = 0; i < message.arguments.length; i++) + Argument.internalBinaryWrite(message.arguments[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.context !== undefined) { - Context.encode(message.context, writer.uint32(50).fork()).join(); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionExpandRequest + */ +export const PermissionExpandRequest = new PermissionExpandRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionExpandRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.PermissionExpandRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)." } } } + ]); + } + create(value?: PartialMessage): PermissionExpandRequestMetadata { + const message = { schemaVersion: "", snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionExpandRequestMetadata): PermissionExpandRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + case /* string snap_token = 2 [json_name = "snap_token"];*/ 2: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionExpandRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + /* string snap_token = 2 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.arguments) { - Argument.encode(v!, writer.uint32(58).fork()).join(); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionExpandRequestMetadata + */ +export const PermissionExpandRequestMetadata = new PermissionExpandRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionExpandResponse$Type extends MessageType { + constructor() { + super("base.v1.PermissionExpandResponse", [ + { no: 1, name: "tree", kind: "message", T: () => Expand } + ]); + } + create(value?: PartialMessage): PermissionExpandResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionExpandResponse): PermissionExpandResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Expand tree */ 1: + message.tree = Expand.internalBinaryRead(reader, reader.uint32(), options, message.tree); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionExpandResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Expand tree = 1; */ + if (message.tree) + Expand.internalBinaryWrite(message.tree, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionExpandResponse + */ +export const PermissionExpandResponse = new PermissionExpandResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionLookupEntityRequest$Type extends MessageType { + constructor() { + super("base.v1.PermissionLookupEntityRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => PermissionLookupEntityRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "entity_type", kind: "scalar", jsonName: "entity_type", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: false } } } }, + { no: 4, name: "permission", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: false } } } }, + { no: 5, name: "subject", kind: "message", T: () => Subject, options: { "validate.rules": { message: { required: true } } } }, + { no: 6, name: "context", kind: "message", T: () => Context }, + { no: 7, name: "scope", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => StringArrayValue } }, + { no: 8, name: "page_size", kind: "scalar", jsonName: "page_size", T: 13 /*ScalarType.UINT32*/, options: { "validate.rules": { uint32: { gte: 1, ignoreEmpty: true } } } }, + { no: 9, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): PermissionLookupEntityRequest { + const message = { tenantId: "", entityType: "", permission: "", scope: {}, pageSize: 0, continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionLookupEntityRequest): PermissionLookupEntityRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.PermissionLookupEntityRequestMetadata metadata */ 2: + message.metadata = PermissionLookupEntityRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* string entity_type = 3 [json_name = "entity_type"];*/ 3: + message.entityType = reader.string(); + break; + case /* string permission */ 4: + message.permission = reader.string(); + break; + case /* base.v1.Subject subject */ 5: + message.subject = Subject.internalBinaryRead(reader, reader.uint32(), options, message.subject); + break; + case /* base.v1.Context context */ 6: + message.context = Context.internalBinaryRead(reader, reader.uint32(), options, message.context); + break; + case /* map scope */ 7: + this.binaryReadMap7(message.scope, reader, options); + break; + case /* uint32 page_size = 8 [json_name = "page_size"];*/ 8: + message.pageSize = reader.uint32(); + break; + case /* string continuous_token = 9 [json_name = "continuous_token"];*/ 9: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap7(map: PermissionLookupEntityRequest["scope"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof PermissionLookupEntityRequest["scope"] | undefined, val: PermissionLookupEntityRequest["scope"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = StringArrayValue.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.PermissionLookupEntityRequest.scope"); + } + } + map[key ?? ""] = val ?? StringArrayValue.create(); + } + internalBinaryWrite(message: PermissionLookupEntityRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.PermissionLookupEntityRequestMetadata metadata = 2; */ + if (message.metadata) + PermissionLookupEntityRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string entity_type = 3 [json_name = "entity_type"]; */ + if (message.entityType !== "") + writer.tag(3, WireType.LengthDelimited).string(message.entityType); + /* string permission = 4; */ + if (message.permission !== "") + writer.tag(4, WireType.LengthDelimited).string(message.permission); + /* base.v1.Subject subject = 5; */ + if (message.subject) + Subject.internalBinaryWrite(message.subject, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Context context = 6; */ + if (message.context) + Context.internalBinaryWrite(message.context, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* map scope = 7; */ + for (let k of Object.keys(message.scope)) { + writer.tag(7, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + StringArrayValue.internalBinaryWrite(message.scope[k], writer, options); + writer.join().join(); + } + /* uint32 page_size = 8 [json_name = "page_size"]; */ + if (message.pageSize !== 0) + writer.tag(8, WireType.Varint).uint32(message.pageSize); + /* string continuous_token = 9 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(9, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message base.v1.PermissionLookupEntityRequest + */ +export const PermissionLookupEntityRequest = new PermissionLookupEntityRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionLookupEntityRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.PermissionLookupEntityRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)." } } }, + { no: 3, name: "depth", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gte: 3 } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Query limit when if recursive database queries got in loop." } } } + ]); + } + create(value?: PartialMessage): PermissionLookupEntityRequestMetadata { + const message = { schemaVersion: "", snapToken: "", depth: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionLookupEntityRequestMetadata): PermissionLookupEntityRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + case /* string snap_token = 2 [json_name = "snap_token"];*/ 2: + message.snapToken = reader.string(); + break; + case /* int32 depth */ 3: + message.depth = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionLookupEntityRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + /* string snap_token = 2 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.snapToken); + /* int32 depth = 3; */ + if (message.depth !== 0) + writer.tag(3, WireType.Varint).int32(message.depth); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.metadata !== undefined) { - obj.metadata = PermissionCheckRequestMetadata.toJSON(message.metadata); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionLookupEntityRequestMetadata + */ +export const PermissionLookupEntityRequestMetadata = new PermissionLookupEntityRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionLookupEntityResponse$Type extends MessageType { + constructor() { + super("base.v1.PermissionLookupEntityResponse", [ + { no: 1, name: "entity_ids", kind: "scalar", jsonName: "entity_ids", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): PermissionLookupEntityResponse { + const message = { entityIds: [], continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionLookupEntityResponse): PermissionLookupEntityResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string entity_ids = 1 [json_name = "entity_ids"];*/ 1: + message.entityIds.push(reader.string()); + break; + case /* string continuous_token = 2 [json_name = "continuous_token"];*/ 2: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionLookupEntityResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string entity_ids = 1 [json_name = "entity_ids"]; */ + for (let i = 0; i < message.entityIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.entityIds[i]); + /* string continuous_token = 2 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.entity !== undefined) { - obj.entity = Entity.toJSON(message.entity); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionLookupEntityResponse + */ +export const PermissionLookupEntityResponse = new PermissionLookupEntityResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionLookupEntityStreamResponse$Type extends MessageType { + constructor() { + super("base.v1.PermissionLookupEntityStreamResponse", [ + { no: 1, name: "entity_id", kind: "scalar", jsonName: "entity_id", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): PermissionLookupEntityStreamResponse { + const message = { entityId: "", continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionLookupEntityStreamResponse): PermissionLookupEntityStreamResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string entity_id = 1 [json_name = "entity_id"];*/ 1: + message.entityId = reader.string(); + break; + case /* string continuous_token = 2 [json_name = "continuous_token"];*/ 2: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionLookupEntityStreamResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string entity_id = 1 [json_name = "entity_id"]; */ + if (message.entityId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.entityId); + /* string continuous_token = 2 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.permission !== "") { - obj.permission = message.permission; +} +/** + * @generated MessageType for protobuf message base.v1.PermissionLookupEntityStreamResponse + */ +export const PermissionLookupEntityStreamResponse = new PermissionLookupEntityStreamResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionEntityFilterRequest$Type extends MessageType { + constructor() { + super("base.v1.PermissionEntityFilterRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => PermissionEntityFilterRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "entrance", kind: "message", T: () => Entrance }, + { no: 4, name: "subject", kind: "message", T: () => Subject }, + { no: 5, name: "context", kind: "message", T: () => Context }, + { no: 6, name: "scope", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => StringArrayValue } }, + { no: 7, name: "cursor", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): PermissionEntityFilterRequest { + const message = { tenantId: "", scope: {}, cursor: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionEntityFilterRequest): PermissionEntityFilterRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.PermissionEntityFilterRequestMetadata metadata */ 2: + message.metadata = PermissionEntityFilterRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* base.v1.Entrance entrance */ 3: + message.entrance = Entrance.internalBinaryRead(reader, reader.uint32(), options, message.entrance); + break; + case /* base.v1.Subject subject */ 4: + message.subject = Subject.internalBinaryRead(reader, reader.uint32(), options, message.subject); + break; + case /* base.v1.Context context */ 5: + message.context = Context.internalBinaryRead(reader, reader.uint32(), options, message.context); + break; + case /* map scope */ 6: + this.binaryReadMap6(message.scope, reader, options); + break; + case /* string cursor */ 7: + message.cursor = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap6(map: PermissionEntityFilterRequest["scope"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof PermissionEntityFilterRequest["scope"] | undefined, val: PermissionEntityFilterRequest["scope"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = StringArrayValue.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.PermissionEntityFilterRequest.scope"); + } + } + map[key ?? ""] = val ?? StringArrayValue.create(); + } + internalBinaryWrite(message: PermissionEntityFilterRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.PermissionEntityFilterRequestMetadata metadata = 2; */ + if (message.metadata) + PermissionEntityFilterRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Entrance entrance = 3; */ + if (message.entrance) + Entrance.internalBinaryWrite(message.entrance, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Subject subject = 4; */ + if (message.subject) + Subject.internalBinaryWrite(message.subject, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Context context = 5; */ + if (message.context) + Context.internalBinaryWrite(message.context, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* map scope = 6; */ + for (let k of Object.keys(message.scope)) { + writer.tag(6, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + StringArrayValue.internalBinaryWrite(message.scope[k], writer, options); + writer.join().join(); + } + /* string cursor = 7; */ + if (message.cursor !== "") + writer.tag(7, WireType.LengthDelimited).string(message.cursor); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.subject !== undefined) { - obj.subject = Subject.toJSON(message.subject); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionEntityFilterRequest + */ +export const PermissionEntityFilterRequest = new PermissionEntityFilterRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionEntityFilterRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.PermissionEntityFilterRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)." } } }, + { no: 3, name: "depth", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gte: 3 } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Query limit when if recursive database queries got in loop." } } } + ]); + } + create(value?: PartialMessage): PermissionEntityFilterRequestMetadata { + const message = { schemaVersion: "", snapToken: "", depth: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionEntityFilterRequestMetadata): PermissionEntityFilterRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + case /* string snap_token = 2 [json_name = "snap_token"];*/ 2: + message.snapToken = reader.string(); + break; + case /* int32 depth */ 3: + message.depth = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionEntityFilterRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + /* string snap_token = 2 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.snapToken); + /* int32 depth = 3; */ + if (message.depth !== 0) + writer.tag(3, WireType.Varint).int32(message.depth); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.context !== undefined) { - obj.context = Context.toJSON(message.context); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionEntityFilterRequestMetadata + */ +export const PermissionEntityFilterRequestMetadata = new PermissionEntityFilterRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionLookupSubjectRequest$Type extends MessageType { + constructor() { + super("base.v1.PermissionLookupSubjectRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => PermissionLookupSubjectRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "entity", kind: "message", T: () => Entity, options: { "validate.rules": { message: { required: true } } } }, + { no: 4, name: "permission", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "^[a-zA-Z_]{1,64}$", ignoreEmpty: false } } } }, + { no: 5, name: "subject_reference", kind: "message", jsonName: "subject_reference", T: () => RelationReference, options: { "validate.rules": { message: { required: true } } } }, + { no: 6, name: "context", kind: "message", T: () => Context }, + { no: 7, name: "arguments", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Argument }, + { no: 8, name: "page_size", kind: "scalar", jsonName: "page_size", T: 13 /*ScalarType.UINT32*/, options: { "validate.rules": { uint32: { gte: 1, ignoreEmpty: true } } } }, + { no: 9, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): PermissionLookupSubjectRequest { + const message = { tenantId: "", permission: "", arguments: [], pageSize: 0, continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionLookupSubjectRequest): PermissionLookupSubjectRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.PermissionLookupSubjectRequestMetadata metadata */ 2: + message.metadata = PermissionLookupSubjectRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* base.v1.Entity entity */ 3: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* string permission */ 4: + message.permission = reader.string(); + break; + case /* base.v1.RelationReference subject_reference = 5 [json_name = "subject_reference"];*/ 5: + message.subjectReference = RelationReference.internalBinaryRead(reader, reader.uint32(), options, message.subjectReference); + break; + case /* base.v1.Context context */ 6: + message.context = Context.internalBinaryRead(reader, reader.uint32(), options, message.context); + break; + case /* repeated base.v1.Argument arguments */ 7: + message.arguments.push(Argument.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint32 page_size = 8 [json_name = "page_size"];*/ 8: + message.pageSize = reader.uint32(); + break; + case /* string continuous_token = 9 [json_name = "continuous_token"];*/ 9: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionLookupSubjectRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.PermissionLookupSubjectRequestMetadata metadata = 2; */ + if (message.metadata) + PermissionLookupSubjectRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Entity entity = 3; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string permission = 4; */ + if (message.permission !== "") + writer.tag(4, WireType.LengthDelimited).string(message.permission); + /* base.v1.RelationReference subject_reference = 5 [json_name = "subject_reference"]; */ + if (message.subjectReference) + RelationReference.internalBinaryWrite(message.subjectReference, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Context context = 6; */ + if (message.context) + Context.internalBinaryWrite(message.context, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* repeated base.v1.Argument arguments = 7; */ + for (let i = 0; i < message.arguments.length; i++) + Argument.internalBinaryWrite(message.arguments[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* uint32 page_size = 8 [json_name = "page_size"]; */ + if (message.pageSize !== 0) + writer.tag(8, WireType.Varint).uint32(message.pageSize); + /* string continuous_token = 9 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(9, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.arguments?.length) { - obj.arguments = message.arguments.map((e) => Argument.toJSON(e)); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionLookupSubjectRequest + */ +export const PermissionLookupSubjectRequest = new PermissionLookupSubjectRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionLookupSubjectRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.PermissionLookupSubjectRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)." } } }, + { no: 3, name: "depth", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gte: 3 } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Query limit when if recursive database queries got in loop." } } } + ]); + } + create(value?: PartialMessage): PermissionLookupSubjectRequestMetadata { + const message = { schemaVersion: "", snapToken: "", depth: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionLookupSubjectRequestMetadata): PermissionLookupSubjectRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + case /* string snap_token = 2 [json_name = "snap_token"];*/ 2: + message.snapToken = reader.string(); + break; + case /* int32 depth */ 3: + message.depth = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionLookupSubjectRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + /* string snap_token = 2 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.snapToken); + /* int32 depth = 3; */ + if (message.depth !== 0) + writer.tag(3, WireType.Varint).int32(message.depth); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message base.v1.PermissionLookupSubjectRequestMetadata + */ +export const PermissionLookupSubjectRequestMetadata = new PermissionLookupSubjectRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionLookupSubjectResponse$Type extends MessageType { + constructor() { + super("base.v1.PermissionLookupSubjectResponse", [ + { no: 1, name: "subject_ids", kind: "scalar", jsonName: "subject_ids", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): PermissionLookupSubjectResponse { + const message = { subjectIds: [], continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionLookupSubjectResponse): PermissionLookupSubjectResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string subject_ids = 1 [json_name = "subject_ids"];*/ 1: + message.subjectIds.push(reader.string()); + break; + case /* string continuous_token = 2 [json_name = "continuous_token"];*/ 2: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionLookupSubjectResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string subject_ids = 1 [json_name = "subject_ids"]; */ + for (let i = 0; i < message.subjectIds.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.subjectIds[i]); + /* string continuous_token = 2 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message base.v1.PermissionLookupSubjectResponse + */ +export const PermissionLookupSubjectResponse = new PermissionLookupSubjectResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionSubjectPermissionRequest$Type extends MessageType { + constructor() { + super("base.v1.PermissionSubjectPermissionRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => PermissionSubjectPermissionRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "entity", kind: "message", T: () => Entity, options: { "validate.rules": { message: { required: true } } } }, + { no: 4, name: "subject", kind: "message", T: () => Subject, options: { "validate.rules": { message: { required: true } } } }, + { no: 5, name: "context", kind: "message", T: () => Context } + ]); + } + create(value?: PartialMessage): PermissionSubjectPermissionRequest { + const message = { tenantId: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionSubjectPermissionRequest): PermissionSubjectPermissionRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.PermissionSubjectPermissionRequestMetadata metadata */ 2: + message.metadata = PermissionSubjectPermissionRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* base.v1.Entity entity */ 3: + message.entity = Entity.internalBinaryRead(reader, reader.uint32(), options, message.entity); + break; + case /* base.v1.Subject subject */ 4: + message.subject = Subject.internalBinaryRead(reader, reader.uint32(), options, message.subject); + break; + case /* base.v1.Context context */ 5: + message.context = Context.internalBinaryRead(reader, reader.uint32(), options, message.context); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionSubjectPermissionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.PermissionSubjectPermissionRequestMetadata metadata = 2; */ + if (message.metadata) + PermissionSubjectPermissionRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Entity entity = 3; */ + if (message.entity) + Entity.internalBinaryWrite(message.entity, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Subject subject = 4; */ + if (message.subject) + Subject.internalBinaryWrite(message.subject, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.Context context = 5; */ + if (message.context) + Context.internalBinaryWrite(message.context, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.PermissionSubjectPermissionRequest + */ +export const PermissionSubjectPermissionRequest = new PermissionSubjectPermissionRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionSubjectPermissionRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.PermissionSubjectPermissionRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)." } } }, + { no: 3, name: "only_permission", kind: "scalar", jsonName: "only_permission", T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "depth", kind: "scalar", T: 5 /*ScalarType.INT32*/, options: { "validate.rules": { int32: { gte: 3 } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Query limit when if recursive database queries got in loop." } } } + ]); + } + create(value?: PartialMessage): PermissionSubjectPermissionRequestMetadata { + const message = { schemaVersion: "", snapToken: "", onlyPermission: false, depth: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionSubjectPermissionRequestMetadata): PermissionSubjectPermissionRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + case /* string snap_token = 2 [json_name = "snap_token"];*/ 2: + message.snapToken = reader.string(); + break; + case /* bool only_permission = 3 [json_name = "only_permission"];*/ 3: + message.onlyPermission = reader.bool(); + break; + case /* int32 depth */ 4: + message.depth = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: PermissionSubjectPermissionRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + /* string snap_token = 2 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.snapToken); + /* bool only_permission = 3 [json_name = "only_permission"]; */ + if (message.onlyPermission !== false) + writer.tag(3, WireType.Varint).bool(message.onlyPermission); + /* int32 depth = 4; */ + if (message.depth !== 0) + writer.tag(4, WireType.Varint).int32(message.depth); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message base.v1.PermissionSubjectPermissionRequestMetadata + */ +export const PermissionSubjectPermissionRequestMetadata = new PermissionSubjectPermissionRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class PermissionSubjectPermissionResponse$Type extends MessageType { + constructor() { + super("base.v1.PermissionSubjectPermissionResponse", [ + { no: 1, name: "results", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "enum", T: () => ["base.v1.CheckResult", CheckResult, "CHECK_RESULT_"] } } + ]); + } + create(value?: PartialMessage): PermissionSubjectPermissionResponse { + const message = { results: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: PermissionSubjectPermissionResponse): PermissionSubjectPermissionResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map results */ 1: + this.binaryReadMap1(message.results, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap1(map: PermissionSubjectPermissionResponse["results"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof PermissionSubjectPermissionResponse["results"] | undefined, val: PermissionSubjectPermissionResponse["results"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.int32(); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.PermissionSubjectPermissionResponse.results"); + } + } + map[key ?? ""] = val ?? 0; + } + internalBinaryWrite(message: PermissionSubjectPermissionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map results = 1; */ + for (let k of Object.keys(message.results)) + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.Varint).int32(message.results[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.name !== "") { - obj.name = message.name; +} +/** + * @generated MessageType for protobuf message base.v1.PermissionSubjectPermissionResponse + */ +export const PermissionSubjectPermissionResponse = new PermissionSubjectPermissionResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class WatchRequest$Type extends MessageType { + constructor() { + super("base.v1.WatchRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)." } } } + ]); + } + create(value?: PartialMessage): WatchRequest { + const message = { tenantId: "", snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WatchRequest): WatchRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* string snap_token = 2 [json_name = "snap_token"];*/ 2: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: WatchRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* string snap_token = 2 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message base.v1.WatchRequest + */ +export const WatchRequest = new WatchRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class WatchResponse$Type extends MessageType { + constructor() { + super("base.v1.WatchResponse", [ + { no: 1, name: "changes", kind: "message", T: () => DataChanges } + ]); + } + create(value?: PartialMessage): WatchResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: WatchResponse): WatchResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.DataChanges changes */ 1: + message.changes = DataChanges.internalBinaryRead(reader, reader.uint32(), options, message.changes); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: WatchResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.DataChanges changes = 1; */ + if (message.changes) + DataChanges.internalBinaryWrite(message.changes, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.WatchResponse + */ +export const WatchResponse = new WatchResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaWriteRequest$Type extends MessageType { + constructor() { + super("base.v1.SchemaWriteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "schema", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SchemaWriteRequest { + const message = { tenantId: "", schema: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaWriteRequest): SchemaWriteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* string schema */ 2: + message.schema = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaWriteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* string schema = 2; */ + if (message.schema !== "") + writer.tag(2, WireType.LengthDelimited).string(message.schema); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message base.v1.SchemaWriteRequest + */ +export const SchemaWriteRequest = new SchemaWriteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaWriteResponse$Type extends MessageType { + constructor() { + super("base.v1.SchemaWriteResponse", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SchemaWriteResponse { + const message = { schemaVersion: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaWriteResponse): SchemaWriteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaWriteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message base.v1.SchemaWriteResponse + */ +export const SchemaWriteResponse = new SchemaWriteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaPartialWriteRequest$Type extends MessageType { + constructor() { + super("base.v1.SchemaPartialWriteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } } } }, + { no: 2, name: "metadata", kind: "message", T: () => SchemaPartialWriteRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "partials", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Partials } } + ]); + } + create(value?: PartialMessage): SchemaPartialWriteRequest { + const message = { tenantId: "", partials: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaPartialWriteRequest): SchemaPartialWriteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.SchemaPartialWriteRequestMetadata metadata */ 2: + message.metadata = SchemaPartialWriteRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* map partials */ 3: + this.binaryReadMap3(message.partials, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap3(map: SchemaPartialWriteRequest["partials"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SchemaPartialWriteRequest["partials"] | undefined, val: SchemaPartialWriteRequest["partials"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Partials.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.SchemaPartialWriteRequest.partials"); + } + } + map[key ?? ""] = val ?? Partials.create(); + } + internalBinaryWrite(message: SchemaPartialWriteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.SchemaPartialWriteRequestMetadata metadata = 2; */ + if (message.metadata) + SchemaPartialWriteRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* map partials = 3; */ + for (let k of Object.keys(message.partials)) { + writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Partials.internalBinaryWrite(message.partials[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.name !== "") { - writer.uint32(18).string(message.name); +} +/** + * @generated MessageType for protobuf message base.v1.SchemaPartialWriteRequest + */ +export const SchemaPartialWriteRequest = new SchemaPartialWriteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaPartialWriteRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.SchemaPartialWriteRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SchemaPartialWriteRequestMetadata { + const message = { schemaVersion: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaPartialWriteRequestMetadata): SchemaPartialWriteRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaPartialWriteRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.SchemaPartialWriteRequestMetadata + */ +export const SchemaPartialWriteRequestMetadata = new SchemaPartialWriteRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaPartialWriteResponse$Type extends MessageType { + constructor() { + super("base.v1.SchemaPartialWriteResponse", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SchemaPartialWriteResponse { + const message = { schemaVersion: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaPartialWriteResponse): SchemaPartialWriteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaPartialWriteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message base.v1.SchemaPartialWriteResponse + */ +export const SchemaPartialWriteResponse = new SchemaPartialWriteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaReadRequest$Type extends MessageType { + constructor() { + super("base.v1.SchemaReadRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => SchemaReadRequestMetadata, options: { "validate.rules": { message: { required: true } } } } + ]); + } + create(value?: PartialMessage): SchemaReadRequest { + const message = { tenantId: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaReadRequest): SchemaReadRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.SchemaReadRequestMetadata metadata */ 2: + message.metadata = SchemaReadRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaReadRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.SchemaReadRequestMetadata metadata = 2; */ + if (message.metadata) + SchemaReadRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.name !== "") { - obj.name = message.name; +} +/** + * @generated MessageType for protobuf message base.v1.SchemaReadRequest + */ +export const SchemaReadRequest = new SchemaReadRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaReadRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.SchemaReadRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SchemaReadRequestMetadata { + const message = { schemaVersion: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaReadRequestMetadata): SchemaReadRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaReadRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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(); +/** + * @generated MessageType for protobuf message base.v1.SchemaReadRequestMetadata + */ +export const SchemaReadRequestMetadata = new SchemaReadRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaReadResponse$Type extends MessageType { + constructor() { + super("base.v1.SchemaReadResponse", [ + { no: 1, name: "schema", kind: "message", T: () => SchemaDefinition } + ]); + } + create(value?: PartialMessage): SchemaReadResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaReadResponse): SchemaReadResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.SchemaDefinition schema */ 1: + message.schema = SchemaDefinition.internalBinaryRead(reader, reader.uint32(), options, message.schema); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaReadResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.SchemaDefinition schema = 1; */ + if (message.schema) + SchemaDefinition.internalBinaryWrite(message.schema, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.SchemaReadResponse + */ +export const SchemaReadResponse = new SchemaReadResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaListRequest$Type extends MessageType { + constructor() { + super("base.v1.SchemaListRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "page_size", kind: "scalar", jsonName: "page_size", T: 13 /*ScalarType.UINT32*/, options: { "validate.rules": { uint32: { gte: 1, ignoreEmpty: true } } } }, + { no: 3, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): SchemaListRequest { + const message = { tenantId: "", pageSize: 0, continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaListRequest): SchemaListRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* uint32 page_size = 2 [json_name = "page_size"];*/ 2: + message.pageSize = reader.uint32(); + break; + case /* string continuous_token = 3 [json_name = "continuous_token"];*/ 3: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaListRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* uint32 page_size = 2 [json_name = "page_size"]; */ + if (message.pageSize !== 0) + writer.tag(2, WireType.Varint).uint32(message.pageSize); + /* string continuous_token = 3 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(3, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.SchemaListRequest + */ +export const SchemaListRequest = new SchemaListRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaListResponse$Type extends MessageType { + constructor() { + super("base.v1.SchemaListResponse", [ + { no: 1, name: "head", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "schemas", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SchemaList }, + { no: 3, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SchemaListResponse { + const message = { head: "", schemas: [], continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaListResponse): SchemaListResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string head */ 1: + message.head = reader.string(); + break; + case /* repeated base.v1.SchemaList schemas */ 2: + message.schemas.push(SchemaList.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string continuous_token = 3 [json_name = "continuous_token"];*/ 3: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaListResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string head = 1; */ + if (message.head !== "") + writer.tag(1, WireType.LengthDelimited).string(message.head); + /* repeated base.v1.SchemaList schemas = 2; */ + for (let i = 0; i < message.schemas.length; i++) + SchemaList.internalBinaryWrite(message.schemas[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string continuous_token = 3 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(3, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message base.v1.SchemaListResponse + */ +export const SchemaListResponse = new SchemaListResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SchemaList$Type extends MessageType { + constructor() { + super("base.v1.SchemaList", [ + { no: 1, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "created_at", kind: "scalar", jsonName: "created_at", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SchemaList { + const message = { version: "", createdAt: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SchemaList): SchemaList { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string version */ 1: + message.version = reader.string(); + break; + case /* string created_at = 2 [json_name = "created_at"];*/ 2: + message.createdAt = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SchemaList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string version = 1; */ + if (message.version !== "") + writer.tag(1, WireType.LengthDelimited).string(message.version); + /* string created_at = 2 [json_name = "created_at"]; */ + if (message.createdAt !== "") + writer.tag(2, WireType.LengthDelimited).string(message.createdAt); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.SchemaList + */ +export const SchemaList = new SchemaList$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataWriteRequest$Type extends MessageType { + constructor() { + super("base.v1.DataWriteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => DataWriteRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "tuples", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tuple, options: { "validate.rules": { repeated: { minItems: "0", items: { message: { required: true } } } } } }, + { no: 4, name: "attributes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Attribute, options: { "validate.rules": { repeated: { minItems: "0", items: { message: { required: true } } } } } } + ]); + } + create(value?: PartialMessage): DataWriteRequest { + const message = { tenantId: "", tuples: [], attributes: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataWriteRequest): DataWriteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.DataWriteRequestMetadata metadata */ 2: + message.metadata = DataWriteRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* repeated base.v1.Tuple tuples */ 3: + message.tuples.push(Tuple.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated base.v1.Attribute attributes */ 4: + message.attributes.push(Attribute.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DataWriteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.DataWriteRequestMetadata metadata = 2; */ + if (message.metadata) + DataWriteRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated base.v1.Tuple tuples = 3; */ + for (let i = 0; i < message.tuples.length; i++) + Tuple.internalBinaryWrite(message.tuples[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* repeated base.v1.Attribute attributes = 4; */ + for (let i = 0; i < message.attributes.length; i++) + Attribute.internalBinaryWrite(message.attributes[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message base.v1.DataWriteRequest + */ +export const DataWriteRequest = new DataWriteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataWriteRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.DataWriteRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): DataWriteRequestMetadata { + const message = { schemaVersion: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataWriteRequestMetadata): DataWriteRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DataWriteRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message base.v1.DataWriteRequestMetadata + */ +export const DataWriteRequestMetadata = new DataWriteRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataWriteResponse$Type extends MessageType { + constructor() { + super("base.v1.DataWriteResponse", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)." } } } + ]); + } + create(value?: PartialMessage): DataWriteResponse { + const message = { snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataWriteResponse): DataWriteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DataWriteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.DataWriteResponse + */ +export const DataWriteResponse = new DataWriteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipWriteRequest$Type extends MessageType { + constructor() { + super("base.v1.RelationshipWriteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => RelationshipWriteRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "tuples", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tuple, options: { "validate.rules": { repeated: { minItems: "1", items: { message: { required: true } } } } } } + ]); + } + create(value?: PartialMessage): RelationshipWriteRequest { + const message = { tenantId: "", tuples: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipWriteRequest): RelationshipWriteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.RelationshipWriteRequestMetadata metadata */ 2: + message.metadata = RelationshipWriteRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* repeated base.v1.Tuple tuples */ 3: + message.tuples.push(Tuple.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipWriteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.RelationshipWriteRequestMetadata metadata = 2; */ + if (message.metadata) + RelationshipWriteRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated base.v1.Tuple tuples = 3; */ + for (let i = 0; i < message.tuples.length; i++) + Tuple.internalBinaryWrite(message.tuples[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message base.v1.RelationshipWriteRequest + */ +export const RelationshipWriteRequest = new RelationshipWriteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipWriteRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.RelationshipWriteRequestMetadata", [ + { no: 1, name: "schema_version", kind: "scalar", jsonName: "schema_version", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): RelationshipWriteRequestMetadata { + const message = { schemaVersion: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipWriteRequestMetadata): RelationshipWriteRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string schema_version = 1 [json_name = "schema_version"];*/ 1: + message.schemaVersion = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipWriteRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string schema_version = 1 [json_name = "schema_version"]; */ + if (message.schemaVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.schemaVersion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message base.v1.RelationshipWriteRequestMetadata + */ +export const RelationshipWriteRequestMetadata = new RelationshipWriteRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipWriteResponse$Type extends MessageType { + constructor() { + super("base.v1.RelationshipWriteResponse", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)" } } } + ]); + } + create(value?: PartialMessage): RelationshipWriteResponse { + const message = { snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipWriteResponse): RelationshipWriteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipWriteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.continuousToken !== "") { - writer.uint32(18).string(message.continuousToken); +} +/** + * @generated MessageType for protobuf message base.v1.RelationshipWriteResponse + */ +export const RelationshipWriteResponse = new RelationshipWriteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipReadRequest$Type extends MessageType { + constructor() { + super("base.v1.RelationshipReadRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => RelationshipReadRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "filter", kind: "message", T: () => TupleFilter, options: { "validate.rules": { message: { required: true } } } }, + { no: 4, name: "page_size", kind: "scalar", jsonName: "page_size", T: 13 /*ScalarType.UINT32*/, options: { "validate.rules": { uint32: { gte: 1, ignoreEmpty: true } } } }, + { no: 5, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): RelationshipReadRequest { + const message = { tenantId: "", pageSize: 0, continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipReadRequest): RelationshipReadRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.RelationshipReadRequestMetadata metadata */ 2: + message.metadata = RelationshipReadRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* base.v1.TupleFilter filter */ 3: + message.filter = TupleFilter.internalBinaryRead(reader, reader.uint32(), options, message.filter); + break; + case /* uint32 page_size = 4 [json_name = "page_size"];*/ 4: + message.pageSize = reader.uint32(); + break; + case /* string continuous_token = 5 [json_name = "continuous_token"];*/ 5: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipReadRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.RelationshipReadRequestMetadata metadata = 2; */ + if (message.metadata) + RelationshipReadRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.TupleFilter filter = 3; */ + if (message.filter) + TupleFilter.internalBinaryWrite(message.filter, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* uint32 page_size = 4 [json_name = "page_size"]; */ + if (message.pageSize !== 0) + writer.tag(4, WireType.Varint).uint32(message.pageSize); + /* string continuous_token = 5 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(5, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.RelationshipReadRequest + */ +export const RelationshipReadRequest = new RelationshipReadRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipReadRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.RelationshipReadRequestMetadata", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)" } } } + ]); + } + create(value?: PartialMessage): RelationshipReadRequestMetadata { + const message = { snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipReadRequestMetadata): RelationshipReadRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipReadRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.RelationshipReadRequestMetadata + */ +export const RelationshipReadRequestMetadata = new RelationshipReadRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipReadResponse$Type extends MessageType { + constructor() { + super("base.v1.RelationshipReadResponse", [ + { no: 1, name: "tuples", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tuple }, + { no: 2, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): RelationshipReadResponse { + const message = { tuples: [], continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipReadResponse): RelationshipReadResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated base.v1.Tuple tuples */ 1: + message.tuples.push(Tuple.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string continuous_token = 2 [json_name = "continuous_token"];*/ 2: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipReadResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated base.v1.Tuple tuples = 1; */ + for (let i = 0; i < message.tuples.length; i++) + Tuple.internalBinaryWrite(message.tuples[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string continuous_token = 2 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.continuousToken !== "") { - obj.continuous_token = message.continuousToken; +} +/** + * @generated MessageType for protobuf message base.v1.RelationshipReadResponse + */ +export const RelationshipReadResponse = new RelationshipReadResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AttributeReadRequest$Type extends MessageType { + constructor() { + super("base.v1.AttributeReadRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "metadata", kind: "message", T: () => AttributeReadRequestMetadata, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "filter", kind: "message", T: () => AttributeFilter, options: { "validate.rules": { message: { required: true } } } }, + { no: 4, name: "page_size", kind: "scalar", jsonName: "page_size", T: 13 /*ScalarType.UINT32*/, options: { "validate.rules": { uint32: { gte: 1, ignoreEmpty: true } } } }, + { no: 5, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): AttributeReadRequest { + const message = { tenantId: "", pageSize: 0, continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AttributeReadRequest): AttributeReadRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.AttributeReadRequestMetadata metadata */ 2: + message.metadata = AttributeReadRequestMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata); + break; + case /* base.v1.AttributeFilter filter */ 3: + message.filter = AttributeFilter.internalBinaryRead(reader, reader.uint32(), options, message.filter); + break; + case /* uint32 page_size = 4 [json_name = "page_size"];*/ 4: + message.pageSize = reader.uint32(); + break; + case /* string continuous_token = 5 [json_name = "continuous_token"];*/ 5: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AttributeReadRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.AttributeReadRequestMetadata metadata = 2; */ + if (message.metadata) + AttributeReadRequestMetadata.internalBinaryWrite(message.metadata, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.AttributeFilter filter = 3; */ + if (message.filter) + AttributeFilter.internalBinaryWrite(message.filter, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* uint32 page_size = 4 [json_name = "page_size"]; */ + if (message.pageSize !== 0) + writer.tag(4, WireType.Varint).uint32(message.pageSize); + /* string continuous_token = 5 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(5, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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(); +/** + * @generated MessageType for protobuf message base.v1.AttributeReadRequest + */ +export const AttributeReadRequest = new AttributeReadRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AttributeReadRequestMetadata$Type extends MessageType { + constructor() { + super("base.v1.AttributeReadRequestMetadata", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)" } } } + ]); + } + create(value?: PartialMessage): AttributeReadRequestMetadata { + const message = { snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AttributeReadRequestMetadata): AttributeReadRequestMetadata { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AttributeReadRequestMetadata, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.continuousToken !== "") { - writer.uint32(18).string(message.continuousToken); +} +/** + * @generated MessageType for protobuf message base.v1.AttributeReadRequestMetadata + */ +export const AttributeReadRequestMetadata = new AttributeReadRequestMetadata$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AttributeReadResponse$Type extends MessageType { + constructor() { + super("base.v1.AttributeReadResponse", [ + { no: 1, name: "attributes", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Attribute }, + { no: 2, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): AttributeReadResponse { + const message = { attributes: [], continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AttributeReadResponse): AttributeReadResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated base.v1.Attribute attributes */ 1: + message.attributes.push(Attribute.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string continuous_token = 2 [json_name = "continuous_token"];*/ 2: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AttributeReadResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated base.v1.Attribute attributes = 1; */ + for (let i = 0; i < message.attributes.length; i++) + Attribute.internalBinaryWrite(message.attributes[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string continuous_token = 2 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message base.v1.AttributeReadResponse + */ +export const AttributeReadResponse = new AttributeReadResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataDeleteRequest$Type extends MessageType { + constructor() { + super("base.v1.DataDeleteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "tuple_filter", kind: "message", jsonName: "tuple_filter", T: () => TupleFilter, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "attribute_filter", kind: "message", jsonName: "attribute_filter", T: () => AttributeFilter, options: { "validate.rules": { message: { required: true } } } } + ]); + } + create(value?: PartialMessage): DataDeleteRequest { + const message = { tenantId: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataDeleteRequest): DataDeleteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.TupleFilter tuple_filter = 2 [json_name = "tuple_filter"];*/ 2: + message.tupleFilter = TupleFilter.internalBinaryRead(reader, reader.uint32(), options, message.tupleFilter); + break; + case /* base.v1.AttributeFilter attribute_filter = 3 [json_name = "attribute_filter"];*/ 3: + message.attributeFilter = AttributeFilter.internalBinaryRead(reader, reader.uint32(), options, message.attributeFilter); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DataDeleteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.TupleFilter tuple_filter = 2 [json_name = "tuple_filter"]; */ + if (message.tupleFilter) + TupleFilter.internalBinaryWrite(message.tupleFilter, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* base.v1.AttributeFilter attribute_filter = 3 [json_name = "attribute_filter"]; */ + if (message.attributeFilter) + AttributeFilter.internalBinaryWrite(message.attributeFilter, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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)); +} +/** + * @generated MessageType for protobuf message base.v1.DataDeleteRequest + */ +export const DataDeleteRequest = new DataDeleteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DataDeleteResponse$Type extends MessageType { + constructor() { + super("base.v1.DataDeleteResponse", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)" } } } + ]); + } + create(value?: PartialMessage): DataDeleteResponse { + const message = { snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DataDeleteResponse): DataDeleteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DataDeleteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.continuousToken !== "") { - obj.continuous_token = message.continuousToken; +} +/** + * @generated MessageType for protobuf message base.v1.DataDeleteResponse + */ +export const DataDeleteResponse = new DataDeleteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipDeleteRequest$Type extends MessageType { + constructor() { + super("base.v1.RelationshipDeleteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "filter", kind: "message", T: () => TupleFilter } + ]); + } + create(value?: PartialMessage): RelationshipDeleteRequest { + const message = { tenantId: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipDeleteRequest): RelationshipDeleteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* base.v1.TupleFilter filter */ 2: + message.filter = TupleFilter.internalBinaryRead(reader, reader.uint32(), options, message.filter); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipDeleteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* base.v1.TupleFilter filter = 2; */ + if (message.filter) + TupleFilter.internalBinaryWrite(message.filter, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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. + * @generated MessageType for protobuf message base.v1.RelationshipDeleteRequest */ -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 const RelationshipDeleteRequest = new RelationshipDeleteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RelationshipDeleteResponse$Type extends MessageType { + constructor() { + super("base.v1.RelationshipDeleteResponse", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)" } } } + ]); + } + create(value?: PartialMessage): RelationshipDeleteResponse { + const message = { snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RelationshipDeleteResponse): RelationshipDeleteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RelationshipDeleteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.RelationshipDeleteResponse + */ +export const RelationshipDeleteResponse = new RelationshipDeleteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleRunRequest$Type extends MessageType { + constructor() { + super("base.v1.BundleRunRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "arguments", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } + ]); + } + create(value?: PartialMessage): BundleRunRequest { + const message = { tenantId: "", name: "", arguments: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleRunRequest): BundleRunRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + case /* map arguments */ 3: + this.binaryReadMap3(message.arguments, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap3(map: BundleRunRequest["arguments"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof BundleRunRequest["arguments"] | undefined, val: BundleRunRequest["arguments"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for field base.v1.BundleRunRequest.arguments"); + } + } + map[key ?? ""] = val ?? ""; + } + internalBinaryWrite(message: BundleRunRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + /* map arguments = 3; */ + for (let k of Object.keys(message.arguments)) + writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.arguments[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - /** - * 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. + * @generated MessageType for protobuf message base.v1.BundleRunRequest */ -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 const BundleRunRequest = new BundleRunRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleRunResponse$Type extends MessageType { + constructor() { + super("base.v1.BundleRunResponse", [ + { no: 1, name: "snap_token", kind: "scalar", jsonName: "snap_token", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "The snap token to avoid stale cache, see more details on [Snap Tokens](../../operations/snap-tokens)" } } } + ]); + } + create(value?: PartialMessage): BundleRunResponse { + const message = { snapToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleRunResponse): BundleRunResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string snap_token = 1 [json_name = "snap_token"];*/ 1: + message.snapToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BundleRunResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string snap_token = 1 [json_name = "snap_token"]; */ + if (message.snapToken !== "") + writer.tag(1, WireType.LengthDelimited).string(message.snapToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -export interface WatchClient { - watch(request: DeepPartial, options?: CallOptions & CallOptionsExt): AsyncIterable; +/** + * @generated MessageType for protobuf message base.v1.BundleRunResponse + */ +export const BundleRunResponse = new BundleRunResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleWriteRequest$Type extends MessageType { + constructor() { + super("base.v1.BundleWriteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "bundles", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => DataBundle } + ]); + } + create(value?: PartialMessage): BundleWriteRequest { + const message = { tenantId: "", bundles: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleWriteRequest): BundleWriteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* repeated base.v1.DataBundle bundles */ 2: + message.bundles.push(DataBundle.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BundleWriteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* repeated base.v1.DataBundle bundles = 2; */ + for (let i = 0; i < message.bundles.length; i++) + DataBundle.internalBinaryWrite(message.bundles[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -/** 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>; +/** + * @generated MessageType for protobuf message base.v1.BundleWriteRequest + */ +export const BundleWriteRequest = new BundleWriteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleWriteResponse$Type extends MessageType { + constructor() { + super("base.v1.BundleWriteResponse", [ + { no: 1, name: "names", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): BundleWriteResponse { + const message = { names: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleWriteResponse): BundleWriteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string names */ 1: + message.names.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BundleWriteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string names = 1; */ + for (let i = 0; i < message.names.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.names[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.BundleWriteResponse + */ +export const BundleWriteResponse = new BundleWriteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleReadRequest$Type extends MessageType { + constructor() { + super("base.v1.BundleReadRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): BundleReadRequest { + const message = { tenantId: "", name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleReadRequest): BundleReadRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BundleReadRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -/** 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>; +/** + * @generated MessageType for protobuf message base.v1.BundleReadRequest + */ +export const BundleReadRequest = new BundleReadRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleReadResponse$Type extends MessageType { + constructor() { + super("base.v1.BundleReadResponse", [ + { no: 1, name: "bundle", kind: "message", T: () => DataBundle } + ]); + } + create(value?: PartialMessage): BundleReadResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleReadResponse): BundleReadResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.DataBundle bundle */ 1: + message.bundle = DataBundle.internalBinaryRead(reader, reader.uint32(), options, message.bundle); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BundleReadResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.DataBundle bundle = 1; */ + if (message.bundle) + DataBundle.internalBinaryWrite(message.bundle, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.BundleReadResponse + */ +export const BundleReadResponse = new BundleReadResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleDeleteRequest$Type extends MessageType { + constructor() { + super("base.v1.BundleDeleteRequest", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "128", pattern: "^([a-zA-Z0-9_\\-@\\.:+]{1,128}|\\*)$", ignoreEmpty: false } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the tenant, if you are not using multi-tenancy (have only one tenant) use pre-inserted tenant t1 for this field. Required, and must match the pattern \\\u201C[a-zA-Z0-9-,]+\\\u201C, max 64 bytes." } } }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): BundleDeleteRequest { + const message = { tenantId: "", name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleDeleteRequest): BundleDeleteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BundleDeleteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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>; +/** + * @generated MessageType for protobuf message base.v1.BundleDeleteRequest + */ +export const BundleDeleteRequest = new BundleDeleteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BundleDeleteResponse$Type extends MessageType { + constructor() { + super("base.v1.BundleDeleteResponse", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): BundleDeleteResponse { + const message = { name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BundleDeleteResponse): BundleDeleteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BundleDeleteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.BundleDeleteResponse + */ +export const BundleDeleteResponse = new BundleDeleteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TenantCreateRequest$Type extends MessageType { + constructor() { + super("base.v1.TenantCreateRequest", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", pattern: "[a-zA-Z0-9-,]+", ignoreEmpty: false } } } }, + { no: 2, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { maxBytes: "64", ignoreEmpty: false } } } } + ]); + } + create(value?: PartialMessage): TenantCreateRequest { + const message = { id: "", name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TenantCreateRequest): TenantCreateRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* string name */ 2: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TenantCreateRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* string name = 2; */ + if (message.name !== "") + writer.tag(2, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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>; +/** + * @generated MessageType for protobuf message base.v1.TenantCreateRequest + */ +export const TenantCreateRequest = new TenantCreateRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TenantCreateResponse$Type extends MessageType { + constructor() { + super("base.v1.TenantCreateResponse", [ + { no: 1, name: "tenant", kind: "message", T: () => Tenant } + ]); + } + create(value?: PartialMessage): TenantCreateResponse { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TenantCreateResponse): TenantCreateResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* base.v1.Tenant tenant */ 1: + message.tenant = Tenant.internalBinaryRead(reader, reader.uint32(), options, message.tenant); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TenantCreateResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* base.v1.Tenant tenant = 1; */ + if (message.tenant) + Tenant.internalBinaryWrite(message.tenant, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.TenantCreateResponse + */ +export const TenantCreateResponse = new TenantCreateResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TenantDeleteRequest$Type extends MessageType { + constructor() { + super("base.v1.TenantDeleteRequest", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: false } } } } + ]); + } + create(value?: PartialMessage): TenantDeleteRequest { + const message = { id: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TenantDeleteRequest): TenantDeleteRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TenantDeleteRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.TenantDeleteRequest + */ +export const TenantDeleteRequest = new TenantDeleteRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TenantDeleteResponse$Type extends MessageType { + constructor() { + super("base.v1.TenantDeleteResponse", [ + { no: 1, name: "tenant_id", kind: "scalar", jsonName: "tenant_id", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): TenantDeleteResponse { + const message = { tenantId: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TenantDeleteResponse): TenantDeleteResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string tenant_id = 1 [json_name = "tenant_id"];*/ 1: + message.tenantId = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TenantDeleteResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string tenant_id = 1 [json_name = "tenant_id"]; */ + if (message.tenantId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.tenantId); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; +/** + * @generated MessageType for protobuf message base.v1.TenantDeleteResponse + */ +export const TenantDeleteResponse = new TenantDeleteResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TenantListRequest$Type extends MessageType { + constructor() { + super("base.v1.TenantListRequest", [ + { no: 1, name: "page_size", kind: "scalar", jsonName: "page_size", T: 13 /*ScalarType.UINT32*/, options: { "validate.rules": { uint32: { gte: 1, ignoreEmpty: true } } } }, + { no: 2, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { ignoreEmpty: true } } } } + ]); + } + create(value?: PartialMessage): TenantListRequest { + const message = { pageSize: 0, continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TenantListRequest): TenantListRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* uint32 page_size = 1 [json_name = "page_size"];*/ 1: + message.pageSize = reader.uint32(); + break; + case /* string continuous_token = 2 [json_name = "continuous_token"];*/ 2: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TenantListRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* uint32 page_size = 1 [json_name = "page_size"]; */ + if (message.pageSize !== 0) + writer.tag(1, WireType.Varint).uint32(message.pageSize); + /* string continuous_token = 2 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message base.v1.TenantListRequest + */ +export const TenantListRequest = new TenantListRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TenantListResponse$Type extends MessageType { + constructor() { + super("base.v1.TenantListResponse", [ + { no: 1, name: "tenants", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tenant }, + { no: 2, name: "continuous_token", kind: "scalar", jsonName: "continuous_token", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): TenantListResponse { + const message = { tenants: [], continuousToken: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TenantListResponse): TenantListResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated base.v1.Tenant tenants */ 1: + message.tenants.push(Tenant.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string continuous_token = 2 [json_name = "continuous_token"];*/ 2: + message.continuousToken = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TenantListResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated base.v1.Tenant tenants = 1; */ + for (let i = 0; i < message.tenants.length; i++) + Tenant.internalBinaryWrite(message.tenants[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string continuous_token = 2 [json_name = "continuous_token"]; */ + if (message.continuousToken !== "") + writer.tag(2, WireType.LengthDelimited).string(message.continuousToken); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } +/** + * @generated MessageType for protobuf message base.v1.TenantListResponse + */ +export const TenantListResponse = new TenantListResponse$Type(); +/** + * @generated ServiceType for protobuf service base.v1.Permission + */ +export const Permission = new ServiceType("base.v1.Permission", [ + { name: "Check", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permission"], summary: "check api", operationId: "permissions.check", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "cr, err := client.Permission.Check(context.Background(), &v1.PermissionCheckRequest {\n TenantId: \"t1\",\n Metadata: &v1.PermissionCheckRequestMetadata {\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 20,\n },\n Entity: &v1.Entity {\n Type: \"repository\",\n Id: \"1\",\n },\n Permission: \"edit\",\n Subject: &v1.Subject {\n Type: \"user\",\n Id: \"1\",\n },\n})\nif cr.Can == v1.PermissionCheckResponse_Result_RESULT_ALLOWED {\n // RESULT_ALLOWED\n} else {\n // RESULT_DENIED\n}" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.permission.check({\n tenantId: \"t1\", \n metadata: {\n snapToken: \"\",\n schemaVersion: \"\",\n depth: 20\n },\n entity: {\n type: \"repository\",\n id: \"1\"\n },\n permission: \"edit\",\n subject: {\n type: \"user\",\n id: \"1\"\n }\n}).then((response) => {\n if (response.can === PermissionCheckResponse_Result.RESULT_ALLOWED) {\n console.log(\"RESULT_ALLOWED\")\n } else {\n console.log(\"RESULT_DENIED\")\n }\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/check' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\": {\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"depth\": 20\n },\n \"entity\": {\n \"type\": \"repository\",\n \"id\": \"1\"\n },\n \"permission\": \"edit\",\n \"subject\": {\n \"type\": \"user\",\n \"id\": \"1\",\n \"relation\": \"\"\n }\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/permissions/check", body: "*" } }, I: PermissionCheckRequest, O: PermissionCheckResponse }, + { name: "Expand", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permission"], summary: "expand api", operationId: "permissions.expand", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "cr, err := client.Permission.Expand(context.Background(), &v1.PermissionExpandRequest{\n TenantId: \"t1\",\n Metadata: &v1.PermissionExpandRequestMetadata{\n SnapToken: \"\",\n SchemaVersion: \"\",\n },\n Entity: &v1.Entity{\n Type: \"repository\",\n Id: \"1\",\n },\n Permission: \"push\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.permission.expand({\n tenantId: \"t1\",\n metadata: {\n snapToken: \"\",\n schemaVersion: \"\"\n },\n entity: {\n type: \"repository\",\n id: \"1\"\n },\n permission: \"push\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/expand' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\": {\n \"schema_version\": \"\",\n \"snap_token\": \"\"\n },\n \"entity\": {\n \"type\": \"repository\",\n \"id\": \"1\"\n },\n \"permission\": \"push\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/permissions/expand", body: "*" } }, I: PermissionExpandRequest, O: PermissionExpandResponse }, + { name: "LookupEntity", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permission"], summary: "lookup entity", operationId: "permissions.lookupEntity", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "cr, err := client.Permission.LookupEntity(context.Background(), &v1.PermissionLookupEntityRequest{\n TenantId: \"t1\",\n Metadata: &v1.PermissionLookupEntityRequestMetadata{\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 20,\n },\n EntityType: \"document\",\n Permission: \"edit\",\n Subject: &v1.Subject{\n Type: \"user\",\n Id: \"1\",\n }\n PageSize: 20,\n ContinuousToken: \"\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.permission.lookupEntity({\n tenantId: \"t1\",\n metadata: {\n snapToken: \"\",\n schemaVersion: \"\",\n depth: 20\n },\n entity_type: \"document\",\n permission: \"edit\",\n subject: {\n type: \"user\",\n id: \"1\"\n },\n page_size: 20,\n continuous_token: \"\"\n}).then((response) => {\n console.log(response.entity_ids)\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/lookup-entity' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\":{\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"depth\": 20\n },\n \"entity_type\": \"document\",\n \"permission\": \"edit\",\n \"subject\": {\n \"type\":\"user\",\n \"id\":\"1\"\n },\n \"page_size\": 20,\n \"continuous_token\": \"\",\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/permissions/lookup-entity", body: "*" } }, I: PermissionLookupEntityRequest, O: PermissionLookupEntityResponse }, + { name: "LookupEntityStream", serverStreaming: true, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permission"], summary: "lookup entity stream", operationId: "permissions.lookupEntityStream", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "str, err := client.Permission.LookupEntityStream(context.Background(), &v1.PermissionLookupEntityRequest{\n Metadata: &v1.PermissionLookupEntityRequestMetadata{\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 50,\n },\n EntityType: \"document\",\n Permission: \"view\",\n Subject: &v1.Subject{\n Type: \"user\",\n Id: \"1\",\n },\n PageSize: 20,\n ContinuousToken: \"\",\n})\n\n// handle stream response\nfor {\n res, err := str.Recv()\n\n if err == io.EOF {\n break\n }\n\n // res.EntityId\n}" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "const permify = require(\"@permify/permify-node\");\nconst {PermissionLookupEntityStreamResponse} = require(\"@permify/permify-node/dist/src/grpc/generated/base/v1/service\");\n\nfunction main() {\n const client = new permify.grpc.newClient({\n endpoint: \"localhost:3478\",\n });\n\n let res = client.permission.lookupEntityStream({\n metadata: {\n snapToken: \"\",\n schemaVersion: \"\",\n depth: 20\n },\n entityType: \"document\",\n permission: \"view\",\n subject: {\n type: \"user\",\n id: \"1\"\n },\n page_size: 20,\n continuous_token: \"\"\n });\n\n handle(res);\n}\n\nasync function handle(res: AsyncIterable) {\n for await (const response of res) {\n // response.entityId\n }\n}" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/permissions/lookup-entity-stream", body: "*" } }, I: PermissionLookupEntityRequest, O: PermissionLookupEntityStreamResponse }, + { name: "LookupSubject", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permission"], summary: "lookup-subject", operationId: "permissions.lookupSubject", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "cr, err := client.Permission.LookupSubject(context.Background(), &v1.PermissionLookupSubjectRequest{\n TenantId: \"t1\",\n Metadata: &v1.PermissionLookupSubjectRequestMetadata{\n SnapToken: \"\",\n SchemaVersion: \"\",\n Depth: 20,\n },\n Entity: &v1.Entity{\n Type: \"document\",\n Id: \"1\",\n },\n Permission: \"edit\",\n SubjectReference: &v1.RelationReference{\n Type: \"user\",\n Relation: \"\",\n },\n PageSize: 20,\n ContinuousToken: \"\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.permission.lookupSubject({\n tenantId: \"t1\",\n metadata: {\n snapToken: \"\",\n schemaVersion: \"\",\n depth: 20,\n },\n entity: {\n type: \"document\",\n id: \"1\",\n },\n permission: \"edit\",\n subject_reference: {\n type: \"user\",\n relation: \"\"\n },\n page_size: 10,\n continuous_token: \"\"\n}).then((response) => {\n console.log(response.subject_ids)\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/lookup-subject' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\":{\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"depth\": 20,\n },\n \"entity\": {\n \"type\": \"document\",\n \"id\": \"1\"\n },\n \"permission\": \"edit\",\n \"subject_reference\": {\n \"type\": \"user\",\n \"relation\": \"\"\n },\n page_size: 20,\n continuous_token: \"\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/permissions/lookup-subject", body: "*" } }, I: PermissionLookupSubjectRequest, O: PermissionLookupSubjectResponse }, + { name: "SubjectPermission", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Permission"], summary: "subject permission", operationId: "permissions.subjectPermission", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "cr, err := client.Permission.SubjectPermission(context.Background(), &v1.PermissionSubjectPermissionRequest{\n TenantId: \"t1\",\n Metadata: &v1.PermissionSubjectPermissionRequestMetadata{\n SnapToken: \"\",\n SchemaVersion: \"\",\n OnlyPermission: false,\n Depth: 20,\n },\n Entity: &v1.Entity{\n Type: \"repository\",\n Id: \"1\",\n },\n Subject: &v1.Subject{\n Type: \"user\",\n Id: \"1\",\n },\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.permission.subjectPermission({\n tenantId: \"t1\",\n metadata: {\n snapToken: \"\",\n schemaVersion: \"\",\n onlyPermission: true,\n depth: 20\n },\n entity: {\n type: \"repository\",\n id: \"1\"\n },\n subject: {\n type: \"user\",\n id: \"1\"\n }\n}).then((response) => {\n console.log(response);\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/permissions/subject-permission' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\":{\n \"snap_token\": \"\",\n \"schema_version\": \"\",\n \"only_permission\": true,\n \"depth\": 20\n },\n \"entity\": {\n \"type\": \"repository\",\n \"id\": \"1\"\n },\n \"subject\": {\n \"type\": \"user\",\n \"id\": \"1\",\n \"relation\": \"\"\n }\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/permissions/subject-permission", body: "*" } }, I: PermissionSubjectPermissionRequest, O: PermissionSubjectPermissionResponse } +]); +/** + * @generated ServiceType for protobuf service base.v1.Watch + */ +export const Watch = new ServiceType("base.v1.Watch", [ + { name: "Watch", serverStreaming: true, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Watch"], summary: "watch changes", operationId: "watch.watch", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "cr, err := client.Watch.Watch(context.Background(), &v1.WatchRequest{\n TenantId: \"t1\",\n SnapToken: \"\",\n})\n// handle stream response\nfor {\n res, err := cr.Recv()\n\n if err == io.EOF {\n break\n }\n\n // res.Changes\n}\n" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "const permify = require(\"@permify/permify-node\");\nconst {WatchResponse} = require(\"@permify/permify-node/dist/src/grpc/generated/base/v1/service\");\n\nfunction main() {\n const client = new permify.grpc.newClient({\n endpoint: \"localhost:3478\",\n });\n\n let res = client.watch.watch({\n tenantId: \"t1\",\n snapToken: \"\"\n });\n\n handle(res);\n}\n\nasync function handle(res: AsyncIterable) {\n for await (const response of res) {\n // response.changes\n }\n}\n" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/watch", body: "*" } }, I: WatchRequest, O: WatchResponse } +]); +/** + * @generated ServiceType for protobuf service base.v1.Schema + */ +export const Schema = new ServiceType("base.v1.Schema", [ + { name: "Write", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Schema"], summary: "write schema", operationId: "schemas.write", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "sr, err := client.Schema.Write(context.Background(), &v1.SchemaWriteRequest{\n TenantId: \"t1\",\n Schema: `\n entity user {}\n\n entity organization {\n relation admin @user\n relation member @user\n\n action create_repository = (admin or member)\n action delete = admin\n }\n\n entity repository {\n relation owner @user\n relation parent @organization\n\n action push = owner\n action read = (owner and (parent.admin and parent.member))\n action delete = (parent.member and (parent.admin or owner))\n }\n `,\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.schema.write({\n tenantId: \"t1\",\n schema: `\n entity user {}\n\n entity organization {\n relation admin @user\n relation member @user\n\n action create_repository = (admin or member)\n action delete = admin\n }\n\n entity repository {\n relation owner @user\n relation parent @organization\n\n action push = owner\n action read = (owner and (parent.admin and parent.member))\n action delete = (parent.member and (parent.admin or owner))\n }\n `\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/schemas/write' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"schema\": \"entity user {}\\n\\n entity organization {\\n\\n relation admin @user\\n relation member @user\\n\\n action create_repository = (admin or member)\\n action delete = admin\\n }\\n\\n entity repository {\\n\\n relation owner @user\\n relation parent @organization\\n\\n action push = owner\\n action read = (owner and (parent.admin and parent.member))\\n action delete = (parent.member and (parent.admin or owner))\\n }\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/schemas/write", body: "*" } }, I: SchemaWriteRequest, O: SchemaWriteResponse }, + { name: "PartialWrite", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Schema"], summary: "partially update your authorization model", operationId: "schemas.partial-write" }, "google.api.http": { patch: "/v1/tenants/{tenant_id}/schemas/partial-write", body: "*" } }, I: SchemaPartialWriteRequest, O: SchemaPartialWriteResponse }, + { name: "Read", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Schema"], summary: "read schema", operationId: "schemas.read", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "sr, err := client.Schema.Read(context.Background(), &v1.SchemaReadRequest{\n TenantId: \"t1\",\n Metadata: &v1.SchemaReadRequestMetadata{\n SchemaVersion: \"cnbe6se5fmal18gpc66g\",\n },\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "let res = client.schema.read({\n tenantId: \"t1\",\n metadata: {\n schemaVersion: swResponse.schemaVersion,\n },\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/schemas/read' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\": {\n \"schema_version\": \"cnbe6se5fmal18gpc66g\"\n }\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/schemas/read", body: "*" } }, I: SchemaReadRequest, O: SchemaReadResponse }, + { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Schema"], summary: "list schema", operationId: "schemas.list", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "sr, err := client.Schema.List(context.Background(), &v1.SchemaListRequest{\n TenantId: \"t1\",\n PageSize: 20,\n ContinuousToken: \"\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "let res = client.schema.list({\n tenantId: \"t1\",\n continuousToken: \"\"\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/schemas/list' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"page_size\": 20,\n \"continuous_token\": \"\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/schemas/list", body: "*" } }, I: SchemaListRequest, O: SchemaListResponse } +]); +/** + * @generated ServiceType for protobuf service base.v1.Data + */ +export const Data = new ServiceType("base.v1.Data", [ + { name: "Write", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Data"], summary: "write data", operationId: "data.write", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "// Convert the wrapped attribute value into Any proto message\nvalue, err := anypb.New(&v1.BooleanValue{\n Data: true,\n})\nif err != nil {\n // Handle error\n}\n\ncr, err := client.Data.Write(context.Background(), &v1.DataWriteRequest{\n TenantId: \"t1\",\n Metadata: &v1.DataWriteRequestMetadata{\n SchemaVersion: \"\",\n },\n Tuples: []*v1.Tuple{\n {\n Entity: &v1.Entity{\n Type: \"document\",\n Id: \"1\",\n },\n Relation: \"editor\",\n Subject: &v1.Subject{\n Type: \"user\",\n Id: \"1\",\n Relation: \"\",\n },\n },\n },\n Attributes: []*v1.Attribute{\n {\n Entity: &v1.Entity{\n Type: \"document\",\n Id: \"1\",\n },\n Attribute: \"is_private\",\n Value: value,\n },\n },\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "const booleanValue = BooleanValue.fromJSON({ data: true });\n\nconst value = Any.fromJSON({\n typeUrl: 'type.googleapis.com/base.v1.BooleanValue',\n value: BooleanValue.encode(booleanValue).finish()\n});\n\nclient.data.write({\n tenantId: \"t1\",\n metadata: {\n schemaVersion: \"\"\n },\n tuples: [{\n entity: {\n type: \"document\",\n id: \"1\"\n },\n relation: \"editor\",\n subject: {\n type: \"user\",\n id: \"1\"\n }\n }],\n attributes: [{\n entity: {\n type: \"document\",\n id: \"1\"\n },\n attribute: \"is_private\",\n value: value,\n }]\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/write' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"metadata\": {\n \"schema_version\": \"\"\n },\n \"tuples\": [\n {\n \"entity\": {\n \"type\": \"document\",\n \"id\": \"1\"\n },\n \"relation\": \"editor\",\n \"subject\": {\n \"type\": \"user\",\n \"id\": \"1\"\n }\n }\n ],\n \"attributes\": [\n {\n \"entity\": {\n \"type\": \"document\",\n \"id\": \"1\"\n },\n \"attribute\": \"is_private\",\n \"value\": {\n \"@type\": \"type.googleapis.com/base.v1.BooleanValue\",\n \"data\": true\n }\n }\n ]\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/data/write", body: "*" } }, I: DataWriteRequest, O: DataWriteResponse }, + { name: "WriteRelationships", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Data"], summary: "write relationships", operationId: "relationships.write" }, "google.api.http": { post: "/v1/tenants/{tenant_id}/relationships/write", body: "*" } }, I: RelationshipWriteRequest, O: RelationshipWriteResponse }, + { name: "ReadRelationships", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Data"], summary: "read relationships", operationId: "data.relationships.read", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Data.ReadRelationships(context.Background(), &v1.Data.RelationshipReadRequest{\n TenantId: \"t1\",\n Metadata: &v1.Data.RelationshipReadRequestMetadata{\n SnapToken: \"\"\n },\n Filter: &v1.TupleFilter{\n Entity: &v1.EntityFilter{\n Type: \"organization\",\n Ids: []string{\"1\"},\n },\n Relation: \"member\",\n Subject: &v1.SubjectFilter{\n Type: \"\",\n Id: []string{\"\"},\n Relation: \"\"\n }\n }\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.data.readRelationships({\n tenantId: \"t1\",\n metadata: {\n snap_token: \"\",\n },\n filter: {\n entity: {\n type: \"organization\",\n ids: [\n \"1\"\n ]\n },\n relation: \"member\",\n subject: {\n type: \"\",\n ids: [],\n relation: \"\"\n }\n }\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/relationships/read' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n metadata: {\n snap_token: \"\",\n },\n filter: {\n entity: {\n type: \"organization\",\n ids: [\n \"1\"\n ]\n },\n relation: \"member\",\n subject: {\n type: \"\",\n ids: [],\n relation: \"\"\n }\n }\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/data/relationships/read", body: "*" } }, I: RelationshipReadRequest, O: RelationshipReadResponse }, + { name: "ReadAttributes", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Data"], summary: "read attributes", operationId: "data.attributes.read", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Data.ReadAttributes(context.Background(), &v1.Data.AttributeReadRequest{\n TenantId: \"t1\",\n Metadata: &v1.Data.AttributeReadRequestMetadata{\n SnapToken: \"\",\n },\n Filter: &v1.AttributeFilter{\n Entity: &v1.EntityFilter{\n Type: \"organization\",\n Ids: []string{\"1\"},\n },\n Attributes: []string{\"private\"},\n },\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.data.readAttributes({\n tenantId: \"t1\",\n metadata: {\n snap_token: \"\",\n },\n filter: {\n entity: {\n type: \"organization\",\n ids: [\n \"1\"\n ]\n },\n attributes: [\n \"private\"\n ],\n }\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/attributes/read' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n metadata: {\n snap_token: \"\",\n },\n filter: {\n entity: {\n type: \"organization\",\n ids: [\n \"1\"\n ]\n },\n attributes: [\n \"private\"\n ],\n }\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/data/attributes/read", body: "*" } }, I: AttributeReadRequest, O: AttributeReadResponse }, + { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Data"], summary: "delete data", operationId: "data.delete", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Data.Delete(context.Background(), &v1.DataDeleteRequest{\n TenantId: \"t1\",\n Metadata: &v1.DataDeleteRequestMetadata{\n SnapToken: \"\",\n },\n TupleFilter: &v1.TupleFilter{\n Entity: &v1.EntityFilter{\n Type: \"organization\",\n Ids: []string{\"1\"},\n },\n Relation: \"admin\",\n Subject: &v1.SubjectFilter{\n Type: \"user\",\n Id: []string{\"1\"},\n Relation: \"\"\n }\n }\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.data.delete({\n tenantId: \"t1\",\n metadata: {\n snap_token: \"\",\n },\n tupleFilter: {\n entity: {\n type: \"organization\",\n ids: [\n \"1\"\n ]\n },\n relation: \"admin\",\n subject: {\n type: \"user\",\n ids: [\n \"1\"\n ],\n relation: \"\"\n }\n }\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/delete' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"tuple_filter\": {\n \"entity\": {\n \"type\": \"organization\",\n \"ids\": [\n \"1\"\n ]\n },\n \"relation\": \"admin\",\n \"subject\": {\n \"type\": \"user\",\n \"ids\": [\n \"1\"\n ],\n \"relation\": \"\"\n }\n },\n \"attribute_filter\": {}\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/data/delete", body: "*" } }, I: DataDeleteRequest, O: DataDeleteResponse }, + { name: "DeleteRelationships", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Data"], summary: "delete relationships", operationId: "relationships.delete" }, "google.api.http": { post: "/v1/tenants/{tenant_id}/relationships/delete", body: "*" } }, I: RelationshipDeleteRequest, O: RelationshipDeleteResponse }, + { name: "RunBundle", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Data"], summary: "run bundle", operationId: "bundle.run", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Data.RunBundle(context.Background(), &v1.BundleRunRequest{\n TenantId: \"t1\",\n Name: \"organization_created\",\n Arguments: map[string]string{\n \"creatorID\": \"564\",\n \"organizationID\": \"789\",\n },\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.data.runBundle({\n tenantId: \"t1\",\n name: \"organization_created\",\n arguments: {\n creatorID: \"564\",\n organizationID: \"789\",\n }\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/data/run-bundle' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"organization_created\",\n \"arguments\": {\n \"creatorID\": \"564\",\n \"organizationID\": \"789\"\n }\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/data/run-bundle", body: "*" } }, I: BundleRunRequest, O: BundleRunResponse } +]); +/** + * @generated ServiceType for protobuf service base.v1.Bundle + */ +export const Bundle = new ServiceType("base.v1.Bundle", [ + { name: "Write", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Bundle"], summary: "write bundle", operationId: "bundle.write", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Bundle.Write(context.Background(), &v1.BundleWriteRequest{\n TenantId: \"t1\",\n Bundles: []*v1.DataBundle{\n {\n Name: \"organization_created\",\n Arguments: []string{\n \"creatorID\",\n \"organizationID\",\n },\n Operations: []*v1.Operation{\n {\n RelationshipsWrite: []string{\n \"organization:{{.organizationID}}#admin@user:{{.creatorID}}\",\n \"organization:{{.organizationID}}#manager@user:{{.creatorID}}\",\n },\n AttributesWrite: []string{\n \"organization:{{.organizationID}}$public|boolean:false\",\n },\n },\n },\n },\n },\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.bundle.write({\n tenantId: \"t1\",\n bundles: [\n {\n name: \"organization_created\",\n arguments: [\n \"creatorID\",\n \"organizationID\",\n ],\n operations: [\n {\n relationships_write: [\n \"organization:{{.organizationID}}#admin@user:{{.creatorID}}\",\n \"organization:{{.organizationID}}#manager@user:{{.creatorID}}\",\n ],\n attributes_write: [\n \"organization:{{.organizationID}}$public|boolean:false\",\n ]\n }\n ]\n }\n ]\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/bundle/write' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"bundles\": [\n {\n \"name\": \"organization_created\",\n \"arguments\": [\n \"creatorID\",\n \"organizationID\"\n ],\n \"operations\": [\n {\n \"relationships_write\": [\n \"organization:{{.organizationID}}#admin@user:{{.creatorID}}\",\n \"organization:{{.organizationID}}#manager@user:{{.creatorID}}\"\n ],\n \"attributes_write\": [\n \"organization:{{.organizationID}}$public|boolean:false\"\n ]\n }\n ]\n }\n ]\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/bundle/write", body: "*" } }, I: BundleWriteRequest, O: BundleWriteResponse }, + { name: "Read", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Bundle"], summary: "read bundle", operationId: "bundle.read", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Bundle.Read(context.Background(), &v1.BundleReadRequest{\n TenantId: \"t1\",\n Name: \"organization_created\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.bundle.read({\n tenantId: \"t1\",\n name: \"organization_created\",\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/bundle/read' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"organization_created\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/bundle/read", body: "*" } }, I: BundleReadRequest, O: BundleReadResponse }, + { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Bundle"], summary: "delete bundle", operationId: "bundle.delete", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Bundle.Delete(context.Background(), &v1.BundleDeleteRequest{\n TenantId: \"t1\",\n Name: \"organization_created\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.bundle.delete({\n tenantId: \"t1\",\n name: \"organization_created\",\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/{tenant_id}/bundle/delete' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"name\": \"organization_created\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/{tenant_id}/bundle/delete", body: "*" } }, I: BundleDeleteRequest, O: BundleDeleteResponse } +]); +/** + * @generated ServiceType for protobuf service base.v1.Tenancy + */ +export const Tenancy = new ServiceType("base.v1.Tenancy", [ + { name: "Create", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Tenancy"], summary: "create tenant", operationId: "tenants.create", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Tenancy.Create(context.Background(), &v1.TenantCreateRequest{\n Id: \"\",\n Name: \"\"\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.tenancy.create({\n id: \"\",\n name: \"\"\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'http://localhost:3476/v1/tenants/create' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"id\": \"\",\n \"name\": \"\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/create", body: "*" } }, I: TenantCreateRequest, O: TenantCreateResponse }, + { name: "Delete", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Tenancy"], summary: "delete tenant", operationId: "tenants.delete", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "rr, err := client.Tenancy.Delete(context.Background(), &v1.TenantDeleteRequest{\n Id: \"\"\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "client.tenancy.delete({\n id: \"\",\n}).then((response) => {\n // handle response\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request DELETE 'http://localhost:3476/v1/tenants/t1'" } } } }] } } } }, "google.api.http": { delete: "/v1/tenants/{id}" } }, I: TenantDeleteRequest, O: TenantDeleteResponse }, + { name: "List", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Tenancy"], summary: "list tenants", operationId: "tenants.list", extensions: { "x-codeSamples": { listValue: { values: [{ structValue: { fields: { label: { stringValue: "go" }, lang: { stringValue: "go" }, source: { stringValue: "cr, err := client.Tenancy.List(context.Background(), &v1.TenantListRequest{\n PageSize: 20,\n ContinuousToken: \"\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "node" }, lang: { stringValue: "javascript" }, source: { stringValue: "let res = client.tenancy.list({\n pageSize: 20,\n continuousToken: \"\",\n})" } } } }, { structValue: { fields: { label: { stringValue: "cURL" }, lang: { stringValue: "curl" }, source: { stringValue: "curl --location --request POST 'localhost:3476/v1/tenants/list' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"page_size\": 20,\n \"continuous_token\": \"\"\n}'" } } } }] } } } }, "google.api.http": { post: "/v1/tenants/list", body: "*" } }, I: TenantListRequest, O: TenantListResponse } +]); diff --git a/src/grpc/generated/google/api/expr/v1alpha1/checked.ts b/src/grpc/generated/google/api/expr/v1alpha1/checked.ts index 8b53adf..cdeb204 100644 --- a/src/grpc/generated/google/api/expr/v1alpha1/checked.ts +++ b/src/grpc/generated/google/api/expr/v1alpha1/checked.ts @@ -1,352 +1,443 @@ -// 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"; +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/api/expr/v1alpha1/checked.proto" (package "google.api.expr.v1alpha1", syntax proto3) +// tslint:disable +// +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { Constant } from "./syntax"; +import { NullValue } from "../../../protobuf/struct"; 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"; +import { Expr } from "./syntax"; +import { SourceInfo } from "./syntax"; +// Protos for representing CEL declarations and typed checked expressions. -/** A CEL expression which has been successfully type checked. */ +/** + * A CEL expression which has been successfully type checked. + * + * @generated from protobuf message google.api.expr.v1alpha1.CheckedExpr + */ 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. + * A map from expression ids to resolved references. * - * The `message_type` string specifies the qualified message type name. For - * example, `google.plus.Profile`. + * 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. + * + * @generated from protobuf field: map reference_map = 2; */ - { $case: "messageType"; messageType: string } - | // + referenceMap: { + [key: string]: Reference; + }; /** - * Type param type. + * A map from expression ids to types. * - * 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`. + * 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. + * + * @generated from protobuf field: map type_map = 3; */ - { $case: "typeParam"; typeParam: string } - | // + typeMap: { + [key: string]: Type; + }; /** - * Type type. + * The source info derived from input that generated the parsed `expr` and + * any optimizations made during the type-checking pass. * - * The `type` value specifies the target type. e.g. int is type with a - * target type of `Primitive.INT`. + * @generated from protobuf field: google.api.expr.v1alpha1.SourceInfo source_info = 5; */ - { $case: "type"; type: Type } - | // + sourceInfo?: SourceInfo; /** - * Error type. + * The expr version indicates the major / minor version number of the `expr` + * representation. * - * 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. + * 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. + * + * @generated from protobuf field: string expr_version = 6; */ - { $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; - } + exprVersion: string; + /** + * The checked expression. Semantically equivalent to the parsed `expr`, but + * may have structural differences. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr expr = 4; + */ + expr?: Expr; } - -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"; - } +/** + * Represents a CEL type. + * + * @generated from protobuf message google.api.expr.v1alpha1.Type + */ +export interface Type { + /** + * @generated from protobuf oneof: type_kind + */ + typeKind: { + oneofKind: "dyn"; + /** + * Dynamic type. + * + * @generated from protobuf field: google.protobuf.Empty dyn = 1; + */ + dyn: Empty; + } | { + oneofKind: "null"; + /** + * Null value. + * + * @generated from protobuf field: google.protobuf.NullValue null = 2; + */ + null: NullValue; + } | { + oneofKind: "primitive"; + /** + * Primitive types: `true`, `1u`, `-2.0`, `'string'`, `b'bytes'`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type.PrimitiveType primitive = 3; + */ + primitive: Type_PrimitiveType; + } | { + oneofKind: "wrapper"; + /** + * Wrapper of a primitive type, e.g. `google.protobuf.Int64Value`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type.PrimitiveType wrapper = 4; + */ + wrapper: Type_PrimitiveType; + } | { + oneofKind: "wellKnown"; + /** + * Well-known protobuf type such as `google.protobuf.Timestamp`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type.WellKnownType well_known = 5; + */ + wellKnown: Type_WellKnownType; + } | { + oneofKind: "listType"; + /** + * Parameterized list with elements of `list_type`, e.g. `list`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type.ListType list_type = 6; + */ + listType: Type_ListType; + } | { + oneofKind: "mapType"; + /** + * Parameterized map with typed keys and values. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type.MapType map_type = 7; + */ + mapType: Type_MapType; + } | { + oneofKind: "function"; + /** + * Function type. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type.FunctionType function = 8; + */ + function: Type_FunctionType; + } | { + oneofKind: "messageType"; + /** + * Protocol buffer message type. + * + * The `message_type` string specifies the qualified message type name. For + * example, `google.plus.Profile`. + * + * @generated from protobuf field: string message_type = 9; + */ + messageType: string; + } | { + oneofKind: "typeParam"; + /** + * 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`. + * + * @generated from protobuf field: string type_param = 10; + */ + typeParam: string; + } | { + oneofKind: "type"; + /** + * Type type. + * + * The `type` value specifies the target type. e.g. int is type with a + * target type of `Primitive.INT`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type type = 11; + */ + type: Type; + } | { + oneofKind: "error"; + /** + * 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. + * + * @generated from protobuf field: google.protobuf.Empty error = 12; + */ + error: Empty; + } | { + oneofKind: "abstractType"; + /** + * Abstract, application defined type. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type.AbstractType abstract_type = 14; + */ + abstractType: Type_AbstractType; + } | { + oneofKind: undefined; + }; } - -/** List type with typed elements, e.g. `list`. */ +/** + * List type with typed elements, e.g. `list`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Type.ListType + */ export interface Type_ListType { - /** The element type. */ - elemType: Type | undefined; + /** + * The element type. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type elem_type = 1; + */ + elemType?: Type; } - -/** Map type with parameterized key and value types, e.g. `map`. */ +/** + * Map type with parameterized key and value types, e.g. `map`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Type.MapType + */ export interface Type_MapType { - /** The type of the key. */ - keyType: - | Type - | undefined; - /** The type of the value. */ - valueType: Type | undefined; + /** + * The type of the key. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type key_type = 1; + */ + keyType?: Type; + /** + * The type of the value. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type value_type = 2; + */ + valueType?: Type; } - -/** Function type with result and arg types. */ +/** + * Function type with result and arg types. + * + * @generated from protobuf message google.api.expr.v1alpha1.Type.FunctionType + */ export interface Type_FunctionType { - /** Result type of the function. */ - resultType: - | Type - | undefined; - /** Argument types of the function. */ - argTypes: Type[]; + /** + * Result type of the function. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type result_type = 1; + */ + resultType?: Type; + /** + * Argument types of the function. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.Type arg_types = 2; + */ + argTypes: Type[]; } - -/** Application defined abstract type. */ +/** + * Application defined abstract type. + * + * @generated from protobuf message google.api.expr.v1alpha1.Type.AbstractType + */ export interface Type_AbstractType { - /** The fully qualified name of this abstract type. */ - name: string; - /** Parameter types for this abstract type. */ - parameterTypes: Type[]; + /** + * The fully qualified name of this abstract type. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * Parameter types for this abstract type. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.Type parameter_types = 2; + */ + parameterTypes: Type[]; +} +/** + * CEL primitive types. + * + * @generated from protobuf enum google.api.expr.v1alpha1.Type.PrimitiveType + */ +export enum Type_PrimitiveType { + /** + * Unspecified type. + * + * @generated from protobuf enum value: PRIMITIVE_TYPE_UNSPECIFIED = 0; + */ + PRIMITIVE_TYPE_UNSPECIFIED = 0, + /** + * Boolean type. + * + * @generated from protobuf enum value: BOOL = 1; + */ + BOOL = 1, + /** + * Int64 type. + * + * Proto-based integer values are widened to int64. + * + * @generated from protobuf enum value: INT64 = 2; + */ + INT64 = 2, + /** + * Uint64 type. + * + * Proto-based unsigned integer values are widened to uint64. + * + * @generated from protobuf enum value: UINT64 = 3; + */ + UINT64 = 3, + /** + * Double type. + * + * Proto-based float values are widened to double values. + * + * @generated from protobuf enum value: DOUBLE = 4; + */ + DOUBLE = 4, + /** + * String type. + * + * @generated from protobuf enum value: STRING = 5; + */ + STRING = 5, + /** + * Bytes type. + * + * @generated from protobuf enum value: BYTES = 6; + */ + BYTES = 6 +} +/** + * Well-known protobuf types treated with first-class support in CEL. + * + * @generated from protobuf enum google.api.expr.v1alpha1.Type.WellKnownType + */ +export enum Type_WellKnownType { + /** + * Unspecified type. + * + * @generated from protobuf enum value: WELL_KNOWN_TYPE_UNSPECIFIED = 0; + */ + WELL_KNOWN_TYPE_UNSPECIFIED = 0, + /** + * 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. + * + * @generated from protobuf enum value: ANY = 1; + */ + ANY = 1, + /** + * Well-known protobuf.Timestamp type, internally referenced as `timestamp`. + * + * @generated from protobuf enum value: TIMESTAMP = 2; + */ + TIMESTAMP = 2, + /** + * Well-known protobuf.Duration type, internally referenced as `duration`. + * + * @generated from protobuf enum value: DURATION = 3; + */ + DURATION = 3 } - /** * 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. + * + * @generated from protobuf message google.api.expr.v1alpha1.Decl */ 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; + /** + * 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]. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * @generated from protobuf oneof: decl_kind + */ + declKind: { + oneofKind: "ident"; + /** + * Identifier declaration. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Decl.IdentDecl ident = 2; + */ + ident: Decl_IdentDecl; + } | { + oneofKind: "function"; + /** + * Function declaration. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Decl.FunctionDecl function = 3; + */ + function: Decl_FunctionDecl; + } | { + oneofKind: undefined; + }; } - /** * Identifier declaration which specifies its type and optional `Expr` value. * @@ -354,35 +445,47 @@ export interface Decl { * 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. + * + * @generated from protobuf message google.api.expr.v1alpha1.Decl.IdentDecl */ 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; + /** + * Required. The type of the identifier. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type type = 1; + */ + type?: Type; + /** + * The constant value of the identifier. If not specified, the identifier + * must be supplied at evaluation time. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Constant value = 2; + */ + value?: Constant; + /** + * Documentation string for the identifier. + * + * @generated from protobuf field: string doc = 3; + */ + 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). + * + * @generated from protobuf message google.api.expr.v1alpha1.Decl.FunctionDecl */ export interface Decl_FunctionDecl { - /** Required. List of function overloads, must contain at least one overload. */ - overloads: Decl_FunctionDecl_Overload[]; + /** + * Required. List of function overloads, must contain at least one overload. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.Decl.FunctionDecl.Overload overloads = 1; + */ + 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 @@ -394,1557 +497,913 @@ export interface Decl_FunctionDecl { * * Overloads must have non-overlapping argument types after erasure of all * parameterized type variables (similar as type erasure in Java). + * + * @generated from protobuf message google.api.expr.v1alpha1.Decl.FunctionDecl.Overload */ 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; + /** + * 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`. + * + * @generated from protobuf field: string overload_id = 1; + */ + 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. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.Type params = 2; + */ + 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`. + * + * @generated from protobuf field: repeated string type_params = 3; + */ + typeParams: string[]; + /** + * Required. The result type of the function. For example, the operator + * `string.isEmpty()` would have `result_type` of `kind: BOOL`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Type result_type = 4; + */ + resultType?: Type; + /** + * 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. + * + * @generated from protobuf field: bool is_instance_function = 5; + */ + isInstanceFunction: boolean; + /** + * Documentation string for the overload. + * + * @generated from protobuf field: string doc = 6; + */ + doc: string; } - -/** Describes a resolved reference to a declaration. */ +/** + * Describes a resolved reference to a declaration. + * + * @generated from protobuf message google.api.expr.v1alpha1.Reference + */ 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 }; + /** + * The fully qualified name of the declaration. + * + * @generated from protobuf field: string name = 1; + */ + 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]. + * + * @generated from protobuf field: repeated string overload_id = 3; + */ + overloadId: string[]; + /** + * For references to constants, this may contain the value of the + * constant if known at compile time. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Constant value = 4; + */ + value?: Constant; } - -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; +// @generated message type with reflection information, may provide speed optimized methods +class CheckedExpr$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.CheckedExpr", [ + { no: 2, name: "reference_map", kind: "map", K: 3 /*ScalarType.INT64*/, V: { kind: "message", T: () => Reference } }, + { no: 3, name: "type_map", kind: "map", K: 3 /*ScalarType.INT64*/, V: { kind: "message", T: () => Type } }, + { no: 5, name: "source_info", kind: "message", T: () => SourceInfo }, + { no: 6, name: "expr_version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "expr", kind: "message", T: () => Expr } + ]); + } + create(value?: PartialMessage): CheckedExpr { + const message = { referenceMap: {}, typeMap: {}, exprVersion: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CheckedExpr): CheckedExpr { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map reference_map */ 2: + this.binaryReadMap2(message.referenceMap, reader, options); + break; + case /* map type_map */ 3: + this.binaryReadMap3(message.typeMap, reader, options); + break; + case /* google.api.expr.v1alpha1.SourceInfo source_info */ 5: + message.sourceInfo = SourceInfo.internalBinaryRead(reader, reader.uint32(), options, message.sourceInfo); + break; + case /* string expr_version */ 6: + message.exprVersion = reader.string(); + break; + case /* google.api.expr.v1alpha1.Expr expr */ 4: + message.expr = Expr.internalBinaryRead(reader, reader.uint32(), options, message.expr); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - 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; + return message; + } + private binaryReadMap2(map: CheckedExpr["referenceMap"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof CheckedExpr["referenceMap"] | undefined, val: CheckedExpr["referenceMap"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.int64().toString(); + break; + case 2: + val = Reference.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field google.api.expr.v1alpha1.CheckedExpr.reference_map"); + } } - case 5: { - if (tag !== 42) { - break; - } - - message.sourceInfo = SourceInfo.decode(reader, reader.uint32()); - continue; + map[key ?? "0"] = val ?? Reference.create(); + } + private binaryReadMap3(map: CheckedExpr["typeMap"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof CheckedExpr["typeMap"] | undefined, val: CheckedExpr["typeMap"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.int64().toString(); + break; + case 2: + val = Type.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field google.api.expr.v1alpha1.CheckedExpr.type_map"); + } } - case 6: { - if (tag !== 50) { - break; - } - - message.exprVersion = reader.string(); - continue; + map[key ?? "0"] = val ?? Type.create(); + } + internalBinaryWrite(message: CheckedExpr, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map reference_map = 2; */ + for (let k of Object.keys(message.referenceMap)) { + writer.tag(2, WireType.LengthDelimited).fork().tag(1, WireType.Varint).int64(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Reference.internalBinaryWrite(message.referenceMap[k], writer, options); + writer.join().join(); } - case 4: { - if (tag !== 34) { - break; - } - - message.expr = Expr.decode(reader, reader.uint32()); - continue; + /* map type_map = 3; */ + for (let k of Object.keys(message.typeMap)) { + writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.Varint).int64(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Type.internalBinaryWrite(message.typeMap[k], writer, options); + writer.join().join(); } - } - 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); - }); + /* google.api.expr.v1alpha1.SourceInfo source_info = 5; */ + if (message.sourceInfo) + SourceInfo.internalBinaryWrite(message.sourceInfo, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* string expr_version = 6; */ + if (message.exprVersion !== "") + writer.tag(6, WireType.LengthDelimited).string(message.exprVersion); + /* google.api.expr.v1alpha1.Expr expr = 4; */ + if (message.expr) + Expr.internalBinaryWrite(message.expr, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.CheckedExpr + */ +export const CheckedExpr = new CheckedExpr$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Type$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Type", [ + { no: 1, name: "dyn", kind: "message", oneof: "typeKind", T: () => Empty }, + { no: 2, name: "null", kind: "enum", oneof: "typeKind", T: () => ["google.protobuf.NullValue", NullValue] }, + { no: 3, name: "primitive", kind: "enum", oneof: "typeKind", T: () => ["google.api.expr.v1alpha1.Type.PrimitiveType", Type_PrimitiveType] }, + { no: 4, name: "wrapper", kind: "enum", oneof: "typeKind", T: () => ["google.api.expr.v1alpha1.Type.PrimitiveType", Type_PrimitiveType] }, + { no: 5, name: "well_known", kind: "enum", oneof: "typeKind", T: () => ["google.api.expr.v1alpha1.Type.WellKnownType", Type_WellKnownType] }, + { no: 6, name: "list_type", kind: "message", oneof: "typeKind", T: () => Type_ListType }, + { no: 7, name: "map_type", kind: "message", oneof: "typeKind", T: () => Type_MapType }, + { no: 8, name: "function", kind: "message", oneof: "typeKind", T: () => Type_FunctionType }, + { no: 9, name: "message_type", kind: "scalar", oneof: "typeKind", T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "type_param", kind: "scalar", oneof: "typeKind", T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "type", kind: "message", oneof: "typeKind", T: () => Type }, + { no: 12, name: "error", kind: "message", oneof: "typeKind", T: () => Empty }, + { no: 14, name: "abstract_type", kind: "message", oneof: "typeKind", T: () => Type_AbstractType } + ]); + } + create(value?: PartialMessage): Type { + const message = { typeKind: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Type): Type { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.Empty dyn */ 1: + message.typeKind = { + oneofKind: "dyn", + dyn: Empty.internalBinaryRead(reader, reader.uint32(), options, (message.typeKind as any).dyn) + }; + break; + case /* google.protobuf.NullValue null */ 2: + message.typeKind = { + oneofKind: "null", + null: reader.int32() + }; + break; + case /* google.api.expr.v1alpha1.Type.PrimitiveType primitive */ 3: + message.typeKind = { + oneofKind: "primitive", + primitive: reader.int32() + }; + break; + case /* google.api.expr.v1alpha1.Type.PrimitiveType wrapper */ 4: + message.typeKind = { + oneofKind: "wrapper", + wrapper: reader.int32() + }; + break; + case /* google.api.expr.v1alpha1.Type.WellKnownType well_known */ 5: + message.typeKind = { + oneofKind: "wellKnown", + wellKnown: reader.int32() + }; + break; + case /* google.api.expr.v1alpha1.Type.ListType list_type */ 6: + message.typeKind = { + oneofKind: "listType", + listType: Type_ListType.internalBinaryRead(reader, reader.uint32(), options, (message.typeKind as any).listType) + }; + break; + case /* google.api.expr.v1alpha1.Type.MapType map_type */ 7: + message.typeKind = { + oneofKind: "mapType", + mapType: Type_MapType.internalBinaryRead(reader, reader.uint32(), options, (message.typeKind as any).mapType) + }; + break; + case /* google.api.expr.v1alpha1.Type.FunctionType function */ 8: + message.typeKind = { + oneofKind: "function", + function: Type_FunctionType.internalBinaryRead(reader, reader.uint32(), options, (message.typeKind as any).function) + }; + break; + case /* string message_type */ 9: + message.typeKind = { + oneofKind: "messageType", + messageType: reader.string() + }; + break; + case /* string type_param */ 10: + message.typeKind = { + oneofKind: "typeParam", + typeParam: reader.string() + }; + break; + case /* google.api.expr.v1alpha1.Type type */ 11: + message.typeKind = { + oneofKind: "type", + type: Type.internalBinaryRead(reader, reader.uint32(), options, (message.typeKind as any).type) + }; + break; + case /* google.protobuf.Empty error */ 12: + message.typeKind = { + oneofKind: "error", + error: Empty.internalBinaryRead(reader, reader.uint32(), options, (message.typeKind as any).error) + }; + break; + case /* google.api.expr.v1alpha1.Type.AbstractType abstract_type */ 14: + message.typeKind = { + oneofKind: "abstractType", + abstractType: Type_AbstractType.internalBinaryRead(reader, reader.uint32(), options, (message.typeKind as any).abstractType) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; + } + internalBinaryWrite(message: Type, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.protobuf.Empty dyn = 1; */ + if (message.typeKind.oneofKind === "dyn") + Empty.internalBinaryWrite(message.typeKind.dyn, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.NullValue null = 2; */ + if (message.typeKind.oneofKind === "null") + writer.tag(2, WireType.Varint).int32(message.typeKind.null); + /* google.api.expr.v1alpha1.Type.PrimitiveType primitive = 3; */ + if (message.typeKind.oneofKind === "primitive") + writer.tag(3, WireType.Varint).int32(message.typeKind.primitive); + /* google.api.expr.v1alpha1.Type.PrimitiveType wrapper = 4; */ + if (message.typeKind.oneofKind === "wrapper") + writer.tag(4, WireType.Varint).int32(message.typeKind.wrapper); + /* google.api.expr.v1alpha1.Type.WellKnownType well_known = 5; */ + if (message.typeKind.oneofKind === "wellKnown") + writer.tag(5, WireType.Varint).int32(message.typeKind.wellKnown); + /* google.api.expr.v1alpha1.Type.ListType list_type = 6; */ + if (message.typeKind.oneofKind === "listType") + Type_ListType.internalBinaryWrite(message.typeKind.listType, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Type.MapType map_type = 7; */ + if (message.typeKind.oneofKind === "mapType") + Type_MapType.internalBinaryWrite(message.typeKind.mapType, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Type.FunctionType function = 8; */ + if (message.typeKind.oneofKind === "function") + Type_FunctionType.internalBinaryWrite(message.typeKind.function, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* string message_type = 9; */ + if (message.typeKind.oneofKind === "messageType") + writer.tag(9, WireType.LengthDelimited).string(message.typeKind.messageType); + /* string type_param = 10; */ + if (message.typeKind.oneofKind === "typeParam") + writer.tag(10, WireType.LengthDelimited).string(message.typeKind.typeParam); + /* google.api.expr.v1alpha1.Type type = 11; */ + if (message.typeKind.oneofKind === "type") + Type.internalBinaryWrite(message.typeKind.type, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Empty error = 12; */ + if (message.typeKind.oneofKind === "error") + Empty.internalBinaryWrite(message.typeKind.error, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Type.AbstractType abstract_type = 14; */ + if (message.typeKind.oneofKind === "abstractType") + Type_AbstractType.internalBinaryWrite(message.typeKind.abstractType, writer.tag(14, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Type + */ +export const Type = new Type$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Type_ListType$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Type.ListType", [ + { no: 1, name: "elem_type", kind: "message", T: () => Type } + ]); + } + create(value?: PartialMessage): Type_ListType { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Type_ListType): Type_ListType { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.api.expr.v1alpha1.Type elem_type */ 1: + message.elemType = Type.internalBinaryRead(reader, reader.uint32(), options, message.elemType); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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; - } + internalBinaryWrite(message: Type_ListType, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.api.expr.v1alpha1.Type elem_type = 1; */ + if (message.elemType) + Type.internalBinaryWrite(message.elemType, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Type.ListType + */ +export const Type_ListType = new Type_ListType$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Type_MapType$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Type.MapType", [ + { no: 1, name: "key_type", kind: "message", T: () => Type }, + { no: 2, name: "value_type", kind: "message", T: () => Type } + ]); + } + create(value?: PartialMessage): Type_MapType { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Type_MapType): Type_MapType { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.api.expr.v1alpha1.Type key_type */ 1: + message.keyType = Type.internalBinaryRead(reader, reader.uint32(), options, message.keyType); + break; + case /* google.api.expr.v1alpha1.Type value_type */ 2: + message.valueType = Type.internalBinaryRead(reader, reader.uint32(), options, message.valueType); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; + } + internalBinaryWrite(message: Type_MapType, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.api.expr.v1alpha1.Type key_type = 1; */ + if (message.keyType) + Type.internalBinaryWrite(message.keyType, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Type value_type = 2; */ + if (message.valueType) + Type.internalBinaryWrite(message.valueType, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Type.MapType + */ +export const Type_MapType = new Type_MapType$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Type_FunctionType$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Type.FunctionType", [ + { no: 1, name: "result_type", kind: "message", T: () => Type }, + { no: 2, name: "arg_types", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Type } + ]); + } + create(value?: PartialMessage): Type_FunctionType { + const message = { argTypes: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Type_FunctionType): Type_FunctionType { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.api.expr.v1alpha1.Type result_type */ 1: + message.resultType = Type.internalBinaryRead(reader, reader.uint32(), options, message.resultType); + break; + case /* repeated google.api.expr.v1alpha1.Type arg_types */ 2: + message.argTypes.push(Type.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; + } + internalBinaryWrite(message: Type_FunctionType, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.api.expr.v1alpha1.Type result_type = 1; */ + if (message.resultType) + Type.internalBinaryWrite(message.resultType, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.api.expr.v1alpha1.Type arg_types = 2; */ + for (let i = 0; i < message.argTypes.length; i++) + Type.internalBinaryWrite(message.argTypes[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Type.FunctionType + */ +export const Type_FunctionType = new Type_FunctionType$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Type_AbstractType$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Type.AbstractType", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "parameter_types", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Type } + ]); + } + create(value?: PartialMessage): Type_AbstractType { + const message = { name: "", parameterTypes: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Type_AbstractType): Type_AbstractType { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.api.expr.v1alpha1.Type parameter_types */ 2: + message.parameterTypes.push(Type.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; + } + internalBinaryWrite(message: Type_AbstractType, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.api.expr.v1alpha1.Type parameter_types = 2; */ + for (let i = 0; i < message.parameterTypes.length; i++) + Type.internalBinaryWrite(message.parameterTypes[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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) }; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Type.AbstractType + */ +export const Type_AbstractType = new Type_AbstractType$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Decl$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Decl", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "ident", kind: "message", oneof: "declKind", T: () => Decl_IdentDecl }, + { no: 3, name: "function", kind: "message", oneof: "declKind", T: () => Decl_FunctionDecl } + ]); + } + create(value?: PartialMessage): Decl { + const message = { name: "", declKind: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Decl): Decl { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* google.api.expr.v1alpha1.Decl.IdentDecl ident */ 2: + message.declKind = { + oneofKind: "ident", + ident: Decl_IdentDecl.internalBinaryRead(reader, reader.uint32(), options, (message.declKind as any).ident) + }; + break; + case /* google.api.expr.v1alpha1.Decl.FunctionDecl function */ 3: + message.declKind = { + oneofKind: "function", + function: Decl_FunctionDecl.internalBinaryRead(reader, reader.uint32(), options, (message.declKind as any).function) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } + return message; + } + internalBinaryWrite(message: Decl, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* google.api.expr.v1alpha1.Decl.IdentDecl ident = 2; */ + if (message.declKind.oneofKind === "ident") + Decl_IdentDecl.internalBinaryWrite(message.declKind.ident, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Decl.FunctionDecl function = 3; */ + if (message.declKind.oneofKind === "function") + Decl_FunctionDecl.internalBinaryWrite(message.declKind.function, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Decl + */ +export const Decl = new Decl$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Decl_IdentDecl$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Decl.IdentDecl", [ + { no: 1, name: "type", kind: "message", T: () => Type }, + { no: 2, name: "value", kind: "message", T: () => Constant }, + { no: 3, name: "doc", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Decl_IdentDecl { + const message = { doc: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Decl_IdentDecl): Decl_IdentDecl { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.api.expr.v1alpha1.Type type */ 1: + message.type = Type.internalBinaryRead(reader, reader.uint32(), options, message.type); + break; + case /* google.api.expr.v1alpha1.Constant value */ 2: + message.value = Constant.internalBinaryRead(reader, reader.uint32(), options, message.value); + break; + case /* string doc */ 3: + message.doc = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; + } + internalBinaryWrite(message: Decl_IdentDecl, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.api.expr.v1alpha1.Type type = 1; */ + if (message.type) + Type.internalBinaryWrite(message.type, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Constant value = 2; */ + if (message.value) + Constant.internalBinaryWrite(message.value, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string doc = 3; */ + if (message.doc !== "") + writer.tag(3, WireType.LengthDelimited).string(message.doc); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Decl.IdentDecl + */ +export const Decl_IdentDecl = new Decl_IdentDecl$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Decl_FunctionDecl$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Decl.FunctionDecl", [ + { no: 1, name: "overloads", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Decl_FunctionDecl_Overload } + ]); + } + create(value?: PartialMessage): Decl_FunctionDecl { + const message = { overloads: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Decl_FunctionDecl): Decl_FunctionDecl { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.api.expr.v1alpha1.Decl.FunctionDecl.Overload overloads */ 1: + message.overloads.push(Decl_FunctionDecl_Overload.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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)); + internalBinaryWrite(message: Decl_FunctionDecl, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.api.expr.v1alpha1.Decl.FunctionDecl.Overload overloads = 1; */ + for (let i = 0; i < message.overloads.length; i++) + Decl_FunctionDecl_Overload.internalBinaryWrite(message.overloads[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Decl.FunctionDecl + */ +export const Decl_FunctionDecl = new Decl_FunctionDecl$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Decl_FunctionDecl_Overload$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Decl.FunctionDecl.Overload", [ + { no: 1, name: "overload_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "params", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Type }, + { no: 3, name: "type_params", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "result_type", kind: "message", T: () => Type }, + { no: 5, name: "is_instance_function", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "doc", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Decl_FunctionDecl_Overload { + const message = { overloadId: "", params: [], typeParams: [], isInstanceFunction: false, doc: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Decl_FunctionDecl_Overload): Decl_FunctionDecl_Overload { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string overload_id */ 1: + message.overloadId = reader.string(); + break; + case /* repeated google.api.expr.v1alpha1.Type params */ 2: + message.params.push(Type.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated string type_params */ 3: + message.typeParams.push(reader.string()); + break; + case /* google.api.expr.v1alpha1.Type result_type */ 4: + message.resultType = Type.internalBinaryRead(reader, reader.uint32(), options, message.resultType); + break; + case /* bool is_instance_function */ 5: + message.isInstanceFunction = reader.bool(); + break; + case /* string doc */ 6: + message.doc = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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)); + return message; + } + internalBinaryWrite(message: Decl_FunctionDecl_Overload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string overload_id = 1; */ + if (message.overloadId !== "") + writer.tag(1, WireType.LengthDelimited).string(message.overloadId); + /* repeated google.api.expr.v1alpha1.Type params = 2; */ + for (let i = 0; i < message.params.length; i++) + Type.internalBinaryWrite(message.params[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated string type_params = 3; */ + for (let i = 0; i < message.typeParams.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.typeParams[i]); + /* google.api.expr.v1alpha1.Type result_type = 4; */ + if (message.resultType) + Type.internalBinaryWrite(message.resultType, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* bool is_instance_function = 5; */ + if (message.isInstanceFunction !== false) + writer.tag(5, WireType.Varint).bool(message.isInstanceFunction); + /* string doc = 6; */ + if (message.doc !== "") + writer.tag(6, WireType.LengthDelimited).string(message.doc); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Decl.FunctionDecl.Overload + */ +export const Decl_FunctionDecl_Overload = new Decl_FunctionDecl_Overload$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Reference$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Reference", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "overload_id", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "value", kind: "message", T: () => Constant } + ]); + } + create(value?: PartialMessage): Reference { + const message = { name: "", overloadId: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Reference): Reference { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* repeated string overload_id */ 3: + message.overloadId.push(reader.string()); + break; + case /* google.api.expr.v1alpha1.Constant value */ 4: + message.value = Constant.internalBinaryRead(reader, reader.uint32(), options, message.value); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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; + return message; + } + internalBinaryWrite(message: Reference, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated string overload_id = 3; */ + for (let i = 0; i < message.overloadId.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.overloadId[i]); + /* google.api.expr.v1alpha1.Constant value = 4; */ + if (message.value) + Constant.internalBinaryWrite(message.value, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Reference + */ +export const Reference = new Reference$Type(); diff --git a/src/grpc/generated/google/api/expr/v1alpha1/syntax.ts b/src/grpc/generated/google/api/expr/v1alpha1/syntax.ts index 7a86b49..a4ae198 100644 --- a/src/grpc/generated/google/api/expr/v1alpha1/syntax.ts +++ b/src/grpc/generated/google/api/expr/v1alpha1/syntax.ts @@ -1,28 +1,55 @@ -// 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"; +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/api/expr/v1alpha1/syntax.proto" (package "google.api.expr.v1alpha1", syntax proto3) +// tslint:disable +// +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; import { Timestamp } from "../../../protobuf/timestamp"; +import { Duration } from "../../../protobuf/duration"; +import { NullValue } from "../../../protobuf/struct"; +// A representation of the abstract syntax of the Common Expression Language. -export const protobufPackage = "google.api.expr.v1alpha1"; - -/** An expression together with source information as returned by the parser. */ +/** + * An expression together with source information as returned by the parser. + * + * @generated from protobuf message google.api.expr.v1alpha1.ParsedExpr + */ export interface ParsedExpr { - /** The parsed expression. */ - expr: - | Expr - | undefined; - /** The source info derived from input that generated the parsed `expr`. */ - sourceInfo: SourceInfo | undefined; + /** + * The parsed expression. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr expr = 2; + */ + expr?: Expr; + /** + * The source info derived from input that generated the parsed `expr`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.SourceInfo source_info = 3; + */ + sourceInfo?: SourceInfo; } - /** * An abstract representation of a common expression. * @@ -41,165 +68,263 @@ export interface ParsedExpr { * the declaration `google.api.name` within a * [Expr.Select][google.api.expr.v1alpha1.Expr.Select] expression, and the * function declaration `startsWith`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr */ 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; + /** + * 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. + * + * @generated from protobuf field: int64 id = 2; + */ + id: string; + /** + * @generated from protobuf oneof: expr_kind + */ + exprKind: { + oneofKind: "constExpr"; + /** + * A literal expression. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Constant const_expr = 3; + */ + constExpr: Constant; + } | { + oneofKind: "identExpr"; + /** + * An identifier expression. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr.Ident ident_expr = 4; + */ + identExpr: Expr_Ident; + } | { + oneofKind: "selectExpr"; + /** + * A field selection expression, e.g. `request.auth`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr.Select select_expr = 5; + */ + selectExpr: Expr_Select; + } | { + oneofKind: "callExpr"; + /** + * A call expression, including calls to predefined functions and operators. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr.Call call_expr = 6; + */ + callExpr: Expr_Call; + } | { + oneofKind: "listExpr"; + /** + * A list creation expression. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr.CreateList list_expr = 7; + */ + listExpr: Expr_CreateList; + } | { + oneofKind: "structExpr"; + /** + * A map or message creation expression. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr.CreateStruct struct_expr = 8; + */ + structExpr: Expr_CreateStruct; + } | { + oneofKind: "comprehensionExpr"; + /** + * A comprehension expression. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr.Comprehension comprehension_expr = 9; + */ + comprehensionExpr: Expr_Comprehension; + } | { + oneofKind: undefined; + }; } - -/** An identifier expression. e.g. `request`. */ +/** + * An identifier expression. e.g. `request`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr.Ident + */ 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; + /** + * 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. + * + * @generated from protobuf field: string name = 1; + */ + name: string; } - -/** A field selection expression. e.g. `request.auth`. */ +/** + * A field selection expression. e.g. `request.auth`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr.Select + */ 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; + /** + * Required. The target of the selection expression. + * + * For example, in the select expression `request.auth`, the `request` + * portion of the expression is the `operand`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr operand = 1; + */ + operand?: Expr; + /** + * 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`. + * + * @generated from protobuf field: string field = 2; + */ + field: string; + /** + * Whether the select is to be interpreted as a field presence test. + * + * This results from the macro `has(request.auth)`. + * + * @generated from protobuf field: bool test_only = 3; + */ + testOnly: boolean; } - /** * A call expression, including calls to predefined functions and operators. * * For example, `value == 10`, `size(map_value)`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr.Call */ 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[]; + /** + * The target of an method call-style expression. For example, `x` in + * `x.f()`. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr target = 1; + */ + target?: Expr; + /** + * Required. The name of the function or method being called. + * + * @generated from protobuf field: string function = 2; + */ + function: string; + /** + * The arguments. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.Expr args = 3; + */ + 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])` + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr.CreateList */ 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[]; + /** + * The elements part of the list. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.Expr elements = 1; + */ + 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. + * + * @generated from protobuf field: repeated int32 optional_indices = 2; + */ + 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'}`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr.CreateStruct */ 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[]; + /** + * The type name of the message to be created, empty when creating map + * literals. + * + * @generated from protobuf field: string message_name = 1; + */ + messageName: string; + /** + * The entries in the creation expression. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.Expr.CreateStruct.Entry entries = 2; + */ + entries: Expr_CreateStruct_Entry[]; } - -/** Represents an entry. */ +/** + * Represents an entry. + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr.CreateStruct.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; + /** + * 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. + * + * @generated from protobuf field: int64 id = 1; + */ + id: string; + /** + * @generated from protobuf oneof: key_kind + */ + keyKind: { + oneofKind: "fieldKey"; + /** + * The field key for a message creator statement. + * + * @generated from protobuf field: string field_key = 2; + */ + fieldKey: string; + } | { + oneofKind: "mapKey"; + /** + * The key expression for a map creation statement. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr map_key = 3; + */ + mapKey: Expr; + } | { + oneofKind: 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. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr value = 4; + */ + value?: Expr; + /** + * Whether the key-value pair is optional. + * + * @generated from protobuf field: bool optional_entry = 5; + */ + optionalEntry: boolean; } - /** * A comprehension expression applied to a list or map. * @@ -257,56 +382,71 @@ export interface Expr_CreateStruct_Entry { * } * return `result` * ``` + * + * @generated from protobuf message google.api.expr.v1alpha1.Expr.Comprehension */ 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; + /** + * 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. + * + * @generated from protobuf field: string iter_var = 1; + */ + 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. + * + * @generated from protobuf field: string iter_var2 = 8; + */ + iterVar2: string; + /** + * The range over which the comprehension iterates. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr iter_range = 2; + */ + iterRange?: Expr; + /** + * The name of the variable used for accumulation of the result. + * + * @generated from protobuf field: string accu_var = 3; + */ + accuVar: string; + /** + * The initial value of the accumulator. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr accu_init = 4; + */ + accuInit?: Expr; + /** + * 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. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr loop_condition = 5; + */ + loopCondition?: Expr; + /** + * An expression which can contain iter_var, iter_var2, and accu_var. + * + * Computes the next value of accu_var. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr loop_step = 6; + */ + loopStep?: Expr; + /** + * An expression which can contain accu_var. + * + * Computes the result. + * + * @generated from protobuf field: google.api.expr.v1alpha1.Expr result = 7; + */ + result?: Expr; } - /** * Represents a primitive literal. * @@ -322,2218 +462,1358 @@ export interface Expr_Comprehension { * * Examples of literals include: `"hello"`, `b'bytes'`, `1u`, `4.2`, `-2`, * `true`, `null`. + * + * @generated from protobuf message google.api.expr.v1alpha1.Constant */ 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. + * @generated from protobuf oneof: constant_kind + */ + constantKind: { + oneofKind: "nullValue"; + /** + * null value. + * + * @generated from protobuf field: google.protobuf.NullValue null_value = 1; + */ + nullValue: NullValue; + } | { + oneofKind: "boolValue"; + /** + * boolean value. + * + * @generated from protobuf field: bool bool_value = 2; + */ + boolValue: boolean; + } | { + oneofKind: "int64Value"; + /** + * int64 value. + * + * @generated from protobuf field: int64 int64_value = 3; + */ + int64Value: string; + } | { + oneofKind: "uint64Value"; + /** + * uint64 value. + * + * @generated from protobuf field: uint64 uint64_value = 4; + */ + uint64Value: string; + } | { + oneofKind: "doubleValue"; + /** + * double value. + * + * @generated from protobuf field: double double_value = 5; + */ + doubleValue: number; + } | { + oneofKind: "stringValue"; + /** + * string value. + * + * @generated from protobuf field: string string_value = 6; + */ + stringValue: string; + } | { + oneofKind: "bytesValue"; + /** + * bytes value. + * + * @generated from protobuf field: bytes bytes_value = 7; + */ + bytesValue: Uint8Array; + } | { + oneofKind: "durationValue"; + /** + * protobuf.Duration value. + * + * Deprecated: duration is no longer considered a builtin cel type. + * + * @deprecated + * @generated from protobuf field: google.protobuf.Duration duration_value = 8 [deprecated = true]; + */ + durationValue: Duration; + } | { + oneofKind: "timestampValue"; + /** + * protobuf.Timestamp value. + * + * Deprecated: timestamp is no longer considered a builtin cel type. + * + * @deprecated + * @generated from protobuf field: google.protobuf.Timestamp timestamp_value = 9 [deprecated = true]; + */ + timestampValue: Timestamp; + } | { + oneofKind: undefined; + }; +} +/** + * Source information collected at parse time. + * + * @generated from protobuf message google.api.expr.v1alpha1.SourceInfo + */ +export interface SourceInfo { + /** + * The syntax version of the source, e.g. `cel1`. * - * Deprecated: duration is no longer considered a builtin cel type. + * @generated from protobuf field: string syntax_version = 1; */ - { $case: "durationValue"; durationValue: Duration } - | // + syntaxVersion: string; /** - * protobuf.Timestamp value. + * 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`. * - * Deprecated: timestamp is no longer considered a builtin cel type. + * @generated from protobuf field: string location = 2; */ - { $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[]; + 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]`. + * + * @generated from protobuf field: repeated int32 line_offsets = 3; + */ + lineOffsets: number[]; + /** + * A map from the parse node id (e.g. `Expr.id`) to the code point offset + * within the source. + * + * @generated from protobuf field: map positions = 4; + */ + positions: { + [key: string]: number; + }; + /** + * 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. + * + * @generated from protobuf field: map macro_calls = 5; + */ + macroCalls: { + [key: string]: Expr; + }; + /** + * 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. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6; + */ + extensions: SourceInfo_Extension[]; } - -/** An extension that was requested for the source expression. */ +/** + * An extension that was requested for the source expression. + * + * @generated from protobuf message google.api.expr.v1alpha1.SourceInfo.Extension + */ 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"; - } + /** + * Identifier for the extension. Example: constant_folding + * + * @generated from protobuf field: string id = 1; + */ + 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. + * + * @generated from protobuf field: repeated google.api.expr.v1alpha1.SourceInfo.Extension.Component affected_components = 2; + */ + 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). + * + * @generated from protobuf field: google.api.expr.v1alpha1.SourceInfo.Extension.Version version = 3; + */ + version?: SourceInfo_Extension_Version; } - -/** Version */ +/** + * Version + * + * @generated from protobuf message google.api.expr.v1alpha1.SourceInfo.Extension.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; + /** + * Major version changes indicate different required support level from + * the required components. + * + * @generated from protobuf field: int64 major = 1; + */ + major: string; + /** + * Minor version changes must not change the observed behavior from + * existing implementations, but may be provided informationally. + * + * @generated from protobuf field: int64 minor = 2; + */ + minor: string; } - -export interface SourceInfo_MacroCallsEntry { - key: Long; - value: Expr | undefined; +/** + * CEL component specifier. + * + * @generated from protobuf enum google.api.expr.v1alpha1.SourceInfo.Extension.Component + */ +export enum SourceInfo_Extension_Component { + /** + * Unspecified, default. + * + * @generated from protobuf enum value: COMPONENT_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + /** + * Parser. Converts a CEL string to an AST. + * + * @generated from protobuf enum value: COMPONENT_PARSER = 1; + */ + PARSER = 1, + /** + * Type checker. Checks that references in an AST are defined and types + * agree. + * + * @generated from protobuf enum value: COMPONENT_TYPE_CHECKER = 2; + */ + TYPE_CHECKER = 2, + /** + * Runtime. Evaluates a parsed and optionally checked CEL AST against a + * context. + * + * @generated from protobuf enum value: COMPONENT_RUNTIME = 3; + */ + RUNTIME = 3 } - -/** A specific position in source. */ +/** + * A specific position in source. + * + * @generated from protobuf message google.api.expr.v1alpha1.SourcePosition + */ 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 }; + /** + * The soucre location name (e.g. file name). + * + * @generated from protobuf field: string location = 1; + */ + location: string; + /** + * The UTF-8 code unit offset. + * + * @generated from protobuf field: int32 offset = 2; + */ + offset: number; + /** + * The 1-based index of the starting line in the source text + * where the issue occurs, or 0 if unknown. + * + * @generated from protobuf field: int32 line = 3; + */ + 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. + * + * @generated from protobuf field: int32 column = 4; + */ + column: number; } - -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(); +// @generated message type with reflection information, may provide speed optimized methods +class ParsedExpr$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.ParsedExpr", [ + { no: 2, name: "expr", kind: "message", T: () => Expr }, + { no: 3, name: "source_info", kind: "message", T: () => SourceInfo } + ]); + } + create(value?: PartialMessage): ParsedExpr { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ParsedExpr): ParsedExpr { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.api.expr.v1alpha1.Expr expr */ 2: + message.expr = Expr.internalBinaryRead(reader, reader.uint32(), options, message.expr); + break; + case /* google.api.expr.v1alpha1.SourceInfo source_info */ 3: + message.sourceInfo = SourceInfo.internalBinaryRead(reader, reader.uint32(), options, message.sourceInfo); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.sourceInfo !== undefined) { - SourceInfo.encode(message.sourceInfo, writer.uint32(26).fork()).join(); + internalBinaryWrite(message: ParsedExpr, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.api.expr.v1alpha1.Expr expr = 2; */ + if (message.expr) + Expr.internalBinaryWrite(message.expr, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.SourceInfo source_info = 3; */ + if (message.sourceInfo) + SourceInfo.internalBinaryWrite(message.sourceInfo, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.ParsedExpr + */ +export const ParsedExpr = new ParsedExpr$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr", [ + { no: 2, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "const_expr", kind: "message", oneof: "exprKind", T: () => Constant }, + { no: 4, name: "ident_expr", kind: "message", oneof: "exprKind", T: () => Expr_Ident }, + { no: 5, name: "select_expr", kind: "message", oneof: "exprKind", T: () => Expr_Select }, + { no: 6, name: "call_expr", kind: "message", oneof: "exprKind", T: () => Expr_Call }, + { no: 7, name: "list_expr", kind: "message", oneof: "exprKind", T: () => Expr_CreateList }, + { no: 8, name: "struct_expr", kind: "message", oneof: "exprKind", T: () => Expr_CreateStruct }, + { no: 9, name: "comprehension_expr", kind: "message", oneof: "exprKind", T: () => Expr_Comprehension } + ]); + } + create(value?: PartialMessage): Expr { + const message = { id: "0", exprKind: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr): Expr { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 id */ 2: + message.id = reader.int64().toString(); + break; + case /* google.api.expr.v1alpha1.Constant const_expr */ 3: + message.exprKind = { + oneofKind: "constExpr", + constExpr: Constant.internalBinaryRead(reader, reader.uint32(), options, (message.exprKind as any).constExpr) + }; + break; + case /* google.api.expr.v1alpha1.Expr.Ident ident_expr */ 4: + message.exprKind = { + oneofKind: "identExpr", + identExpr: Expr_Ident.internalBinaryRead(reader, reader.uint32(), options, (message.exprKind as any).identExpr) + }; + break; + case /* google.api.expr.v1alpha1.Expr.Select select_expr */ 5: + message.exprKind = { + oneofKind: "selectExpr", + selectExpr: Expr_Select.internalBinaryRead(reader, reader.uint32(), options, (message.exprKind as any).selectExpr) + }; + break; + case /* google.api.expr.v1alpha1.Expr.Call call_expr */ 6: + message.exprKind = { + oneofKind: "callExpr", + callExpr: Expr_Call.internalBinaryRead(reader, reader.uint32(), options, (message.exprKind as any).callExpr) + }; + break; + case /* google.api.expr.v1alpha1.Expr.CreateList list_expr */ 7: + message.exprKind = { + oneofKind: "listExpr", + listExpr: Expr_CreateList.internalBinaryRead(reader, reader.uint32(), options, (message.exprKind as any).listExpr) + }; + break; + case /* google.api.expr.v1alpha1.Expr.CreateStruct struct_expr */ 8: + message.exprKind = { + oneofKind: "structExpr", + structExpr: Expr_CreateStruct.internalBinaryRead(reader, reader.uint32(), options, (message.exprKind as any).structExpr) + }; + break; + case /* google.api.expr.v1alpha1.Expr.Comprehension comprehension_expr */ 9: + message.exprKind = { + oneofKind: "comprehensionExpr", + comprehensionExpr: Expr_Comprehension.internalBinaryRead(reader, reader.uint32(), options, (message.exprKind as any).comprehensionExpr) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 3: { - if (tag !== 26) { - break; - } - - message.sourceInfo = SourceInfo.decode(reader, reader.uint32()); - continue; + return message; + } + internalBinaryWrite(message: Expr, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 id = 2; */ + if (message.id !== "0") + writer.tag(2, WireType.Varint).int64(message.id); + /* google.api.expr.v1alpha1.Constant const_expr = 3; */ + if (message.exprKind.oneofKind === "constExpr") + Constant.internalBinaryWrite(message.exprKind.constExpr, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr.Ident ident_expr = 4; */ + if (message.exprKind.oneofKind === "identExpr") + Expr_Ident.internalBinaryWrite(message.exprKind.identExpr, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr.Select select_expr = 5; */ + if (message.exprKind.oneofKind === "selectExpr") + Expr_Select.internalBinaryWrite(message.exprKind.selectExpr, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr.Call call_expr = 6; */ + if (message.exprKind.oneofKind === "callExpr") + Expr_Call.internalBinaryWrite(message.exprKind.callExpr, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr.CreateList list_expr = 7; */ + if (message.exprKind.oneofKind === "listExpr") + Expr_CreateList.internalBinaryWrite(message.exprKind.listExpr, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr.CreateStruct struct_expr = 8; */ + if (message.exprKind.oneofKind === "structExpr") + Expr_CreateStruct.internalBinaryWrite(message.exprKind.structExpr, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr.Comprehension comprehension_expr = 9; */ + if (message.exprKind.oneofKind === "comprehensionExpr") + Expr_Comprehension.internalBinaryWrite(message.exprKind.comprehensionExpr, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr + */ +export const Expr = new Expr$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr_Ident$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr.Ident", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Expr_Ident { + const message = { name: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr_Ident): Expr_Ident { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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); + internalBinaryWrite(message: Expr_Ident, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.sourceInfo !== undefined) { - obj.sourceInfo = SourceInfo.toJSON(message.sourceInfo); +} +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr.Ident + */ +export const Expr_Ident = new Expr_Ident$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr_Select$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr.Select", [ + { no: 1, name: "operand", kind: "message", T: () => Expr }, + { no: 2, name: "field", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "test_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): Expr_Select { + const message = { field: "", testOnly: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr_Select): Expr_Select { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.api.expr.v1alpha1.Expr operand */ 1: + message.operand = Expr.internalBinaryRead(reader, reader.uint32(), options, message.operand); + break; + case /* string field */ 2: + message.field = reader.string(); + break; + case /* bool test_only */ 3: + message.testOnly = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Expr_Select, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.api.expr.v1alpha1.Expr operand = 1; */ + if (message.operand) + Expr.internalBinaryWrite(message.operand, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string field = 2; */ + if (message.field !== "") + writer.tag(2, WireType.LengthDelimited).string(message.field); + /* bool test_only = 3; */ + if (message.testOnly !== false) + writer.tag(3, WireType.Varint).bool(message.testOnly); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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()); +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr.Select + */ +export const Expr_Select = new Expr_Select$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr_Call$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr.Call", [ + { no: 1, name: "target", kind: "message", T: () => Expr }, + { no: 2, name: "function", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "args", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Expr } + ]); + } + create(value?: PartialMessage): Expr_Call { + const message = { function: "", args: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr_Call): Expr_Call { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.api.expr.v1alpha1.Expr target */ 1: + message.target = Expr.internalBinaryRead(reader, reader.uint32(), options, message.target); + break; + case /* string function */ 2: + message.function = reader.string(); + break; + case /* repeated google.api.expr.v1alpha1.Expr args */ 3: + message.args.push(Expr.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Expr_Call, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.api.expr.v1alpha1.Expr target = 1; */ + if (message.target) + Expr.internalBinaryWrite(message.target, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string function = 2; */ + if (message.function !== "") + writer.tag(2, WireType.LengthDelimited).string(message.function); + /* repeated google.api.expr.v1alpha1.Expr args = 3; */ + for (let i = 0; i < message.args.length; i++) + Expr.internalBinaryWrite(message.args[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr.Call + */ +export const Expr_Call = new Expr_Call$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr_CreateList$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr.CreateList", [ + { no: 1, name: "elements", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Expr }, + { no: 2, name: "optional_indices", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): Expr_CreateList { + const message = { elements: [], optionalIndices: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr_CreateList): Expr_CreateList { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.api.expr.v1alpha1.Expr elements */ 1: + message.elements.push(Expr.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated int32 optional_indices */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.optionalIndices.push(reader.int32()); + else + message.optionalIndices.push(reader.int32()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - 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; + internalBinaryWrite(message: Expr_CreateList, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.api.expr.v1alpha1.Expr elements = 1; */ + for (let i = 0; i < message.elements.length; i++) + Expr.internalBinaryWrite(message.elements[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated int32 optional_indices = 2; */ + if (message.optionalIndices.length) { + writer.tag(2, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.optionalIndices.length; i++) + writer.int32(message.optionalIndices[i]); + writer.join(); } - 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); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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()); +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr.CreateList + */ +export const Expr_CreateList = new Expr_CreateList$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr_CreateStruct$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr.CreateStruct", [ + { no: 1, name: "message_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "entries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Expr_CreateStruct_Entry } + ]); + } + create(value?: PartialMessage): Expr_CreateStruct { + const message = { messageName: "", entries: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr_CreateStruct): Expr_CreateStruct { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string message_name */ 1: + message.messageName = reader.string(); + break; + case /* repeated google.api.expr.v1alpha1.Expr.CreateStruct.Entry entries */ 2: + message.entries.push(Expr_CreateStruct_Entry.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - continue; - } - - break; } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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; + internalBinaryWrite(message: Expr_CreateStruct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string message_name = 1; */ + if (message.messageName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.messageName); + /* repeated google.api.expr.v1alpha1.Expr.CreateStruct.Entry entries = 2; */ + for (let i = 0; i < message.entries.length; i++) + Expr_CreateStruct_Entry.internalBinaryWrite(message.entries[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr.CreateStruct + */ +export const Expr_CreateStruct = new Expr_CreateStruct$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr_CreateStruct_Entry$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr.CreateStruct.Entry", [ + { no: 1, name: "id", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "field_key", kind: "scalar", oneof: "keyKind", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "map_key", kind: "message", oneof: "keyKind", T: () => Expr }, + { no: 4, name: "value", kind: "message", T: () => Expr }, + { no: 5, name: "optional_entry", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): Expr_CreateStruct_Entry { + const message = { id: "0", keyKind: { oneofKind: undefined }, optionalEntry: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr_CreateStruct_Entry): Expr_CreateStruct_Entry { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 id */ 1: + message.id = reader.int64().toString(); + break; + case /* string field_key */ 2: + message.keyKind = { + oneofKind: "fieldKey", + fieldKey: reader.string() + }; + break; + case /* google.api.expr.v1alpha1.Expr map_key */ 3: + message.keyKind = { + oneofKind: "mapKey", + mapKey: Expr.internalBinaryRead(reader, reader.uint32(), options, (message.keyKind as any).mapKey) + }; + break; + case /* google.api.expr.v1alpha1.Expr value */ 4: + message.value = Expr.internalBinaryRead(reader, reader.uint32(), options, message.value); + break; + case /* bool optional_entry */ 5: + message.optionalEntry = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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; + return message; + } + internalBinaryWrite(message: Expr_CreateStruct_Entry, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 id = 1; */ + if (message.id !== "0") + writer.tag(1, WireType.Varint).int64(message.id); + /* string field_key = 2; */ + if (message.keyKind.oneofKind === "fieldKey") + writer.tag(2, WireType.LengthDelimited).string(message.keyKind.fieldKey); + /* google.api.expr.v1alpha1.Expr map_key = 3; */ + if (message.keyKind.oneofKind === "mapKey") + Expr.internalBinaryWrite(message.keyKind.mapKey, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr value = 4; */ + if (message.value) + Expr.internalBinaryWrite(message.value, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* bool optional_entry = 5; */ + if (message.optionalEntry !== false) + writer.tag(5, WireType.Varint).bool(message.optionalEntry); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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 }; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr.CreateStruct.Entry + */ +export const Expr_CreateStruct_Entry = new Expr_CreateStruct_Entry$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Expr_Comprehension$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Expr.Comprehension", [ + { no: 1, name: "iter_var", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "iter_var2", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "iter_range", kind: "message", T: () => Expr }, + { no: 3, name: "accu_var", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "accu_init", kind: "message", T: () => Expr }, + { no: 5, name: "loop_condition", kind: "message", T: () => Expr }, + { no: 6, name: "loop_step", kind: "message", T: () => Expr }, + { no: 7, name: "result", kind: "message", T: () => Expr } + ]); + } + create(value?: PartialMessage): Expr_Comprehension { + const message = { iterVar: "", iterVar2: "", accuVar: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Expr_Comprehension): Expr_Comprehension { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string iter_var */ 1: + message.iterVar = reader.string(); + break; + case /* string iter_var2 */ 8: + message.iterVar2 = reader.string(); + break; + case /* google.api.expr.v1alpha1.Expr iter_range */ 2: + message.iterRange = Expr.internalBinaryRead(reader, reader.uint32(), options, message.iterRange); + break; + case /* string accu_var */ 3: + message.accuVar = reader.string(); + break; + case /* google.api.expr.v1alpha1.Expr accu_init */ 4: + message.accuInit = Expr.internalBinaryRead(reader, reader.uint32(), options, message.accuInit); + break; + case /* google.api.expr.v1alpha1.Expr loop_condition */ 5: + message.loopCondition = Expr.internalBinaryRead(reader, reader.uint32(), options, message.loopCondition); + break; + case /* google.api.expr.v1alpha1.Expr loop_step */ 6: + message.loopStep = Expr.internalBinaryRead(reader, reader.uint32(), options, message.loopStep); + break; + case /* google.api.expr.v1alpha1.Expr result */ 7: + message.result = Expr.internalBinaryRead(reader, reader.uint32(), options, message.result); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } + return message; + } + internalBinaryWrite(message: Expr_Comprehension, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string iter_var = 1; */ + if (message.iterVar !== "") + writer.tag(1, WireType.LengthDelimited).string(message.iterVar); + /* string iter_var2 = 8; */ + if (message.iterVar2 !== "") + writer.tag(8, WireType.LengthDelimited).string(message.iterVar2); + /* google.api.expr.v1alpha1.Expr iter_range = 2; */ + if (message.iterRange) + Expr.internalBinaryWrite(message.iterRange, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string accu_var = 3; */ + if (message.accuVar !== "") + writer.tag(3, WireType.LengthDelimited).string(message.accuVar); + /* google.api.expr.v1alpha1.Expr accu_init = 4; */ + if (message.accuInit) + Expr.internalBinaryWrite(message.accuInit, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr loop_condition = 5; */ + if (message.loopCondition) + Expr.internalBinaryWrite(message.loopCondition, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr loop_step = 6; */ + if (message.loopStep) + Expr.internalBinaryWrite(message.loopStep, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* google.api.expr.v1alpha1.Expr result = 7; */ + if (message.result) + Expr.internalBinaryWrite(message.result, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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()); +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Expr.Comprehension + */ +export const Expr_Comprehension = new Expr_Comprehension$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Constant$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.Constant", [ + { no: 1, name: "null_value", kind: "enum", oneof: "constantKind", T: () => ["google.protobuf.NullValue", NullValue] }, + { no: 2, name: "bool_value", kind: "scalar", oneof: "constantKind", T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "int64_value", kind: "scalar", oneof: "constantKind", T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "uint64_value", kind: "scalar", oneof: "constantKind", T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "double_value", kind: "scalar", oneof: "constantKind", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 6, name: "string_value", kind: "scalar", oneof: "constantKind", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "bytes_value", kind: "scalar", oneof: "constantKind", T: 12 /*ScalarType.BYTES*/ }, + { no: 8, name: "duration_value", kind: "message", oneof: "constantKind", T: () => Duration }, + { no: 9, name: "timestamp_value", kind: "message", oneof: "constantKind", T: () => Timestamp } + ]); + } + create(value?: PartialMessage): Constant { + const message = { constantKind: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Constant): Constant { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.NullValue null_value */ 1: + message.constantKind = { + oneofKind: "nullValue", + nullValue: reader.int32() + }; + break; + case /* bool bool_value */ 2: + message.constantKind = { + oneofKind: "boolValue", + boolValue: reader.bool() + }; + break; + case /* int64 int64_value */ 3: + message.constantKind = { + oneofKind: "int64Value", + int64Value: reader.int64().toString() + }; + break; + case /* uint64 uint64_value */ 4: + message.constantKind = { + oneofKind: "uint64Value", + uint64Value: reader.uint64().toString() + }; + break; + case /* double double_value */ 5: + message.constantKind = { + oneofKind: "doubleValue", + doubleValue: reader.double() + }; + break; + case /* string string_value */ 6: + message.constantKind = { + oneofKind: "stringValue", + stringValue: reader.string() + }; + break; + case /* bytes bytes_value */ 7: + message.constantKind = { + oneofKind: "bytesValue", + bytesValue: reader.bytes() + }; + break; + case /* google.protobuf.Duration duration_value = 8 [deprecated = true];*/ 8: + message.constantKind = { + oneofKind: "durationValue", + durationValue: Duration.internalBinaryRead(reader, reader.uint32(), options, (message.constantKind as any).durationValue) + }; + break; + case /* google.protobuf.Timestamp timestamp_value = 9 [deprecated = true];*/ 9: + message.constantKind = { + oneofKind: "timestampValue", + timestampValue: Timestamp.internalBinaryRead(reader, reader.uint32(), options, (message.constantKind as any).timestampValue) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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); - }); + return message; + } + internalBinaryWrite(message: Constant, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.protobuf.NullValue null_value = 1; */ + if (message.constantKind.oneofKind === "nullValue") + writer.tag(1, WireType.Varint).int32(message.constantKind.nullValue); + /* bool bool_value = 2; */ + if (message.constantKind.oneofKind === "boolValue") + writer.tag(2, WireType.Varint).bool(message.constantKind.boolValue); + /* int64 int64_value = 3; */ + if (message.constantKind.oneofKind === "int64Value") + writer.tag(3, WireType.Varint).int64(message.constantKind.int64Value); + /* uint64 uint64_value = 4; */ + if (message.constantKind.oneofKind === "uint64Value") + writer.tag(4, WireType.Varint).uint64(message.constantKind.uint64Value); + /* double double_value = 5; */ + if (message.constantKind.oneofKind === "doubleValue") + writer.tag(5, WireType.Bit64).double(message.constantKind.doubleValue); + /* string string_value = 6; */ + if (message.constantKind.oneofKind === "stringValue") + writer.tag(6, WireType.LengthDelimited).string(message.constantKind.stringValue); + /* bytes bytes_value = 7; */ + if (message.constantKind.oneofKind === "bytesValue") + writer.tag(7, WireType.LengthDelimited).bytes(message.constantKind.bytesValue); + /* google.protobuf.Duration duration_value = 8 [deprecated = true]; */ + if (message.constantKind.oneofKind === "durationValue") + Duration.internalBinaryWrite(message.constantKind.durationValue, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Timestamp timestamp_value = 9 [deprecated = true]; */ + if (message.constantKind.oneofKind === "timestampValue") + Timestamp.internalBinaryWrite(message.constantKind.timestampValue, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.Constant + */ +export const Constant = new Constant$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourceInfo$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.SourceInfo", [ + { no: 1, name: "syntax_version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "location", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "line_offsets", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "positions", kind: "map", K: 3 /*ScalarType.INT64*/, V: { kind: "scalar", T: 5 /*ScalarType.INT32*/ } }, + { no: 5, name: "macro_calls", kind: "map", K: 3 /*ScalarType.INT64*/, V: { kind: "message", T: () => Expr } }, + { no: 6, name: "extensions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SourceInfo_Extension } + ]); + } + create(value?: PartialMessage): SourceInfo { + const message = { syntaxVersion: "", location: "", lineOffsets: [], positions: {}, macroCalls: {}, extensions: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceInfo): SourceInfo { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string syntax_version */ 1: + message.syntaxVersion = reader.string(); + break; + case /* string location */ 2: + message.location = reader.string(); + break; + case /* repeated int32 line_offsets */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.lineOffsets.push(reader.int32()); + else + message.lineOffsets.push(reader.int32()); + break; + case /* map positions */ 4: + this.binaryReadMap4(message.positions, reader, options); + break; + case /* map macro_calls */ 5: + this.binaryReadMap5(message.macroCalls, reader, options); + break; + case /* repeated google.api.expr.v1alpha1.SourceInfo.Extension extensions */ 6: + message.extensions.push(SourceInfo_Extension.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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; + return message; + } + private binaryReadMap4(map: SourceInfo["positions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SourceInfo["positions"] | undefined, val: SourceInfo["positions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.int64().toString(); + break; + case 2: + val = reader.int32(); + break; + default: throw new globalThis.Error("unknown map entry field for field google.api.expr.v1alpha1.SourceInfo.positions"); + } } - case 2: { - if (tag !== 16) { - break; - } - - message.minor = Long.fromString(reader.int64().toString()); - continue; + map[key ?? "0"] = val ?? 0; + } + private binaryReadMap5(map: SourceInfo["macroCalls"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SourceInfo["macroCalls"] | undefined, val: SourceInfo["macroCalls"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.int64().toString(); + break; + case 2: + val = Expr.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field google.api.expr.v1alpha1.SourceInfo.macro_calls"); + } } - } - 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(); + map[key ?? "0"] = val ?? Expr.create(); + } + internalBinaryWrite(message: SourceInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string syntax_version = 1; */ + if (message.syntaxVersion !== "") + writer.tag(1, WireType.LengthDelimited).string(message.syntaxVersion); + /* string location = 2; */ + if (message.location !== "") + writer.tag(2, WireType.LengthDelimited).string(message.location); + /* repeated int32 line_offsets = 3; */ + if (message.lineOffsets.length) { + writer.tag(3, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.lineOffsets.length; i++) + writer.int32(message.lineOffsets[i]); + writer.join(); + } + /* map positions = 4; */ + for (let k of Object.keys(message.positions)) + writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.Varint).int64(k).tag(2, WireType.Varint).int32(message.positions[k]).join(); + /* map macro_calls = 5; */ + for (let k of Object.keys(message.macroCalls)) { + writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.Varint).int64(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Expr.internalBinaryWrite(message.macroCalls[k], writer, options); + writer.join().join(); + } + /* repeated google.api.expr.v1alpha1.SourceInfo.Extension extensions = 6; */ + for (let i = 0; i < message.extensions.length; i++) + SourceInfo_Extension.internalBinaryWrite(message.extensions[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.SourceInfo + */ +export const SourceInfo = new SourceInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourceInfo_Extension$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.SourceInfo.Extension", [ + { no: 1, name: "id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "affected_components", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["google.api.expr.v1alpha1.SourceInfo.Extension.Component", SourceInfo_Extension_Component, "COMPONENT_"] }, + { no: 3, name: "version", kind: "message", T: () => SourceInfo_Extension_Version } + ]); + } + create(value?: PartialMessage): SourceInfo_Extension { + const message = { id: "", affectedComponents: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceInfo_Extension): SourceInfo_Extension { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string id */ 1: + message.id = reader.string(); + break; + case /* repeated google.api.expr.v1alpha1.SourceInfo.Extension.Component affected_components */ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.affectedComponents.push(reader.int32()); + else + message.affectedComponents.push(reader.int32()); + break; + case /* google.api.expr.v1alpha1.SourceInfo.Extension.Version version */ 3: + message.version = SourceInfo_Extension_Version.internalBinaryRead(reader, reader.uint32(), options, message.version); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 message; + } + internalBinaryWrite(message: SourceInfo_Extension, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string id = 1; */ + if (message.id !== "") + writer.tag(1, WireType.LengthDelimited).string(message.id); + /* repeated google.api.expr.v1alpha1.SourceInfo.Extension.Component affected_components = 2; */ + if (message.affectedComponents.length) { + writer.tag(2, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.affectedComponents.length; i++) + writer.int32(message.affectedComponents[i]); + writer.join(); + } + /* google.api.expr.v1alpha1.SourceInfo.Extension.Version version = 3; */ + if (message.version) + SourceInfo_Extension_Version.internalBinaryWrite(message.version, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.SourceInfo.Extension + */ +export const SourceInfo_Extension = new SourceInfo_Extension$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourceInfo_Extension_Version$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.SourceInfo.Extension.Version", [ + { no: 1, name: "major", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "minor", kind: "scalar", T: 3 /*ScalarType.INT64*/ } + ]); + } + create(value?: PartialMessage): SourceInfo_Extension_Version { + const message = { major: "0", minor: "0" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceInfo_Extension_Version): SourceInfo_Extension_Version { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 major */ 1: + message.major = reader.int64().toString(); + break; + case /* int64 minor */ 2: + message.minor = reader.int64().toString(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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(); + internalBinaryWrite(message: SourceInfo_Extension_Version, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 major = 1; */ + if (message.major !== "0") + writer.tag(1, WireType.Varint).int64(message.major); + /* int64 minor = 2; */ + if (message.minor !== "0") + writer.tag(2, WireType.Varint).int64(message.minor); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.SourceInfo.Extension.Version + */ +export const SourceInfo_Extension_Version = new SourceInfo_Extension_Version$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourcePosition$Type extends MessageType { + constructor() { + super("google.api.expr.v1alpha1.SourcePosition", [ + { no: 1, name: "location", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "offset", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "line", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "column", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): SourcePosition { + const message = { location: "", offset: 0, line: 0, column: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourcePosition): SourcePosition { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string location */ 1: + message.location = reader.string(); + break; + case /* int32 offset */ 2: + message.offset = reader.int32(); + break; + case /* int32 line */ 3: + message.line = reader.int32(); + break; + case /* int32 column */ 4: + message.column = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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); + return message; + } + internalBinaryWrite(message: SourcePosition, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string location = 1; */ + if (message.location !== "") + writer.tag(1, WireType.LengthDelimited).string(message.location); + /* int32 offset = 2; */ + if (message.offset !== 0) + writer.tag(2, WireType.Varint).int32(message.offset); + /* int32 line = 3; */ + if (message.line !== 0) + writer.tag(3, WireType.Varint).int32(message.line); + /* int32 column = 4; */ + if (message.column !== 0) + writer.tag(4, WireType.Varint).int32(message.column); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.api.expr.v1alpha1.SourcePosition + */ +export const SourcePosition = new SourcePosition$Type(); diff --git a/src/grpc/generated/google/api/http.ts b/src/grpc/generated/google/api/http.ts index 1a20c1b..a9d9d09 100644 --- a/src/grpc/generated/google/api/http.ts +++ b/src/grpc/generated/google/api/http.ts @@ -1,38 +1,59 @@ -// 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"; - +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/api/http.proto" (package "google.api", syntax proto3) +// tslint:disable +// +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; /** * 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. + * + * @generated from protobuf message google.api.Http */ 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; + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + * + * @generated from protobuf field: repeated google.api.HttpRule rules = 1; + */ + 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. + * + * @generated from protobuf field: bool fully_decode_reserved_expansion = 2; + */ + fullyDecodeReservedExpansion: boolean; } - /** * gRPC Transcoding * @@ -153,6 +174,7 @@ export interface Http { * string text = 2; * } * + * * The following HTTP JSON to RPC mapping is enabled: * * - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` @@ -297,496 +319,360 @@ export interface Http { * 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. + * + * @generated from protobuf message google.api.HttpRule */ 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. + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + * + * @generated from protobuf field: string selector = 1; */ - { $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 } - | // + selector: 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. + * @generated from protobuf oneof: pattern */ - { $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[]; + pattern: { + oneofKind: "get"; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + * + * @generated from protobuf field: string get = 2; + */ + get: string; + } | { + oneofKind: "put"; + /** + * Maps to HTTP PUT. Used for replacing a resource. + * + * @generated from protobuf field: string put = 3; + */ + put: string; + } | { + oneofKind: "post"; + /** + * Maps to HTTP POST. Used for creating a resource or performing an action. + * + * @generated from protobuf field: string post = 4; + */ + post: string; + } | { + oneofKind: "delete"; + /** + * Maps to HTTP DELETE. Used for deleting a resource. + * + * @generated from protobuf field: string delete = 5; + */ + delete: string; + } | { + oneofKind: "patch"; + /** + * Maps to HTTP PATCH. Used for updating a resource. + * + * @generated from protobuf field: string patch = 6; + */ + patch: string; + } | { + oneofKind: "custom"; + /** + * 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. + * + * @generated from protobuf field: google.api.CustomHttpPattern custom = 8; + */ + custom: CustomHttpPattern; + } | { + oneofKind: 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. + * + * @generated from protobuf field: string body = 7; + */ + 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. + * + * @generated from protobuf field: string response_body = 12; + */ + 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). + * + * @generated from protobuf field: repeated google.api.HttpRule additional_bindings = 11; + */ + additionalBindings: HttpRule[]; } - -/** A custom pattern is used for defining custom HTTP verb. */ +/** + * A custom pattern is used for defining custom HTTP verb. + * + * @generated from protobuf message google.api.CustomHttpPattern + */ 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 }; + /** + * The name of this custom HTTP verb. + * + * @generated from protobuf field: string kind = 1; + */ + kind: string; + /** + * The path matched by this custom verb. + * + * @generated from protobuf field: string path = 2; + */ + path: string; } - -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(); +// @generated message type with reflection information, may provide speed optimized methods +class Http$Type extends MessageType { + constructor() { + super("google.api.Http", [ + { no: 1, name: "rules", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HttpRule }, + { no: 2, name: "fully_decode_reserved_expansion", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); } - if (message.fullyDecodeReservedExpansion !== false) { - writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + create(value?: PartialMessage): Http { + const message = { rules: [], fullyDecodeReservedExpansion: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; } - 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; + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Http): Http { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.api.HttpRule rules */ 1: + message.rules.push(HttpRule.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* bool fully_decode_reserved_expansion */ 2: + message.fullyDecodeReservedExpansion = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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; + internalBinaryWrite(message: Http, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.api.HttpRule rules = 1; */ + for (let i = 0; i < message.rules.length; i++) + HttpRule.internalBinaryWrite(message.rules[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* bool fully_decode_reserved_expansion = 2; */ + if (message.fullyDecodeReservedExpansion !== false) + writer.tag(2, WireType.Varint).bool(message.fullyDecodeReservedExpansion); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message google.api.Http + */ +export const Http = new Http$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HttpRule$Type extends MessageType { + constructor() { + super("google.api.HttpRule", [ + { no: 1, name: "selector", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "get", kind: "scalar", oneof: "pattern", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "put", kind: "scalar", oneof: "pattern", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "post", kind: "scalar", oneof: "pattern", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "delete", kind: "scalar", oneof: "pattern", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "patch", kind: "scalar", oneof: "pattern", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "custom", kind: "message", oneof: "pattern", T: () => CustomHttpPattern }, + { no: 7, name: "body", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "response_body", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "additional_bindings", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HttpRule } + ]); } - for (const v of message.additionalBindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).join(); + create(value?: PartialMessage): HttpRule { + const message = { selector: "", pattern: { oneofKind: undefined }, body: "", responseBody: "", additionalBindings: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; } - 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; + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HttpRule): HttpRule { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string selector */ 1: + message.selector = reader.string(); + break; + case /* string get */ 2: + message.pattern = { + oneofKind: "get", + get: reader.string() + }; + break; + case /* string put */ 3: + message.pattern = { + oneofKind: "put", + put: reader.string() + }; + break; + case /* string post */ 4: + message.pattern = { + oneofKind: "post", + post: reader.string() + }; + break; + case /* string delete */ 5: + message.pattern = { + oneofKind: "delete", + delete: reader.string() + }; + break; + case /* string patch */ 6: + message.pattern = { + oneofKind: "patch", + patch: reader.string() + }; + break; + case /* google.api.CustomHttpPattern custom */ 8: + message.pattern = { + oneofKind: "custom", + custom: CustomHttpPattern.internalBinaryRead(reader, reader.uint32(), options, (message.pattern as any).custom) + }; + break; + case /* string body */ 7: + message.body = reader.string(); + break; + case /* string response_body */ 12: + message.responseBody = reader.string(); + break; + case /* repeated google.api.HttpRule additional_bindings */ 11: + message.additionalBindings.push(HttpRule.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - 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); + return message; } - if (message.body !== "") { - obj.body = message.body; + internalBinaryWrite(message: HttpRule, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string selector = 1; */ + if (message.selector !== "") + writer.tag(1, WireType.LengthDelimited).string(message.selector); + /* string get = 2; */ + if (message.pattern.oneofKind === "get") + writer.tag(2, WireType.LengthDelimited).string(message.pattern.get); + /* string put = 3; */ + if (message.pattern.oneofKind === "put") + writer.tag(3, WireType.LengthDelimited).string(message.pattern.put); + /* string post = 4; */ + if (message.pattern.oneofKind === "post") + writer.tag(4, WireType.LengthDelimited).string(message.pattern.post); + /* string delete = 5; */ + if (message.pattern.oneofKind === "delete") + writer.tag(5, WireType.LengthDelimited).string(message.pattern.delete); + /* string patch = 6; */ + if (message.pattern.oneofKind === "patch") + writer.tag(6, WireType.LengthDelimited).string(message.pattern.patch); + /* google.api.CustomHttpPattern custom = 8; */ + if (message.pattern.oneofKind === "custom") + CustomHttpPattern.internalBinaryWrite(message.pattern.custom, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* string body = 7; */ + if (message.body !== "") + writer.tag(7, WireType.LengthDelimited).string(message.body); + /* string response_body = 12; */ + if (message.responseBody !== "") + writer.tag(12, WireType.LengthDelimited).string(message.responseBody); + /* repeated google.api.HttpRule additional_bindings = 11; */ + for (let i = 0; i < message.additionalBindings.length; i++) + HttpRule.internalBinaryWrite(message.additionalBindings[i], writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message google.api.HttpRule + */ +export const HttpRule = new HttpRule$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CustomHttpPattern$Type extends MessageType { + constructor() { + super("google.api.CustomHttpPattern", [ + { no: 1, name: "kind", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "path", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); } - if (message.path !== "") { - writer.uint32(18).string(message.path); + create(value?: PartialMessage): CustomHttpPattern { + const message = { kind: "", path: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; } - 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; + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CustomHttpPattern): CustomHttpPattern { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string kind */ 1: + message.kind = reader.string(); + break; + case /* string path */ 2: + message.path = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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; + return message; } - if (message.path !== "") { - obj.path = message.path; + internalBinaryWrite(message: CustomHttpPattern, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string kind = 1; */ + if (message.kind !== "") + writer.tag(1, WireType.LengthDelimited).string(message.kind); + /* string path = 2; */ + if (message.path !== "") + writer.tag(2, WireType.LengthDelimited).string(message.path); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.api.CustomHttpPattern + */ +export const CustomHttpPattern = new CustomHttpPattern$Type(); diff --git a/src/grpc/generated/google/protobuf/any.ts b/src/grpc/generated/google/protobuf/any.ts index f1a5fab..03a8008 100644 --- a/src/grpc/generated/google/protobuf/any.ts +++ b/src/grpc/generated/google/protobuf/any.ts @@ -1,15 +1,54 @@ -// 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"; - +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/protobuf/any.proto" (package "google.protobuf", syntax proto3) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { isJsonObject } from "@protobuf-ts/runtime"; +import { typeofJsonValue } from "@protobuf-ts/runtime"; +import type { JsonValue } from "@protobuf-ts/runtime"; +import { jsonWriteOptions } from "@protobuf-ts/runtime"; +import type { JsonReadOptions } from "@protobuf-ts/runtime"; +import type { JsonWriteOptions } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IMessageType } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; /** * `Any` contains an arbitrary serialized protocol buffer message along with a * URL that describes the type of the serialized message. @@ -96,145 +135,192 @@ export const protobufPackage = "google.protobuf"; * "@type": "type.googleapis.com/google.protobuf.Duration", * "value": "1.212s" * } + * + * + * @generated from protobuf message google.protobuf.Any */ 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; + /** + * 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. + * + * + * @generated from protobuf field: string type_url = 1; + */ + typeUrl: string; + /** + * Must be a valid serialized protocol buffer of the above specified type. + * + * @generated from protobuf field: bytes value = 2; + */ + value: Uint8Array; } - -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); +// @generated message type with reflection information, may provide speed optimized methods +class Any$Type extends MessageType { + constructor() { + super("google.protobuf.Any", [ + { no: 1, name: "type_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "value", kind: "scalar", T: 12 /*ScalarType.BYTES*/ } + ]); } - if (message.value.length !== 0) { - writer.uint32(18).bytes(message.value); + /** + * Pack the message into a new `Any`. + * + * Uses 'type.googleapis.com/full.type.name' as the type URL. + */ + pack(message: T, type: IMessageType): Any { + return { + typeUrl: this.typeNameToUrl(type.typeName), value: type.toBinary(message), + }; } - 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; + /** + * Unpack the message from the `Any`. + */ + unpack(any: Any, type: IMessageType, options?: Partial): T { + if (!this.contains(any, type)) + throw new Error("Cannot unpack google.protobuf.Any with typeUrl '" + any.typeUrl + "' as " + type.typeName + "."); + return type.fromBinary(any.value, options); + } + /** + * Does the given `Any` contain a packed message of the given type? + */ + contains(any: Any, type: IMessageType | string): boolean { + if (!any.typeUrl.length) + return false; + let wants = typeof type == "string" ? type : type.typeName; + let has = this.typeUrlToName(any.typeUrl); + return wants === has; + } + /** + * Convert the message to canonical JSON value. + * + * You have to provide the `typeRegistry` option so that the + * packed message can be converted to JSON. + * + * The `typeRegistry` option is also required to read + * `google.protobuf.Any` from JSON format. + */ + internalJsonWrite(any: Any, options: JsonWriteOptions): JsonValue { + if (any.typeUrl === "") + return {}; + let typeName = this.typeUrlToName(any.typeUrl); + let opt = jsonWriteOptions(options); + let type = opt.typeRegistry?.find(t => t.typeName === typeName); + if (!type) + throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '" + any.typeUrl + "' to JSON. The specified type " + typeName + " is not available in the type registry."); + let value = type.fromBinary(any.value, { readUnknownField: false }); + let json = type.internalJsonWrite(value, opt); + if (typeName.startsWith("google.protobuf.") || !isJsonObject(json)) + json = { value: json }; + json["@type"] = any.typeUrl; + return json; + } + internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Any): Any { + if (!isJsonObject(json)) + throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON " + typeofJsonValue(json) + "."); + if (typeof json["@type"] != "string" || json["@type"] == "") + return this.create(); + let typeName = this.typeUrlToName(json["@type"]); + let type = options?.typeRegistry?.find(t => t.typeName == typeName); + if (!type) + throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type " + typeName + " is not available in the type registry."); + let value; + if (typeName.startsWith("google.protobuf.") && json.hasOwnProperty("value")) + value = type.fromJson(json["value"], options); + else { + let copy = Object.assign({}, json); + delete copy["@type"]; + value = type.fromJson(copy, options); } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + if (target === undefined) + target = this.create(); + target.typeUrl = json["@type"]; + target.value = type.toBinary(value); + return target; } - 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; + typeNameToUrl(name: string): string { + if (!name.length) + throw new Error("invalid type name: " + name); + return "type.googleapis.com/" + name; } - if (message.value.length !== 0) { - obj.value = base64FromBytes(message.value); + typeUrlToName(url: string): string { + if (!url.length) + throw new Error("invalid type url: " + url); + let slash = url.lastIndexOf("/"); + let name = slash > 0 ? url.substring(slash + 1) : url; + if (!name.length) + throw new Error("invalid type url: " + url); + return name; + } + create(value?: PartialMessage): Any { + const message = { typeUrl: "", value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Any): Any { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string type_url */ 1: + message.typeUrl = reader.string(); + break; + case /* bytes value */ 2: + message.value = reader.bytes(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Any, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string type_url = 1; */ + if (message.typeUrl !== "") + writer.tag(1, WireType.LengthDelimited).string(message.typeUrl); + /* bytes value = 2; */ + if (message.value.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.protobuf.Any + */ +export const Any = new Any$Type(); diff --git a/src/grpc/generated/google/protobuf/descriptor.ts b/src/grpc/generated/google/protobuf/descriptor.ts index e4f3f8d..7e64e56 100644 --- a/src/grpc/generated/google/protobuf/descriptor.ts +++ b/src/grpc/generated/google/protobuf/descriptor.ts @@ -1,693 +1,626 @@ -// 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 relied 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"; - } -} - -/** - * Describes the 'visibility' of a symbol with respect to the proto import - * system. Symbols can only be imported when the visibility rules do not prevent - * it (ex: local symbols cannot be imported). Visibility modifiers can only set - * on `message` and `enum` as they are the only types available to be referenced - * from other files. - */ -export enum SymbolVisibility { - VISIBILITY_UNSET = 0, - VISIBILITY_LOCAL = 1, - VISIBILITY_EXPORT = 2, - UNRECOGNIZED = -1, -} - -export function symbolVisibilityFromJSON(object: any): SymbolVisibility { - switch (object) { - case 0: - case "VISIBILITY_UNSET": - return SymbolVisibility.VISIBILITY_UNSET; - case 1: - case "VISIBILITY_LOCAL": - return SymbolVisibility.VISIBILITY_LOCAL; - case 2: - case "VISIBILITY_EXPORT": - return SymbolVisibility.VISIBILITY_EXPORT; - case -1: - case "UNRECOGNIZED": - default: - return SymbolVisibility.UNRECOGNIZED; - } -} - -export function symbolVisibilityToJSON(object: SymbolVisibility): string { - switch (object) { - case SymbolVisibility.VISIBILITY_UNSET: - return "VISIBILITY_UNSET"; - case SymbolVisibility.VISIBILITY_LOCAL: - return "VISIBILITY_LOCAL"; - case SymbolVisibility.VISIBILITY_EXPORT: - return "VISIBILITY_EXPORT"; - case SymbolVisibility.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/protobuf/descriptor.proto" (package "google.protobuf", syntax proto2) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; /** * The protocol compiler can output a FileDescriptorSet containing the .proto * files it parses. + * + * @generated from protobuf message google.protobuf.FileDescriptorSet */ export interface FileDescriptorSet { - file: FileDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file: FileDescriptorProto[]; } - -/** Describes a complete .proto file. */ +/** + * Describes a complete .proto file. + * + * @generated from protobuf message google.protobuf.FileDescriptorProto + */ 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[]; - /** - * Names of files imported by this file purely for the purpose of providing - * option extensions. These are excluded from the dependency list above. - */ - optionDependency: string[]; - /** 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". - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - syntax?: - | string - | undefined; - /** - * The edition of the proto file. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - edition?: Edition | undefined; + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; // file name, relative to root of source tree + /** + * @generated from protobuf field: optional string package = 2; + */ + package?: string; // e.g. "foo", "foo.bar", etc. + /** + * Names of files imported by this file. + * + * @generated from protobuf field: repeated string dependency = 3; + */ + dependency: string[]; + /** + * Indexes of the public imported files in the dependency list above. + * + * @generated from protobuf field: repeated int32 public_dependency = 10; + */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + * + * @generated from protobuf field: repeated int32 weak_dependency = 11; + */ + weakDependency: number[]; + /** + * Names of files imported by this file purely for the purpose of providing + * option extensions. These are excluded from the dependency list above. + * + * @generated from protobuf field: repeated string option_dependency = 15; + */ + optionDependency: string[]; + /** + * All top-level definitions in this file. + * + * @generated from protobuf field: repeated google.protobuf.DescriptorProto message_type = 4; + */ + messageType: DescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.EnumDescriptorProto enum_type = 5; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.ServiceDescriptorProto service = 6; + */ + service: ServiceDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.FieldDescriptorProto extension = 7; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.FileOptions options = 8; + */ + options?: FileOptions; + /** + * 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. + * + * @generated from protobuf field: optional google.protobuf.SourceCodeInfo source_code_info = 9; + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional string syntax = 12; + */ + syntax?: string; + /** + * The edition of the proto file. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.Edition edition = 14; + */ + edition?: Edition; } - -/** Describes a message type. */ +/** + * Describes a message type. + * + * @generated from protobuf message google.protobuf.DescriptorProto + */ 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[]; - /** Support for `export` and `local` keywords on enums. */ - visibility?: SymbolVisibility | undefined; + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: repeated google.protobuf.FieldDescriptorProto field = 2; + */ + field: FieldDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.FieldDescriptorProto extension = 6; + */ + extension: FieldDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.DescriptorProto nested_type = 3; + */ + nestedType: DescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.EnumDescriptorProto enum_type = 4; + */ + enumType: EnumDescriptorProto[]; + /** + * @generated from protobuf field: repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; + */ + extensionRange: DescriptorProto_ExtensionRange[]; + /** + * @generated from protobuf field: repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; + */ + oneofDecl: OneofDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.MessageOptions options = 7; + */ + options?: MessageOptions; + /** + * @generated from protobuf field: repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; + */ + 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. + * + * @generated from protobuf field: repeated string reserved_name = 10; + */ + reservedName: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from protobuf field: optional google.protobuf.SymbolVisibility visibility = 11; + */ + visibility?: SymbolVisibility; } - +/** + * @generated from protobuf message google.protobuf.DescriptorProto.ExtensionRange + */ export interface DescriptorProto_ExtensionRange { - /** Inclusive. */ - start?: - | number - | undefined; - /** Exclusive. */ - end?: number | undefined; - options?: ExtensionRangeOptions | undefined; + /** + * @generated from protobuf field: optional int32 start = 1; + */ + start?: number; // Inclusive. + /** + * @generated from protobuf field: optional int32 end = 2; + */ + end?: number; // Exclusive. + /** + * @generated from protobuf field: optional google.protobuf.ExtensionRangeOptions options = 3; + */ + options?: ExtensionRangeOptions; } - /** * 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. + * + * @generated from protobuf message google.protobuf.DescriptorProto.ReservedRange */ export interface DescriptorProto_ReservedRange { - /** Inclusive. */ - start?: - | number - | undefined; - /** Exclusive. */ - end?: number | undefined; + /** + * @generated from protobuf field: optional int32 start = 1; + */ + start?: number; // Inclusive. + /** + * @generated from protobuf field: optional int32 end = 2; + */ + end?: number; // Exclusive. } - +/** + * @generated from protobuf message google.protobuf.ExtensionRangeOptions + */ 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"; - } + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + 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. + * + * @generated from protobuf field: repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; + */ + declaration: ExtensionRangeOptions_Declaration[]; + /** + * Any features defined in the specific edition. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet; + /** + * The verification state of the range. + * TODO: flip the default to DECLARATION once all empty ranges + * are marked as UNVERIFIED. + * + * @generated from protobuf field: optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3; + */ + verification?: ExtensionRangeOptions_VerificationState; } - +/** + * @generated from protobuf message google.protobuf.ExtensionRangeOptions.Declaration + */ 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; + /** + * The extension number declared within the extension range. + * + * @generated from protobuf field: optional int32 number = 1; + */ + number?: number; + /** + * The fully-qualified name of the extension field. There must be a leading + * dot in front of the full name. + * + * @generated from protobuf field: optional string full_name = 2; + */ + fullName?: string; + /** + * The fully-qualified type name of the extension field. Unlike + * Metadata.type, Declaration.type must have a leading dot for messages + * and enums. + * + * @generated from protobuf field: optional string type = 3; + */ + type?: string; + /** + * 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. + * + * @generated from protobuf field: optional bool reserved = 5; + */ + reserved?: boolean; + /** + * If true, indicates that the extension must be defined as repeated. + * Otherwise the extension must be defined as optional. + * + * @generated from protobuf field: optional bool repeated = 6; + */ + repeated?: boolean; } - -/** Describes a field within a message. */ +/** + * The verification state of the extension range. + * + * @generated from protobuf enum google.protobuf.ExtensionRangeOptions.VerificationState + */ +export enum ExtensionRangeOptions_VerificationState { + /** + * All the extensions of the range must be declared. + * + * @generated from protobuf enum value: DECLARATION = 0; + */ + DECLARATION = 0, + /** + * @generated from protobuf enum value: UNVERIFIED = 1; + */ + UNVERIFIED = 1 +} +/** + * Describes a field within a message. + * + * @generated from protobuf message google.protobuf.FieldDescriptorProto + */ 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; + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: optional int32 number = 3; + */ + number?: number; + /** + * @generated from protobuf field: optional google.protobuf.FieldDescriptorProto.Label label = 4; + */ + label?: FieldDescriptorProto_Label; + /** + * 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. + * + * @generated from protobuf field: optional google.protobuf.FieldDescriptorProto.Type type = 5; + */ + type?: FieldDescriptorProto_Type; + /** + * 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). + * + * @generated from protobuf field: optional string type_name = 6; + */ + typeName?: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + * + * @generated from protobuf field: optional string extendee = 2; + */ + extendee?: string; + /** + * 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. + * + * @generated from protobuf field: optional string default_value = 7; + */ + defaultValue?: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + * + * @generated from protobuf field: optional int32 oneof_index = 9; + */ + oneofIndex?: number; + /** + * 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. + * + * @generated from protobuf field: optional string json_name = 10; + */ + jsonName?: string; + /** + * @generated from protobuf field: optional google.protobuf.FieldOptions options = 8; + */ + options?: FieldOptions; + /** + * 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`. + * + * @generated from protobuf field: optional bool proto3_optional = 17; + */ + proto3Optional?: boolean; } - +/** + * @generated from protobuf enum google.protobuf.FieldDescriptorProto.Type + */ 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"; - } + /** + * @generated synthetic value - protobuf-ts requires all enums to have a 0 value + */ + UNSPECIFIED$ = 0, + /** + * 0 is reserved for errors. + * Order is weird for historical reasons. + * + * @generated from protobuf enum value: TYPE_DOUBLE = 1; + */ + DOUBLE = 1, + /** + * @generated from protobuf enum value: TYPE_FLOAT = 2; + */ + FLOAT = 2, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + * + * @generated from protobuf enum value: TYPE_INT64 = 3; + */ + INT64 = 3, + /** + * @generated from protobuf enum value: TYPE_UINT64 = 4; + */ + UINT64 = 4, + /** + * Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + * + * @generated from protobuf enum value: TYPE_INT32 = 5; + */ + INT32 = 5, + /** + * @generated from protobuf enum value: TYPE_FIXED64 = 6; + */ + FIXED64 = 6, + /** + * @generated from protobuf enum value: TYPE_FIXED32 = 7; + */ + FIXED32 = 7, + /** + * @generated from protobuf enum value: TYPE_BOOL = 8; + */ + BOOL = 8, + /** + * @generated from protobuf enum value: TYPE_STRING = 9; + */ + STRING = 9, + /** + * 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. + * + * @generated from protobuf enum value: TYPE_GROUP = 10; + */ + GROUP = 10, + /** + * Length-delimited aggregate. + * + * @generated from protobuf enum value: TYPE_MESSAGE = 11; + */ + MESSAGE = 11, + /** + * New in version 2. + * + * @generated from protobuf enum value: TYPE_BYTES = 12; + */ + BYTES = 12, + /** + * @generated from protobuf enum value: TYPE_UINT32 = 13; + */ + UINT32 = 13, + /** + * @generated from protobuf enum value: TYPE_ENUM = 14; + */ + ENUM = 14, + /** + * @generated from protobuf enum value: TYPE_SFIXED32 = 15; + */ + SFIXED32 = 15, + /** + * @generated from protobuf enum value: TYPE_SFIXED64 = 16; + */ + SFIXED64 = 16, + /** + * Uses ZigZag encoding. + * + * @generated from protobuf enum value: TYPE_SINT32 = 17; + */ + SINT32 = 17, + /** + * Uses ZigZag encoding. + * + * @generated from protobuf enum value: TYPE_SINT64 = 18; + */ + SINT64 = 18 } - +/** + * @generated from protobuf enum google.protobuf.FieldDescriptorProto.Label + */ 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; - } + /** + * @generated synthetic value - protobuf-ts requires all enums to have a 0 value + */ + UNSPECIFIED$ = 0, + /** + * 0 is reserved for errors + * + * @generated from protobuf enum value: LABEL_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * @generated from protobuf enum value: LABEL_REPEATED = 3; + */ + REPEATED = 3, + /** + * 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. + * + * @generated from protobuf enum value: LABEL_REQUIRED = 2; + */ + REQUIRED = 2 } - -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. */ +/** + * Describes a oneof. + * + * @generated from protobuf message google.protobuf.OneofDescriptorProto + */ export interface OneofDescriptorProto { - name?: string | undefined; - options?: OneofOptions | undefined; + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: optional google.protobuf.OneofOptions options = 2; + */ + options?: OneofOptions; } - -/** Describes an enum type. */ +/** + * Describes an enum type. + * + * @generated from protobuf message google.protobuf.EnumDescriptorProto + */ 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[]; - /** Support for `export` and `local` keywords on enums. */ - visibility?: SymbolVisibility | undefined; + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: repeated google.protobuf.EnumValueDescriptorProto value = 2; + */ + value: EnumValueDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.EnumOptions options = 3; + */ + options?: EnumOptions; + /** + * 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. + * + * @generated from protobuf field: repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + * + * @generated from protobuf field: repeated string reserved_name = 5; + */ + reservedName: string[]; + /** + * Support for `export` and `local` keywords on enums. + * + * @generated from protobuf field: optional google.protobuf.SymbolVisibility visibility = 6; + */ + visibility?: SymbolVisibility; } - /** * Range of reserved numeric values. Reserved values may not be used by * entries in the same enum. Reserved ranges may not overlap. @@ -695,909 +628,947 @@ export interface EnumDescriptorProto { * Note that this is distinct from DescriptorProto.ReservedRange in that it * is inclusive such that it can appropriately represent the entire int32 * domain. + * + * @generated from protobuf message google.protobuf.EnumDescriptorProto.EnumReservedRange */ export interface EnumDescriptorProto_EnumReservedRange { - /** Inclusive. */ - start?: - | number - | undefined; - /** Inclusive. */ - end?: number | undefined; + /** + * @generated from protobuf field: optional int32 start = 1; + */ + start?: number; // Inclusive. + /** + * @generated from protobuf field: optional int32 end = 2; + */ + end?: number; // Inclusive. } - -/** Describes a value within an enum. */ +/** + * Describes a value within an enum. + * + * @generated from protobuf message google.protobuf.EnumValueDescriptorProto + */ export interface EnumValueDescriptorProto { - name?: string | undefined; - number?: number | undefined; - options?: EnumValueOptions | undefined; + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: optional int32 number = 2; + */ + number?: number; + /** + * @generated from protobuf field: optional google.protobuf.EnumValueOptions options = 3; + */ + options?: EnumValueOptions; } - -/** Describes a service. */ +/** + * Describes a service. + * + * @generated from protobuf message google.protobuf.ServiceDescriptorProto + */ export interface ServiceDescriptorProto { - name?: string | undefined; - method: MethodDescriptorProto[]; - options?: ServiceOptions | undefined; + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * @generated from protobuf field: repeated google.protobuf.MethodDescriptorProto method = 2; + */ + method: MethodDescriptorProto[]; + /** + * @generated from protobuf field: optional google.protobuf.ServiceOptions options = 3; + */ + options?: ServiceOptions; } - -/** Describes a method of a service. */ +/** + * Describes a method of a service. + * + * @generated from protobuf message google.protobuf.MethodDescriptorProto + */ 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; -} + /** + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + * + * @generated from protobuf field: optional string input_type = 2; + */ + inputType?: string; + /** + * @generated from protobuf field: optional string output_type = 3; + */ + outputType?: string; + /** + * @generated from protobuf field: optional google.protobuf.MethodOptions options = 4; + */ + options?: MethodOptions; + /** + * Identifies if client streams multiple client messages + * + * @generated from protobuf field: optional bool client_streaming = 5; + */ + clientStreaming?: boolean; + /** + * Identifies if server streams multiple server messages + * + * @generated from protobuf field: optional bool server_streaming = 6; + */ + serverStreaming?: boolean; +} +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. +/** + * @generated from protobuf message google.protobuf.FileOptions + */ 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. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpretedOption: UninterpretedOption[]; + /** + * 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. + * + * @generated from protobuf field: optional string java_package = 1; + */ + javaPackage?: string; + /** + * 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. + * + * @generated from protobuf field: optional string java_outer_classname = 8; + */ + javaOuterClassname?: string; + /** + * 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. + * + * @generated from protobuf field: optional bool java_multiple_files = 10; + */ + javaMultipleFiles?: boolean; + /** + * This option does nothing. + * + * @deprecated + * @generated from protobuf field: optional bool java_generate_equals_and_hash = 20 [deprecated = true]; + */ + javaGenerateEqualsAndHash?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional bool java_string_check_utf8 = 27; + */ + javaStringCheckUtf8?: boolean; + /** + * @generated from protobuf field: optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9; + */ + optimizeFor?: FileOptions_OptimizeMode; + /** + * 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. + * + * @generated from protobuf field: optional string go_package = 11; + */ + goPackage?: string; + /** + * 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. + * + * @generated from protobuf field: optional bool cc_generic_services = 16; + */ + ccGenericServices?: boolean; + /** + * @generated from protobuf field: optional bool java_generic_services = 17; + */ + javaGenericServices?: boolean; + /** + * @generated from protobuf field: optional bool py_generic_services = 18; + */ + pyGenericServices?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 23; + */ + deprecated?: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + * + * @generated from protobuf field: optional bool cc_enable_arenas = 31; + */ + ccEnableArenas?: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + * + * @generated from protobuf field: optional string objc_class_prefix = 36; + */ + objcClassPrefix?: string; + /** + * Namespace for generated classes; defaults to the package. + * + * @generated from protobuf field: optional string csharp_namespace = 37; + */ + csharpNamespace?: string; + /** + * 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. + * + * @generated from protobuf field: optional string swift_prefix = 39; + */ + swiftPrefix?: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + * + * @generated from protobuf field: optional string php_class_prefix = 40; + */ + phpClassPrefix?: string; + /** + * 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. + * + * @generated from protobuf field: optional string php_namespace = 41; + */ + phpNamespace?: string; + /** + * 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. + * + * @generated from protobuf field: optional string php_metadata_namespace = 44; + */ + phpMetadataNamespace?: string; + /** + * 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. + * + * @generated from protobuf field: optional string ruby_package = 45; + */ + rubyPackage?: string; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 50; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; } - -/** Generated classes can be optimized for speed or code size. */ +/** + * Generated classes can be optimized for speed or code size. + * + * @generated from protobuf enum google.protobuf.FileOptions.OptimizeMode + */ 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"; - } + /** + * @generated synthetic value - protobuf-ts requires all enums to have a 0 value + */ + UNSPECIFIED$ = 0, + /** + * Generate complete code for parsing, serialization, + * + * @generated from protobuf enum value: SPEED = 1; + */ + SPEED = 1, + /** + * etc. + * + * Use ReflectionOps to implement these methods. + * + * @generated from protobuf enum value: CODE_SIZE = 2; + */ + CODE_SIZE = 2, + /** + * Generate code using MessageLite and the lite runtime. + * + * @generated from protobuf enum value: LITE_RUNTIME = 3; + */ + LITE_RUNTIME = 3 } - +/** + * @generated from protobuf message google.protobuf.MessageOptions + */ 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. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + /** + * 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. + * + * @generated from protobuf field: optional bool message_set_wire_format = 1; + */ + messageSetWireFormat?: boolean; + /** + * 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". + * + * @generated from protobuf field: optional bool no_standard_descriptor_accessor = 2; + */ + noStandardDescriptorAccessor?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 3; + */ + deprecated?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional bool map_entry = 7; + */ + mapEntry?: boolean; + /** + * 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 + * @generated from protobuf field: optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 12; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; } - +/** + * @generated from protobuf message google.protobuf.FieldOptions + */ export interface FieldOptions { - /** - * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. - * 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. - * TODO: make ctype actually deprecated. - */ - 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. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: FeatureSet | undefined; - featureSupport?: - | FieldOptions_FeatureSupport - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + /** + * NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead. + * 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. + * TODO: make ctype actually deprecated. + * + * @generated from protobuf field: optional google.protobuf.FieldOptions.CType ctype = 1; + */ + ctype?: FieldOptions_CType; + /** + * 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. + * + * @generated from protobuf field: optional bool packed = 2; + */ + packed?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional google.protobuf.FieldOptions.JSType jstype = 6; + */ + jstype?: FieldOptions_JSType; + /** + * 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). + * + * @generated from protobuf field: optional bool lazy = 5; + */ + lazy?: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + * + * @generated from protobuf field: optional bool unverified_lazy = 15; + */ + unverifiedLazy?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 3; + */ + deprecated?: boolean; + /** + * For Google-internal migration only. Do not use. + * + * @generated from protobuf field: optional bool weak = 10; + */ + weak?: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + * + * @generated from protobuf field: optional bool debug_redact = 16; + */ + debugRedact?: boolean; + /** + * @generated from protobuf field: optional google.protobuf.FieldOptions.OptionRetention retention = 17; + */ + retention?: FieldOptions_OptionRetention; + /** + * @generated from protobuf field: repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; + */ + targets: FieldOptions_OptionTargetType[]; + /** + * @generated from protobuf field: repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; + */ + editionDefaults: FieldOptions_EditionDefault[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 21; + */ + features?: FeatureSet; + /** + * @generated from protobuf field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + 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, +/** + * @generated from protobuf message google.protobuf.FieldOptions.EditionDefault + */ +export interface FieldOptions_EditionDefault { + /** + * @generated from protobuf field: optional google.protobuf.Edition edition = 3; + */ + edition?: Edition; + /** + * @generated from protobuf field: optional string value = 2; + */ + value?: string; // Textproto value. } - -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; - } +/** + * Information about the support window of a feature. + * + * @generated from protobuf message google.protobuf.FieldOptions.FeatureSupport + */ +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. + * + * @generated from protobuf field: optional google.protobuf.Edition edition_introduced = 1; + */ + editionIntroduced?: Edition; + /** + * The edition this feature becomes deprecated in. Using this after this + * edition may trigger warnings. + * + * @generated from protobuf field: optional google.protobuf.Edition edition_deprecated = 2; + */ + editionDeprecated?: Edition; + /** + * The deprecation warning text if this feature is used after the edition it + * was marked deprecated in. + * + * @generated from protobuf field: optional string deprecation_warning = 3; + */ + deprecationWarning?: string; + /** + * 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. + * + * @generated from protobuf field: optional google.protobuf.Edition edition_removed = 4; + */ + editionRemoved?: Edition; } - -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"; - } +/** + * @generated from protobuf enum google.protobuf.FieldOptions.CType + */ +export enum FieldOptions_CType { + /** + * Default mode. + * + * @generated from protobuf enum value: STRING = 0; + */ + STRING = 0, + /** + * 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. + * + * @generated from protobuf enum value: CORD = 1; + */ + CORD = 1, + /** + * @generated from protobuf enum value: STRING_PIECE = 2; + */ + STRING_PIECE = 2 } - +/** + * @generated from protobuf enum google.protobuf.FieldOptions.JSType + */ 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; - } + /** + * Use the default type. + * + * @generated from protobuf enum value: JS_NORMAL = 0; + */ + JS_NORMAL = 0, + /** + * Use JavaScript strings. + * + * @generated from protobuf enum value: JS_STRING = 1; + */ + JS_STRING = 1, + /** + * Use JavaScript numbers. + * + * @generated from protobuf enum value: JS_NUMBER = 2; + */ + JS_NUMBER = 2 } - -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. */ +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * + * @generated from protobuf enum google.protobuf.FieldOptions.OptionRetention + */ 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; - } + /** + * @generated from protobuf enum value: RETENTION_UNKNOWN = 0; + */ + RETENTION_UNKNOWN = 0, + /** + * @generated from protobuf enum value: RETENTION_RUNTIME = 1; + */ + RETENTION_RUNTIME = 1, + /** + * @generated from protobuf enum value: RETENTION_SOURCE = 2; + */ + RETENTION_SOURCE = 2 } - -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. + * + * @generated from protobuf enum google.protobuf.FieldOptions.OptionTargetType */ 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, + /** + * @generated from protobuf enum value: TARGET_TYPE_UNKNOWN = 0; + */ + TARGET_TYPE_UNKNOWN = 0, + /** + * @generated from protobuf enum value: TARGET_TYPE_FILE = 1; + */ + TARGET_TYPE_FILE = 1, + /** + * @generated from protobuf enum value: TARGET_TYPE_EXTENSION_RANGE = 2; + */ + TARGET_TYPE_EXTENSION_RANGE = 2, + /** + * @generated from protobuf enum value: TARGET_TYPE_MESSAGE = 3; + */ + TARGET_TYPE_MESSAGE = 3, + /** + * @generated from protobuf enum value: TARGET_TYPE_FIELD = 4; + */ + TARGET_TYPE_FIELD = 4, + /** + * @generated from protobuf enum value: TARGET_TYPE_ONEOF = 5; + */ + TARGET_TYPE_ONEOF = 5, + /** + * @generated from protobuf enum value: TARGET_TYPE_ENUM = 6; + */ + TARGET_TYPE_ENUM = 6, + /** + * @generated from protobuf enum value: TARGET_TYPE_ENUM_ENTRY = 7; + */ + TARGET_TYPE_ENUM_ENTRY = 7, + /** + * @generated from protobuf enum value: TARGET_TYPE_SERVICE = 8; + */ + TARGET_TYPE_SERVICE = 8, + /** + * @generated from protobuf enum value: TARGET_TYPE_METHOD = 9; + */ + TARGET_TYPE_METHOD = 9 } - -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; -} - +/** + * @generated from protobuf message google.protobuf.OneofOptions + */ export interface OneofOptions { - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 1; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; } - +/** + * @generated from protobuf message google.protobuf.EnumOptions + */ 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. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + /** + * Set this option to true to allow mapping different tag names to the same + * value. + * + * @generated from protobuf field: optional bool allow_alias = 2; + */ + allowAlias?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 3; + */ + deprecated?: boolean; + /** + * 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 + * @generated from protobuf field: optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + */ + deprecatedLegacyJsonFieldConflicts?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 7; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; } - +/** + * @generated from protobuf message google.protobuf.EnumValueOptions + */ 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. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - 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[]; + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 1; + */ + deprecated?: boolean; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 2; + */ + features?: FeatureSet; + /** + * 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. + * + * @generated from protobuf field: optional bool debug_redact = 3; + */ + debugRedact?: boolean; + /** + * Information about the support window of a feature value. + * + * @generated from protobuf field: optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; + */ + featureSupport?: FieldOptions_FeatureSupport; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; } - +/** + * @generated from protobuf message google.protobuf.ServiceOptions + */ export interface ServiceOptions { - /** - * Any features defined in the specific edition. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - 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[]; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 34; + */ + features?: FeatureSet; + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 33; + */ + deprecated?: boolean; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; } - +/** + * @generated from protobuf message google.protobuf.MethodOptions + */ 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. - * WARNING: This field should only be used by protobuf plugins or special - * cases like the proto compiler. Other uses are discouraged and - * developers should rely on the protoreflect APIs for their client language. - */ - features?: - | FeatureSet - | undefined; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 33; + */ + deprecated?: boolean; + /** + * @generated from protobuf field: optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34; + */ + idempotencyLevel?: MethodOptions_IdempotencyLevel; + /** + * Any features defined in the specific edition. + * WARNING: This field should only be used by protobuf plugins or special + * cases like the proto compiler. Other uses are discouraged and + * developers should rely on the protoreflect APIs for their client language. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet features = 35; + */ + features?: FeatureSet; + /** + * The parser stores options it doesn't recognize here. See above. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + 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. + * + * @generated from protobuf enum google.protobuf.MethodOptions.IdempotencyLevel */ 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"; - } + /** + * @generated from protobuf enum value: IDEMPOTENCY_UNKNOWN = 0; + */ + IDEMPOTENCY_UNKNOWN = 0, + /** + * implies idempotent + * + * @generated from protobuf enum value: NO_SIDE_EFFECTS = 1; + */ + NO_SIDE_EFFECTS = 1, + /** + * idempotent, but may have side effects + * + * @generated from protobuf enum value: IDEMPOTENT = 2; + */ + IDEMPOTENT = 2 } - /** * A message representing a option the parser does not recognize. This only * appears in options protos created by the compiler::Parser class. @@ -1605,32 +1576,63 @@ export function methodOptions_IdempotencyLevelToJSON(object: MethodOptions_Idemp * options protos in descriptor objects (e.g. returned by Descriptor::options(), * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions * in them. + * + * @generated from protobuf message google.protobuf.UninterpretedOption */ 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; + /** + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption.NamePart name = 2; + */ + 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. + * + * @generated from protobuf field: optional string identifier_value = 3; + */ + identifierValue?: string; + /** + * @generated from protobuf field: optional uint64 positive_int_value = 4; + */ + positiveIntValue?: string; + /** + * @generated from protobuf field: optional int64 negative_int_value = 5; + */ + negativeIntValue?: string; + /** + * @generated from protobuf field: optional double double_value = 6; + */ + doubleValue?: number; + /** + * @generated from protobuf field: optional bytes string_value = 7; + */ + stringValue?: Uint8Array; + /** + * @generated from protobuf field: optional string aggregate_value = 8; + */ + aggregateValue?: string; } - /** * 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". + * + * @generated from protobuf message google.protobuf.UninterpretedOption.NamePart */ export interface UninterpretedOption_NamePart { - namePart: string; - isExtension: boolean; -} + /** + * @generated from protobuf field: string name_part = 1; + */ + namePart: string; + /** + * @generated from protobuf field: bool is_extension = 2; + */ + isExtension: boolean; +} +// =================================================================== +// Features /** * TODO Enums in C++ gencode (and potentially other languages) are @@ -1639,5303 +1641,3204 @@ export interface UninterpretedOption_NamePart { * 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. + * + * @generated from protobuf message google.protobuf.FeatureSet */ 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; - enforceNamingStyle?: FeatureSet_EnforceNamingStyle | undefined; - defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibility | undefined; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; + */ + fieldPresence?: FeatureSet_FieldPresence; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.EnumType enum_type = 2; + */ + enumType?: FeatureSet_EnumType; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; + */ + repeatedFieldEncoding?: FeatureSet_RepeatedFieldEncoding; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; + */ + utf8Validation?: FeatureSet_Utf8Validation; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; + */ + messageEncoding?: FeatureSet_MessageEncoding; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.JsonFormat json_format = 6; + */ + jsonFormat?: FeatureSet_JsonFormat; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; + */ + enforceNamingStyle?: FeatureSet_EnforceNamingStyle; + /** + * @generated from protobuf field: optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; + */ + defaultSymbolVisibility?: FeatureSet_VisibilityFeature_DefaultSymbolVisibility; } - -export enum FeatureSet_FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0, - EXPLICIT = 1, - IMPLICIT = 2, - LEGACY_REQUIRED = 3, - UNRECOGNIZED = -1, +/** + * @generated from protobuf message google.protobuf.FeatureSet.VisibilityFeature + */ +export interface FeatureSet_VisibilityFeature { } - -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; - } +/** + * @generated from protobuf enum google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility + */ +export enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility { + /** + * @generated from protobuf enum value: DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0; + */ + DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, + /** + * Default pre-EDITION_2024, all UNSET visibility are export. + * + * @generated from protobuf enum value: EXPORT_ALL = 1; + */ + EXPORT_ALL = 1, + /** + * All top-level symbols default to export, nested default to local. + * + * @generated from protobuf enum value: EXPORT_TOP_LEVEL = 2; + */ + EXPORT_TOP_LEVEL = 2, + /** + * All symbols default to local. + * + * @generated from protobuf enum value: LOCAL_ALL = 3; + */ + LOCAL_ALL = 3, + /** + * All symbols local by default. Nested types cannot be exported. + * With special case caveat for message { enum {} reserved 1 to max; } + * This is the recommended setting for new protos. + * + * @generated from protobuf enum value: STRICT = 4; + */ + STRICT = 4 } - -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"; - } +/** + * @generated from protobuf enum google.protobuf.FeatureSet.FieldPresence + */ +export enum FeatureSet_FieldPresence { + /** + * @generated from protobuf enum value: FIELD_PRESENCE_UNKNOWN = 0; + */ + FIELD_PRESENCE_UNKNOWN = 0, + /** + * @generated from protobuf enum value: EXPLICIT = 1; + */ + EXPLICIT = 1, + /** + * @generated from protobuf enum value: IMPLICIT = 2; + */ + IMPLICIT = 2, + /** + * @generated from protobuf enum value: LEGACY_REQUIRED = 3; + */ + LEGACY_REQUIRED = 3 } - +/** + * @generated from protobuf enum google.protobuf.FeatureSet.EnumType + */ 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"; - } + /** + * @generated from protobuf enum value: ENUM_TYPE_UNKNOWN = 0; + */ + ENUM_TYPE_UNKNOWN = 0, + /** + * @generated from protobuf enum value: OPEN = 1; + */ + OPEN = 1, + /** + * @generated from protobuf enum value: CLOSED = 2; + */ + CLOSED = 2 } - +/** + * @generated from protobuf enum google.protobuf.FeatureSet.RepeatedFieldEncoding + */ 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"; - } + /** + * @generated from protobuf enum value: REPEATED_FIELD_ENCODING_UNKNOWN = 0; + */ + REPEATED_FIELD_ENCODING_UNKNOWN = 0, + /** + * @generated from protobuf enum value: PACKED = 1; + */ + PACKED = 1, + /** + * @generated from protobuf enum value: EXPANDED = 2; + */ + EXPANDED = 2 } - +/** + * @generated from protobuf enum google.protobuf.FeatureSet.Utf8Validation + */ 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"; - } + /** + * @generated from protobuf enum value: UTF8_VALIDATION_UNKNOWN = 0; + */ + UTF8_VALIDATION_UNKNOWN = 0, + /** + * @generated from protobuf enum value: VERIFY = 2; + */ + VERIFY = 2, + /** + * @generated from protobuf enum value: NONE = 3; + */ + NONE = 3 } - +/** + * @generated from protobuf enum google.protobuf.FeatureSet.MessageEncoding + */ 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; - } + /** + * @generated from protobuf enum value: MESSAGE_ENCODING_UNKNOWN = 0; + */ + MESSAGE_ENCODING_UNKNOWN = 0, + /** + * @generated from protobuf enum value: LENGTH_PREFIXED = 1; + */ + LENGTH_PREFIXED = 1, + /** + * @generated from protobuf enum value: DELIMITED = 2; + */ + DELIMITED = 2 } - -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"; - } -} - +/** + * @generated from protobuf enum google.protobuf.FeatureSet.JsonFormat + */ 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"; - } + /** + * @generated from protobuf enum value: JSON_FORMAT_UNKNOWN = 0; + */ + JSON_FORMAT_UNKNOWN = 0, + /** + * @generated from protobuf enum value: ALLOW = 1; + */ + ALLOW = 1, + /** + * @generated from protobuf enum value: LEGACY_BEST_EFFORT = 2; + */ + LEGACY_BEST_EFFORT = 2 } - +/** + * @generated from protobuf enum google.protobuf.FeatureSet.EnforceNamingStyle + */ export enum FeatureSet_EnforceNamingStyle { - ENFORCE_NAMING_STYLE_UNKNOWN = 0, - STYLE2024 = 1, - STYLE_LEGACY = 2, - UNRECOGNIZED = -1, -} - -export function featureSet_EnforceNamingStyleFromJSON(object: any): FeatureSet_EnforceNamingStyle { - switch (object) { - case 0: - case "ENFORCE_NAMING_STYLE_UNKNOWN": - return FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN; - case 1: - case "STYLE2024": - return FeatureSet_EnforceNamingStyle.STYLE2024; - case 2: - case "STYLE_LEGACY": - return FeatureSet_EnforceNamingStyle.STYLE_LEGACY; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_EnforceNamingStyle.UNRECOGNIZED; - } -} - -export function featureSet_EnforceNamingStyleToJSON(object: FeatureSet_EnforceNamingStyle): string { - switch (object) { - case FeatureSet_EnforceNamingStyle.ENFORCE_NAMING_STYLE_UNKNOWN: - return "ENFORCE_NAMING_STYLE_UNKNOWN"; - case FeatureSet_EnforceNamingStyle.STYLE2024: - return "STYLE2024"; - case FeatureSet_EnforceNamingStyle.STYLE_LEGACY: - return "STYLE_LEGACY"; - case FeatureSet_EnforceNamingStyle.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface FeatureSet_VisibilityFeature { -} - -export enum FeatureSet_VisibilityFeature_DefaultSymbolVisibility { - DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0, - /** EXPORT_ALL - Default pre-EDITION_2024, all UNSET visibility are export. */ - EXPORT_ALL = 1, - /** EXPORT_TOP_LEVEL - All top-level symbols default to export, nested default to local. */ - EXPORT_TOP_LEVEL = 2, - /** LOCAL_ALL - All symbols default to local. */ - LOCAL_ALL = 3, - /** - * STRICT - All symbols local by default. Nested types cannot be exported. - * With special case caveat for message { enum {} reserved 1 to max; } - * This is the recommended setting for new protos. - */ - STRICT = 4, - UNRECOGNIZED = -1, -} - -export function featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON( - object: any, -): FeatureSet_VisibilityFeature_DefaultSymbolVisibility { - switch (object) { - case 0: - case "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN; - case 1: - case "EXPORT_ALL": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL; - case 2: - case "EXPORT_TOP_LEVEL": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL; - case 3: - case "LOCAL_ALL": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL; - case 4: - case "STRICT": - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT; - case -1: - case "UNRECOGNIZED": - default: - return FeatureSet_VisibilityFeature_DefaultSymbolVisibility.UNRECOGNIZED; - } + /** + * @generated from protobuf enum value: ENFORCE_NAMING_STYLE_UNKNOWN = 0; + */ + ENFORCE_NAMING_STYLE_UNKNOWN = 0, + /** + * @generated from protobuf enum value: STYLE2024 = 1; + */ + STYLE2024 = 1, + /** + * @generated from protobuf enum value: STYLE_LEGACY = 2; + */ + STYLE_LEGACY = 2 } - -export function featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON( - object: FeatureSet_VisibilityFeature_DefaultSymbolVisibility, -): string { - switch (object) { - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN: - return "DEFAULT_SYMBOL_VISIBILITY_UNKNOWN"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_ALL: - return "EXPORT_ALL"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.EXPORT_TOP_LEVEL: - return "EXPORT_TOP_LEVEL"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.LOCAL_ALL: - return "LOCAL_ALL"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.STRICT: - return "STRICT"; - case FeatureSet_VisibilityFeature_DefaultSymbolVisibility.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. + * + * @generated from protobuf message google.protobuf.FeatureSetDefaults */ 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; + /** + * @generated from protobuf field: repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; + */ + defaults: FeatureSetDefaults_FeatureSetEditionDefault[]; + /** + * The minimum supported edition (inclusive) when this was constructed. + * Editions before this will not have defaults. + * + * @generated from protobuf field: optional google.protobuf.Edition minimum_edition = 4; + */ + minimumEdition?: Edition; + /** + * The maximum known edition (inclusive) when this was constructed. Editions + * after this will not have reliable defaults. + * + * @generated from protobuf field: optional google.protobuf.Edition maximum_edition = 5; + */ + maximumEdition?: Edition; } - /** * 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. + * + * @generated from protobuf message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault */ 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; -} + /** + * @generated from protobuf field: optional google.protobuf.Edition edition = 3; + */ + edition?: Edition; + /** + * Defaults of features that can be overridden in this edition. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet overridable_features = 4; + */ + overridableFeatures?: FeatureSet; + /** + * Defaults of features that can't be overridden in this edition. + * + * @generated from protobuf field: optional google.protobuf.FeatureSet fixed_features = 5; + */ + fixedFeatures?: FeatureSet; +} +// =================================================================== +// Optional source code info /** * Encapsulates information about the original source file from which a * FileDescriptorProto was generated. + * + * @generated from protobuf message google.protobuf.SourceCodeInfo */ 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[]; + /** + * 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. + * + * @generated from protobuf field: repeated google.protobuf.SourceCodeInfo.Location location = 1; + */ + location: SourceCodeInfo_Location[]; } - +/** + * @generated from protobuf message google.protobuf.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[]; + /** + * 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). + * + * @generated from protobuf field: repeated int32 path = 1 [packed = true]; + */ + 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. + * + * @generated from protobuf field: repeated int32 span = 2 [packed = true]; + */ + 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. + * + * @generated from protobuf field: optional string leading_comments = 3; + */ + leadingComments?: string; + /** + * @generated from protobuf field: optional string trailing_comments = 4; + */ + trailingComments?: string; + /** + * @generated from protobuf field: repeated string leading_detached_comments = 6; + */ + 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. + * + * @generated from protobuf message google.protobuf.GeneratedCodeInfo */ export interface GeneratedCodeInfo { - /** - * An Annotation connects some span of text in generated code to an element - * of its generating .proto file. - */ - annotation: GeneratedCodeInfo_Annotation[]; + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + * + * @generated from protobuf field: repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; + */ + annotation: GeneratedCodeInfo_Annotation[]; } - +/** + * @generated from protobuf message google.protobuf.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; + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + * + * @generated from protobuf field: repeated int32 path = 1 [packed = true]; + */ + path: number[]; + /** + * Identifies the filesystem path to the original source .proto. + * + * @generated from protobuf field: optional string source_file = 2; + */ + sourceFile?: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + * + * @generated from protobuf field: optional int32 begin = 3; + */ + begin?: number; + /** + * 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). + * + * @generated from protobuf field: optional int32 end = 4; + */ + end?: number; + /** + * @generated from protobuf field: optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; + */ + semantic?: GeneratedCodeInfo_Annotation_Semantic; } - /** * Represents the identified object's effect on the element in the original * .proto file. + * + * @generated from protobuf enum google.protobuf.GeneratedCodeInfo.Annotation.Semantic */ 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; - } + /** + * There is no effect or the effect is indescribable. + * + * @generated from protobuf enum value: NONE = 0; + */ + NONE = 0, + /** + * The element is set or otherwise mutated. + * + * @generated from protobuf enum value: SET = 1; + */ + SET = 1, + /** + * An alias to the element is returned. + * + * @generated from protobuf enum value: ALIAS = 2; + */ + ALIAS = 2 } - -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: [] }; +/** + * The full set of known editions. + * + * @generated from protobuf enum google.protobuf.Edition + */ +export enum Edition { + /** + * A placeholder for an unknown edition value. + * + * @generated from protobuf enum value: EDITION_UNKNOWN = 0; + */ + EDITION_UNKNOWN = 0, + /** + * A placeholder edition for specifying default behaviors *before* a feature + * was first introduced. This is effectively an "infinite past". + * + * @generated from protobuf enum value: EDITION_LEGACY = 900; + */ + EDITION_LEGACY = 900, + /** + * 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. + * + * @generated from protobuf enum value: EDITION_PROTO2 = 998; + */ + EDITION_PROTO2 = 998, + /** + * @generated from protobuf enum value: EDITION_PROTO3 = 999; + */ + EDITION_PROTO3 = 999, + /** + * 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. + * + * @generated from protobuf enum value: EDITION_2023 = 1000; + */ + EDITION_2023 = 1000, + /** + * @generated from protobuf enum value: EDITION_2024 = 1001; + */ + EDITION_2024 = 1001, + /** + * Placeholder editions for testing feature resolution. These should not be + * used or relied on outside of tests. + * + * @generated from protobuf enum value: EDITION_1_TEST_ONLY = 1; + */ + EDITION_1_TEST_ONLY = 1, + /** + * @generated from protobuf enum value: EDITION_2_TEST_ONLY = 2; + */ + EDITION_2_TEST_ONLY = 2, + /** + * @generated from protobuf enum value: EDITION_99997_TEST_ONLY = 99997; + */ + EDITION_99997_TEST_ONLY = 99997, + /** + * @generated from protobuf enum value: EDITION_99998_TEST_ONLY = 99998; + */ + EDITION_99998_TEST_ONLY = 99998, + /** + * @generated from protobuf enum value: EDITION_99999_TEST_ONLY = 99999; + */ + EDITION_99999_TEST_ONLY = 99999, + /** + * 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. + * + * @generated from protobuf enum value: EDITION_MAX = 2147483647; + */ + EDITION_MAX = 2147483647 } - -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; +/** + * Describes the 'visibility' of a symbol with respect to the proto import + * system. Symbols can only be imported when the visibility rules do not prevent + * it (ex: local symbols cannot be imported). Visibility modifiers can only set + * on `message` and `enum` as they are the only types available to be referenced + * from other files. + * + * @generated from protobuf enum google.protobuf.SymbolVisibility + */ +export enum SymbolVisibility { + /** + * @generated from protobuf enum value: VISIBILITY_UNSET = 0; + */ + VISIBILITY_UNSET = 0, + /** + * @generated from protobuf enum value: VISIBILITY_LOCAL = 1; + */ + VISIBILITY_LOCAL = 1, + /** + * @generated from protobuf enum value: VISIBILITY_EXPORT = 2; + */ + VISIBILITY_EXPORT = 2 +} +// @generated message type with reflection information, may provide speed optimized methods +class FileDescriptorSet$Type extends MessageType { + constructor() { + super("google.protobuf.FileDescriptorSet", [ + { no: 1, name: "file", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FileDescriptorProto } + ]); + } + create(value?: PartialMessage): FileDescriptorSet { + const message = { file: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDescriptorSet): FileDescriptorSet { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.FileDescriptorProto file */ 1: + message.file.push(FileDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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: [], - optionDependency: [], - 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); + return message; } - if (message.package !== undefined && message.package !== "") { - writer.uint32(18).string(message.package); + internalBinaryWrite(message: FileDescriptorSet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.protobuf.FileDescriptorProto file = 1; */ + for (let i = 0; i < message.file.length; i++) + FileDescriptorProto.internalBinaryWrite(message.file[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.dependency) { - writer.uint32(26).string(v!); - } - for (const v of message.publicDependency) { - writer.uint32(80).int32(v!); +} +/** + * @generated MessageType for protobuf message google.protobuf.FileDescriptorSet + */ +export const FileDescriptorSet = new FileDescriptorSet$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FileDescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.FileDescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "package", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "dependency", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "public_dependency", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 11, name: "weak_dependency", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 15, name: "option_dependency", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "message_type", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DescriptorProto }, + { no: 5, name: "enum_type", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => EnumDescriptorProto }, + { no: 6, name: "service", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ServiceDescriptorProto }, + { no: 7, name: "extension", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FieldDescriptorProto }, + { no: 8, name: "options", kind: "message", T: () => FileOptions }, + { no: 9, name: "source_code_info", kind: "message", T: () => SourceCodeInfo }, + { no: 12, name: "syntax", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 14, name: "edition", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] } + ]); + } + create(value?: PartialMessage): FileDescriptorProto { + const message = { dependency: [], publicDependency: [], weakDependency: [], optionDependency: [], messageType: [], enumType: [], service: [], extension: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileDescriptorProto): FileDescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional string package */ 2: + message.package = reader.string(); + break; + case /* repeated string dependency */ 3: + message.dependency.push(reader.string()); + break; + case /* repeated int32 public_dependency */ 10: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.publicDependency.push(reader.int32()); + else + message.publicDependency.push(reader.int32()); + break; + case /* repeated int32 weak_dependency */ 11: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.weakDependency.push(reader.int32()); + else + message.weakDependency.push(reader.int32()); + break; + case /* repeated string option_dependency */ 15: + message.optionDependency.push(reader.string()); + break; + case /* repeated google.protobuf.DescriptorProto message_type */ 4: + message.messageType.push(DescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.EnumDescriptorProto enum_type */ 5: + message.enumType.push(EnumDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.ServiceDescriptorProto service */ 6: + message.service.push(ServiceDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.FieldDescriptorProto extension */ 7: + message.extension.push(FieldDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.FileOptions options */ 8: + message.options = FileOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + case /* optional google.protobuf.SourceCodeInfo source_code_info */ 9: + message.sourceCodeInfo = SourceCodeInfo.internalBinaryRead(reader, reader.uint32(), options, message.sourceCodeInfo); + break; + case /* optional string syntax */ 12: + message.syntax = reader.string(); + break; + case /* optional google.protobuf.Edition edition */ 14: + message.edition = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FileDescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional string package = 2; */ + if (message.package !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.package); + /* repeated string dependency = 3; */ + for (let i = 0; i < message.dependency.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.dependency[i]); + /* repeated int32 public_dependency = 10; */ + for (let i = 0; i < message.publicDependency.length; i++) + writer.tag(10, WireType.Varint).int32(message.publicDependency[i]); + /* repeated int32 weak_dependency = 11; */ + for (let i = 0; i < message.weakDependency.length; i++) + writer.tag(11, WireType.Varint).int32(message.weakDependency[i]); + /* repeated string option_dependency = 15; */ + for (let i = 0; i < message.optionDependency.length; i++) + writer.tag(15, WireType.LengthDelimited).string(message.optionDependency[i]); + /* repeated google.protobuf.DescriptorProto message_type = 4; */ + for (let i = 0; i < message.messageType.length; i++) + DescriptorProto.internalBinaryWrite(message.messageType[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.EnumDescriptorProto enum_type = 5; */ + for (let i = 0; i < message.enumType.length; i++) + EnumDescriptorProto.internalBinaryWrite(message.enumType[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.ServiceDescriptorProto service = 6; */ + for (let i = 0; i < message.service.length; i++) + ServiceDescriptorProto.internalBinaryWrite(message.service[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.FieldDescriptorProto extension = 7; */ + for (let i = 0; i < message.extension.length; i++) + FieldDescriptorProto.internalBinaryWrite(message.extension[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.FileOptions options = 8; */ + if (message.options) + FileOptions.internalBinaryWrite(message.options, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.SourceCodeInfo source_code_info = 9; */ + if (message.sourceCodeInfo) + SourceCodeInfo.internalBinaryWrite(message.sourceCodeInfo, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + /* optional string syntax = 12; */ + if (message.syntax !== undefined) + writer.tag(12, WireType.LengthDelimited).string(message.syntax); + /* optional google.protobuf.Edition edition = 14; */ + if (message.edition !== undefined) + writer.tag(14, WireType.Varint).int32(message.edition); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.weakDependency) { - writer.uint32(88).int32(v!); +} +/** + * @generated MessageType for protobuf message google.protobuf.FileDescriptorProto + */ +export const FileDescriptorProto = new FileDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.DescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "field", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FieldDescriptorProto }, + { no: 6, name: "extension", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FieldDescriptorProto }, + { no: 3, name: "nested_type", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DescriptorProto }, + { no: 4, name: "enum_type", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => EnumDescriptorProto }, + { no: 5, name: "extension_range", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DescriptorProto_ExtensionRange }, + { no: 8, name: "oneof_decl", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => OneofDescriptorProto }, + { no: 7, name: "options", kind: "message", T: () => MessageOptions }, + { no: 9, name: "reserved_range", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DescriptorProto_ReservedRange }, + { no: 10, name: "reserved_name", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "visibility", kind: "enum", opt: true, T: () => ["google.protobuf.SymbolVisibility", SymbolVisibility] } + ]); + } + create(value?: PartialMessage): DescriptorProto { + const message = { field: [], extension: [], nestedType: [], enumType: [], extensionRange: [], oneofDecl: [], reservedRange: [], reservedName: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DescriptorProto): DescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.protobuf.FieldDescriptorProto field */ 2: + message.field.push(FieldDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.FieldDescriptorProto extension */ 6: + message.extension.push(FieldDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.DescriptorProto nested_type */ 3: + message.nestedType.push(DescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.EnumDescriptorProto enum_type */ 4: + message.enumType.push(EnumDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.DescriptorProto.ExtensionRange extension_range */ 5: + message.extensionRange.push(DescriptorProto_ExtensionRange.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.OneofDescriptorProto oneof_decl */ 8: + message.oneofDecl.push(OneofDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.MessageOptions options */ 7: + message.options = MessageOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + case /* repeated google.protobuf.DescriptorProto.ReservedRange reserved_range */ 9: + message.reservedRange.push(DescriptorProto_ReservedRange.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated string reserved_name */ 10: + message.reservedName.push(reader.string()); + break; + case /* optional google.protobuf.SymbolVisibility visibility */ 11: + message.visibility = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.FieldDescriptorProto field = 2; */ + for (let i = 0; i < message.field.length; i++) + FieldDescriptorProto.internalBinaryWrite(message.field[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.FieldDescriptorProto extension = 6; */ + for (let i = 0; i < message.extension.length; i++) + FieldDescriptorProto.internalBinaryWrite(message.extension[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.DescriptorProto nested_type = 3; */ + for (let i = 0; i < message.nestedType.length; i++) + DescriptorProto.internalBinaryWrite(message.nestedType[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.EnumDescriptorProto enum_type = 4; */ + for (let i = 0; i < message.enumType.length; i++) + EnumDescriptorProto.internalBinaryWrite(message.enumType[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.DescriptorProto.ExtensionRange extension_range = 5; */ + for (let i = 0; i < message.extensionRange.length; i++) + DescriptorProto_ExtensionRange.internalBinaryWrite(message.extensionRange[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.OneofDescriptorProto oneof_decl = 8; */ + for (let i = 0; i < message.oneofDecl.length; i++) + OneofDescriptorProto.internalBinaryWrite(message.oneofDecl[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.MessageOptions options = 7; */ + if (message.options) + MessageOptions.internalBinaryWrite(message.options, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.DescriptorProto.ReservedRange reserved_range = 9; */ + for (let i = 0; i < message.reservedRange.length; i++) + DescriptorProto_ReservedRange.internalBinaryWrite(message.reservedRange[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + /* repeated string reserved_name = 10; */ + for (let i = 0; i < message.reservedName.length; i++) + writer.tag(10, WireType.LengthDelimited).string(message.reservedName[i]); + /* optional google.protobuf.SymbolVisibility visibility = 11; */ + if (message.visibility !== undefined) + writer.tag(11, WireType.Varint).int32(message.visibility); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.optionDependency) { - writer.uint32(122).string(v!); +} +/** + * @generated MessageType for protobuf message google.protobuf.DescriptorProto + */ +export const DescriptorProto = new DescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DescriptorProto_ExtensionRange$Type extends MessageType { + constructor() { + super("google.protobuf.DescriptorProto.ExtensionRange", [ + { no: 1, name: "start", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "end", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "options", kind: "message", T: () => ExtensionRangeOptions } + ]); + } + create(value?: PartialMessage): DescriptorProto_ExtensionRange { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DescriptorProto_ExtensionRange): DescriptorProto_ExtensionRange { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 start */ 1: + message.start = reader.int32(); + break; + case /* optional int32 end */ 2: + message.end = reader.int32(); + break; + case /* optional google.protobuf.ExtensionRangeOptions options */ 3: + message.options = ExtensionRangeOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - for (const v of message.messageType) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).join(); + internalBinaryWrite(message: DescriptorProto_ExtensionRange, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int32 start = 1; */ + if (message.start !== undefined) + writer.tag(1, WireType.Varint).int32(message.start); + /* optional int32 end = 2; */ + if (message.end !== undefined) + writer.tag(2, WireType.Varint).int32(message.end); + /* optional google.protobuf.ExtensionRangeOptions options = 3; */ + if (message.options) + ExtensionRangeOptions.internalBinaryWrite(message.options, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.DescriptorProto.ExtensionRange + */ +export const DescriptorProto_ExtensionRange = new DescriptorProto_ExtensionRange$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DescriptorProto_ReservedRange$Type extends MessageType { + constructor() { + super("google.protobuf.DescriptorProto.ReservedRange", [ + { no: 1, name: "start", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "end", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): DescriptorProto_ReservedRange { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DescriptorProto_ReservedRange): DescriptorProto_ReservedRange { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 start */ 1: + message.start = reader.int32(); + break; + case /* optional int32 end */ 2: + message.end = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - for (const v of message.service) { - ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); + internalBinaryWrite(message: DescriptorProto_ReservedRange, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int32 start = 1; */ + if (message.start !== undefined) + writer.tag(1, WireType.Varint).int32(message.start); + /* optional int32 end = 2; */ + if (message.end !== undefined) + writer.tag(2, WireType.Varint).int32(message.end); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.DescriptorProto.ReservedRange + */ +export const DescriptorProto_ReservedRange = new DescriptorProto_ReservedRange$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExtensionRangeOptions$Type extends MessageType { + constructor() { + super("google.protobuf.ExtensionRangeOptions", [ + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption }, + { no: 2, name: "declaration", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ExtensionRangeOptions_Declaration }, + { no: 50, name: "features", kind: "message", T: () => FeatureSet }, + { no: 3, name: "verification", kind: "enum", opt: true, T: () => ["google.protobuf.ExtensionRangeOptions.VerificationState", ExtensionRangeOptions_VerificationState] } + ]); + } + create(value?: PartialMessage): ExtensionRangeOptions { + const message = { uninterpretedOption: [], declaration: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExtensionRangeOptions): ExtensionRangeOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.ExtensionRangeOptions.Declaration declaration */ 2: + message.declaration.push(ExtensionRangeOptions_Declaration.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.FeatureSet features */ 50: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* optional google.protobuf.ExtensionRangeOptions.VerificationState verification */ 3: + message.verification = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ExtensionRangeOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.ExtensionRangeOptions.Declaration declaration = 2; */ + for (let i = 0; i < message.declaration.length; i++) + ExtensionRangeOptions_Declaration.internalBinaryWrite(message.declaration[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.FeatureSet features = 50; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(50, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.ExtensionRangeOptions.VerificationState verification = 3; */ + if (message.verification !== undefined) + writer.tag(3, WireType.Varint).int32(message.verification); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.options !== undefined) { - FileOptions.encode(message.options, writer.uint32(66).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.ExtensionRangeOptions + */ +export const ExtensionRangeOptions = new ExtensionRangeOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExtensionRangeOptions_Declaration$Type extends MessageType { + constructor() { + super("google.protobuf.ExtensionRangeOptions.Declaration", [ + { no: 1, name: "number", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "full_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "type", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "reserved", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "repeated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): ExtensionRangeOptions_Declaration { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExtensionRangeOptions_Declaration): ExtensionRangeOptions_Declaration { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 number */ 1: + message.number = reader.int32(); + break; + case /* optional string full_name */ 2: + message.fullName = reader.string(); + break; + case /* optional string type */ 3: + message.type = reader.string(); + break; + case /* optional bool reserved */ 5: + message.reserved = reader.bool(); + break; + case /* optional bool repeated */ 6: + message.repeated = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ExtensionRangeOptions_Declaration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int32 number = 1; */ + if (message.number !== undefined) + writer.tag(1, WireType.Varint).int32(message.number); + /* optional string full_name = 2; */ + if (message.fullName !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.fullName); + /* optional string type = 3; */ + if (message.type !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.type); + /* optional bool reserved = 5; */ + if (message.reserved !== undefined) + writer.tag(5, WireType.Varint).bool(message.reserved); + /* optional bool repeated = 6; */ + if (message.repeated !== undefined) + writer.tag(6, WireType.Varint).bool(message.repeated); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.sourceCodeInfo !== undefined) { - SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.ExtensionRangeOptions.Declaration + */ +export const ExtensionRangeOptions_Declaration = new ExtensionRangeOptions_Declaration$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FieldDescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.FieldDescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "number", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "label", kind: "enum", opt: true, T: () => ["google.protobuf.FieldDescriptorProto.Label", FieldDescriptorProto_Label, "LABEL_"] }, + { no: 5, name: "type", kind: "enum", opt: true, T: () => ["google.protobuf.FieldDescriptorProto.Type", FieldDescriptorProto_Type, "TYPE_"] }, + { no: 6, name: "type_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "extendee", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "default_value", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "oneof_index", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 10, name: "json_name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "options", kind: "message", T: () => FieldOptions }, + { no: 17, name: "proto3_optional", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): FieldDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FieldDescriptorProto): FieldDescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional int32 number */ 3: + message.number = reader.int32(); + break; + case /* optional google.protobuf.FieldDescriptorProto.Label label */ 4: + message.label = reader.int32(); + break; + case /* optional google.protobuf.FieldDescriptorProto.Type type */ 5: + message.type = reader.int32(); + break; + case /* optional string type_name */ 6: + message.typeName = reader.string(); + break; + case /* optional string extendee */ 2: + message.extendee = reader.string(); + break; + case /* optional string default_value */ 7: + message.defaultValue = reader.string(); + break; + case /* optional int32 oneof_index */ 9: + message.oneofIndex = reader.int32(); + break; + case /* optional string json_name */ 10: + message.jsonName = reader.string(); + break; + case /* optional google.protobuf.FieldOptions options */ 8: + message.options = FieldOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + case /* optional bool proto3_optional */ 17: + message.proto3Optional = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FieldDescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional int32 number = 3; */ + if (message.number !== undefined) + writer.tag(3, WireType.Varint).int32(message.number); + /* optional google.protobuf.FieldDescriptorProto.Label label = 4; */ + if (message.label !== undefined) + writer.tag(4, WireType.Varint).int32(message.label); + /* optional google.protobuf.FieldDescriptorProto.Type type = 5; */ + if (message.type !== undefined) + writer.tag(5, WireType.Varint).int32(message.type); + /* optional string type_name = 6; */ + if (message.typeName !== undefined) + writer.tag(6, WireType.LengthDelimited).string(message.typeName); + /* optional string extendee = 2; */ + if (message.extendee !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.extendee); + /* optional string default_value = 7; */ + if (message.defaultValue !== undefined) + writer.tag(7, WireType.LengthDelimited).string(message.defaultValue); + /* optional int32 oneof_index = 9; */ + if (message.oneofIndex !== undefined) + writer.tag(9, WireType.Varint).int32(message.oneofIndex); + /* optional string json_name = 10; */ + if (message.jsonName !== undefined) + writer.tag(10, WireType.LengthDelimited).string(message.jsonName); + /* optional google.protobuf.FieldOptions options = 8; */ + if (message.options) + FieldOptions.internalBinaryWrite(message.options, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* optional bool proto3_optional = 17; */ + if (message.proto3Optional !== undefined) + writer.tag(17, WireType.Varint).bool(message.proto3Optional); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.syntax !== undefined && message.syntax !== "") { - writer.uint32(98).string(message.syntax); +} +/** + * @generated MessageType for protobuf message google.protobuf.FieldDescriptorProto + */ +export const FieldDescriptorProto = new FieldDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OneofDescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.OneofDescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "options", kind: "message", T: () => OneofOptions } + ]); + } + create(value?: PartialMessage): OneofDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OneofDescriptorProto): OneofDescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional google.protobuf.OneofOptions options */ 2: + message.options = OneofOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.edition !== undefined && message.edition !== 0) { - writer.uint32(112).int32(message.edition); + internalBinaryWrite(message: OneofDescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional google.protobuf.OneofOptions options = 2; */ + if (message.options) + OneofOptions.internalBinaryWrite(message.options, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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()); +} +/** + * @generated MessageType for protobuf message google.protobuf.OneofDescriptorProto + */ +export const OneofDescriptorProto = new OneofDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumDescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.EnumDescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "value", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => EnumValueDescriptorProto }, + { no: 3, name: "options", kind: "message", T: () => EnumOptions }, + { no: 4, name: "reserved_range", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => EnumDescriptorProto_EnumReservedRange }, + { no: 5, name: "reserved_name", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "visibility", kind: "enum", opt: true, T: () => ["google.protobuf.SymbolVisibility", SymbolVisibility] } + ]); + } + create(value?: PartialMessage): EnumDescriptorProto { + const message = { value: [], reservedRange: [], reservedName: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumDescriptorProto): EnumDescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.protobuf.EnumValueDescriptorProto value */ 2: + message.value.push(EnumValueDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.EnumOptions options */ 3: + message.options = EnumOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + case /* repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range */ 4: + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated string reserved_name */ 5: + message.reservedName.push(reader.string()); + break; + case /* optional google.protobuf.SymbolVisibility visibility */ 6: + message.visibility = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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()); + return message; + } + internalBinaryWrite(message: EnumDescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.EnumValueDescriptorProto value = 2; */ + for (let i = 0; i < message.value.length; i++) + EnumValueDescriptorProto.internalBinaryWrite(message.value[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.EnumOptions options = 3; */ + if (message.options) + EnumOptions.internalBinaryWrite(message.options, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4; */ + for (let i = 0; i < message.reservedRange.length; i++) + EnumDescriptorProto_EnumReservedRange.internalBinaryWrite(message.reservedRange[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated string reserved_name = 5; */ + for (let i = 0; i < message.reservedName.length; i++) + writer.tag(5, WireType.LengthDelimited).string(message.reservedName[i]); + /* optional google.protobuf.SymbolVisibility visibility = 6; */ + if (message.visibility !== undefined) + writer.tag(6, WireType.Varint).int32(message.visibility); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumDescriptorProto + */ +export const EnumDescriptorProto = new EnumDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumDescriptorProto_EnumReservedRange$Type extends MessageType { + constructor() { + super("google.protobuf.EnumDescriptorProto.EnumReservedRange", [ + { no: 1, name: "start", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "end", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): EnumDescriptorProto_EnumReservedRange { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumDescriptorProto_EnumReservedRange): EnumDescriptorProto_EnumReservedRange { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 start */ 1: + message.start = reader.int32(); + break; + case /* optional int32 end */ 2: + message.end = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - continue; - } - - break; - } - case 15: { - if (tag !== 122) { - break; - } - - message.optionDependency.push(reader.string()); - continue; - } - 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)) - : [], - optionDependency: globalThis.Array.isArray(object?.optionDependency) - ? object.optionDependency.map((e: any) => globalThis.String(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; + return message; } - if (message.dependency?.length) { - obj.dependency = message.dependency; + internalBinaryWrite(message: EnumDescriptorProto_EnumReservedRange, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int32 start = 1; */ + if (message.start !== undefined) + writer.tag(1, WireType.Varint).int32(message.start); + /* optional int32 end = 2; */ + if (message.end !== undefined) + writer.tag(2, WireType.Varint).int32(message.end); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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)); +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export const EnumDescriptorProto_EnumReservedRange = new EnumDescriptorProto_EnumReservedRange$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumValueDescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.EnumValueDescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "number", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "options", kind: "message", T: () => EnumValueOptions } + ]); + } + create(value?: PartialMessage): EnumValueDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumValueDescriptorProto): EnumValueDescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional int32 number */ 2: + message.number = reader.int32(); + break; + case /* optional google.protobuf.EnumValueOptions options */ 3: + message.options = EnumValueOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.optionDependency?.length) { - obj.optionDependency = message.optionDependency; + internalBinaryWrite(message: EnumValueDescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional int32 number = 2; */ + if (message.number !== undefined) + writer.tag(2, WireType.Varint).int32(message.number); + /* optional google.protobuf.EnumValueOptions options = 3; */ + if (message.options) + EnumValueOptions.internalBinaryWrite(message.options, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.messageType?.length) { - obj.messageType = message.messageType.map((e) => DescriptorProto.toJSON(e)); +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumValueDescriptorProto + */ +export const EnumValueDescriptorProto = new EnumValueDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ServiceDescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.ServiceDescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "method", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => MethodDescriptorProto }, + { no: 3, name: "options", kind: "message", T: () => ServiceOptions } + ]); + } + create(value?: PartialMessage): ServiceDescriptorProto { + const message = { method: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ServiceDescriptorProto): ServiceDescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.protobuf.MethodDescriptorProto method */ 2: + message.method.push(MethodDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.ServiceOptions options */ 3: + message.options = ServiceOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.enumType?.length) { - obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + internalBinaryWrite(message: ServiceDescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.MethodDescriptorProto method = 2; */ + for (let i = 0; i < message.method.length; i++) + MethodDescriptorProto.internalBinaryWrite(message.method[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.ServiceOptions options = 3; */ + if (message.options) + ServiceOptions.internalBinaryWrite(message.options, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.service?.length) { - obj.service = message.service.map((e) => ServiceDescriptorProto.toJSON(e)); +} +/** + * @generated MessageType for protobuf message google.protobuf.ServiceDescriptorProto + */ +export const ServiceDescriptorProto = new ServiceDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MethodDescriptorProto$Type extends MessageType { + constructor() { + super("google.protobuf.MethodDescriptorProto", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "input_type", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "output_type", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "options", kind: "message", T: () => MethodOptions }, + { no: 5, name: "client_streaming", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "server_streaming", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): MethodDescriptorProto { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MethodDescriptorProto): MethodDescriptorProto { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string name */ 1: + message.name = reader.string(); + break; + case /* optional string input_type */ 2: + message.inputType = reader.string(); + break; + case /* optional string output_type */ 3: + message.outputType = reader.string(); + break; + case /* optional google.protobuf.MethodOptions options */ 4: + message.options = MethodOptions.internalBinaryRead(reader, reader.uint32(), options, message.options); + break; + case /* optional bool client_streaming */ 5: + message.clientStreaming = reader.bool(); + break; + case /* optional bool server_streaming */ 6: + message.serverStreaming = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MethodDescriptorProto, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional string input_type = 2; */ + if (message.inputType !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.inputType); + /* optional string output_type = 3; */ + if (message.outputType !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.outputType); + /* optional google.protobuf.MethodOptions options = 4; */ + if (message.options) + MethodOptions.internalBinaryWrite(message.options, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* optional bool client_streaming = 5; */ + if (message.clientStreaming !== undefined) + writer.tag(5, WireType.Varint).bool(message.clientStreaming); + /* optional bool server_streaming = 6; */ + if (message.serverStreaming !== undefined) + writer.tag(6, WireType.Varint).bool(message.serverStreaming); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.extension?.length) { - obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); +} +/** + * @generated MessageType for protobuf message google.protobuf.MethodDescriptorProto + */ +export const MethodDescriptorProto = new MethodDescriptorProto$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FileOptions$Type extends MessageType { + constructor() { + super("google.protobuf.FileOptions", [ + { no: 1, name: "java_package", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "java_outer_classname", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "java_multiple_files", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 20, name: "java_generate_equals_and_hash", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 27, name: "java_string_check_utf8", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "optimize_for", kind: "enum", opt: true, T: () => ["google.protobuf.FileOptions.OptimizeMode", FileOptions_OptimizeMode] }, + { no: 11, name: "go_package", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 16, name: "cc_generic_services", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 17, name: "java_generic_services", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 18, name: "py_generic_services", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 23, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 31, name: "cc_enable_arenas", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 36, name: "objc_class_prefix", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 37, name: "csharp_namespace", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 39, name: "swift_prefix", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 40, name: "php_class_prefix", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 41, name: "php_namespace", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 44, name: "php_metadata_namespace", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 45, name: "ruby_package", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 50, name: "features", kind: "message", T: () => FeatureSet }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): FileOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FileOptions): FileOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string java_package */ 1: + message.javaPackage = reader.string(); + break; + case /* optional string java_outer_classname */ 8: + message.javaOuterClassname = reader.string(); + break; + case /* optional bool java_multiple_files */ 10: + message.javaMultipleFiles = reader.bool(); + break; + case /* optional bool java_generate_equals_and_hash = 20 [deprecated = true];*/ 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case /* optional bool java_string_check_utf8 */ 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case /* optional google.protobuf.FileOptions.OptimizeMode optimize_for */ 9: + message.optimizeFor = reader.int32(); + break; + case /* optional string go_package */ 11: + message.goPackage = reader.string(); + break; + case /* optional bool cc_generic_services */ 16: + message.ccGenericServices = reader.bool(); + break; + case /* optional bool java_generic_services */ 17: + message.javaGenericServices = reader.bool(); + break; + case /* optional bool py_generic_services */ 18: + message.pyGenericServices = reader.bool(); + break; + case /* optional bool deprecated */ 23: + message.deprecated = reader.bool(); + break; + case /* optional bool cc_enable_arenas */ 31: + message.ccEnableArenas = reader.bool(); + break; + case /* optional string objc_class_prefix */ 36: + message.objcClassPrefix = reader.string(); + break; + case /* optional string csharp_namespace */ 37: + message.csharpNamespace = reader.string(); + break; + case /* optional string swift_prefix */ 39: + message.swiftPrefix = reader.string(); + break; + case /* optional string php_class_prefix */ 40: + message.phpClassPrefix = reader.string(); + break; + case /* optional string php_namespace */ 41: + message.phpNamespace = reader.string(); + break; + case /* optional string php_metadata_namespace */ 44: + message.phpMetadataNamespace = reader.string(); + break; + case /* optional string ruby_package */ 45: + message.rubyPackage = reader.string(); + break; + case /* optional google.protobuf.FeatureSet features */ 50: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FileOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string java_package = 1; */ + if (message.javaPackage !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.javaPackage); + /* optional string java_outer_classname = 8; */ + if (message.javaOuterClassname !== undefined) + writer.tag(8, WireType.LengthDelimited).string(message.javaOuterClassname); + /* optional bool java_multiple_files = 10; */ + if (message.javaMultipleFiles !== undefined) + writer.tag(10, WireType.Varint).bool(message.javaMultipleFiles); + /* optional bool java_generate_equals_and_hash = 20 [deprecated = true]; */ + if (message.javaGenerateEqualsAndHash !== undefined) + writer.tag(20, WireType.Varint).bool(message.javaGenerateEqualsAndHash); + /* optional bool java_string_check_utf8 = 27; */ + if (message.javaStringCheckUtf8 !== undefined) + writer.tag(27, WireType.Varint).bool(message.javaStringCheckUtf8); + /* optional google.protobuf.FileOptions.OptimizeMode optimize_for = 9; */ + if (message.optimizeFor !== undefined) + writer.tag(9, WireType.Varint).int32(message.optimizeFor); + /* optional string go_package = 11; */ + if (message.goPackage !== undefined) + writer.tag(11, WireType.LengthDelimited).string(message.goPackage); + /* optional bool cc_generic_services = 16; */ + if (message.ccGenericServices !== undefined) + writer.tag(16, WireType.Varint).bool(message.ccGenericServices); + /* optional bool java_generic_services = 17; */ + if (message.javaGenericServices !== undefined) + writer.tag(17, WireType.Varint).bool(message.javaGenericServices); + /* optional bool py_generic_services = 18; */ + if (message.pyGenericServices !== undefined) + writer.tag(18, WireType.Varint).bool(message.pyGenericServices); + /* optional bool deprecated = 23; */ + if (message.deprecated !== undefined) + writer.tag(23, WireType.Varint).bool(message.deprecated); + /* optional bool cc_enable_arenas = 31; */ + if (message.ccEnableArenas !== undefined) + writer.tag(31, WireType.Varint).bool(message.ccEnableArenas); + /* optional string objc_class_prefix = 36; */ + if (message.objcClassPrefix !== undefined) + writer.tag(36, WireType.LengthDelimited).string(message.objcClassPrefix); + /* optional string csharp_namespace = 37; */ + if (message.csharpNamespace !== undefined) + writer.tag(37, WireType.LengthDelimited).string(message.csharpNamespace); + /* optional string swift_prefix = 39; */ + if (message.swiftPrefix !== undefined) + writer.tag(39, WireType.LengthDelimited).string(message.swiftPrefix); + /* optional string php_class_prefix = 40; */ + if (message.phpClassPrefix !== undefined) + writer.tag(40, WireType.LengthDelimited).string(message.phpClassPrefix); + /* optional string php_namespace = 41; */ + if (message.phpNamespace !== undefined) + writer.tag(41, WireType.LengthDelimited).string(message.phpNamespace); + /* optional string php_metadata_namespace = 44; */ + if (message.phpMetadataNamespace !== undefined) + writer.tag(44, WireType.LengthDelimited).string(message.phpMetadataNamespace); + /* optional string ruby_package = 45; */ + if (message.rubyPackage !== undefined) + writer.tag(45, WireType.LengthDelimited).string(message.rubyPackage); + /* optional google.protobuf.FeatureSet features = 50; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(50, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.options !== undefined) { - obj.options = FileOptions.toJSON(message.options); +} +/** + * @generated MessageType for protobuf message google.protobuf.FileOptions + */ +export const FileOptions = new FileOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MessageOptions$Type extends MessageType { + constructor() { + super("google.protobuf.MessageOptions", [ + { no: 1, name: "message_set_wire_format", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "no_standard_descriptor_accessor", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "map_entry", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 11, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 12, name: "features", kind: "message", T: () => FeatureSet }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): MessageOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MessageOptions): MessageOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool message_set_wire_format */ 1: + message.messageSetWireFormat = reader.bool(); + break; + case /* optional bool no_standard_descriptor_accessor */ 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case /* optional bool deprecated */ 3: + message.deprecated = reader.bool(); + break; + case /* optional bool map_entry */ 7: + message.mapEntry = reader.bool(); + break; + case /* optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];*/ 11: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case /* optional google.protobuf.FeatureSet features */ 12: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MessageOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool message_set_wire_format = 1; */ + if (message.messageSetWireFormat !== undefined) + writer.tag(1, WireType.Varint).bool(message.messageSetWireFormat); + /* optional bool no_standard_descriptor_accessor = 2; */ + if (message.noStandardDescriptorAccessor !== undefined) + writer.tag(2, WireType.Varint).bool(message.noStandardDescriptorAccessor); + /* optional bool deprecated = 3; */ + if (message.deprecated !== undefined) + writer.tag(3, WireType.Varint).bool(message.deprecated); + /* optional bool map_entry = 7; */ + if (message.mapEntry !== undefined) + writer.tag(7, WireType.Varint).bool(message.mapEntry); + /* optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; */ + if (message.deprecatedLegacyJsonFieldConflicts !== undefined) + writer.tag(11, WireType.Varint).bool(message.deprecatedLegacyJsonFieldConflicts); + /* optional google.protobuf.FeatureSet features = 12; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.sourceCodeInfo !== undefined) { - obj.sourceCodeInfo = SourceCodeInfo.toJSON(message.sourceCodeInfo); +} +/** + * @generated MessageType for protobuf message google.protobuf.MessageOptions + */ +export const MessageOptions = new MessageOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FieldOptions$Type extends MessageType { + constructor() { + super("google.protobuf.FieldOptions", [ + { no: 1, name: "ctype", kind: "enum", opt: true, T: () => ["google.protobuf.FieldOptions.CType", FieldOptions_CType] }, + { no: 2, name: "packed", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "jstype", kind: "enum", opt: true, T: () => ["google.protobuf.FieldOptions.JSType", FieldOptions_JSType] }, + { no: 5, name: "lazy", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 15, name: "unverified_lazy", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 10, name: "weak", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: "debug_redact", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 17, name: "retention", kind: "enum", opt: true, T: () => ["google.protobuf.FieldOptions.OptionRetention", FieldOptions_OptionRetention] }, + { no: 19, name: "targets", kind: "enum", repeat: 2 /*RepeatType.UNPACKED*/, T: () => ["google.protobuf.FieldOptions.OptionTargetType", FieldOptions_OptionTargetType] }, + { no: 20, name: "edition_defaults", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FieldOptions_EditionDefault }, + { no: 21, name: "features", kind: "message", T: () => FeatureSet }, + { no: 22, name: "feature_support", kind: "message", T: () => FieldOptions_FeatureSupport }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): FieldOptions { + const message = { targets: [], editionDefaults: [], uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FieldOptions): FieldOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.FieldOptions.CType ctype */ 1: + message.ctype = reader.int32(); + break; + case /* optional bool packed */ 2: + message.packed = reader.bool(); + break; + case /* optional google.protobuf.FieldOptions.JSType jstype */ 6: + message.jstype = reader.int32(); + break; + case /* optional bool lazy */ 5: + message.lazy = reader.bool(); + break; + case /* optional bool unverified_lazy */ 15: + message.unverifiedLazy = reader.bool(); + break; + case /* optional bool deprecated */ 3: + message.deprecated = reader.bool(); + break; + case /* optional bool weak */ 10: + message.weak = reader.bool(); + break; + case /* optional bool debug_redact */ 16: + message.debugRedact = reader.bool(); + break; + case /* optional google.protobuf.FieldOptions.OptionRetention retention */ 17: + message.retention = reader.int32(); + break; + case /* repeated google.protobuf.FieldOptions.OptionTargetType targets */ 19: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.targets.push(reader.int32()); + else + message.targets.push(reader.int32()); + break; + case /* repeated google.protobuf.FieldOptions.EditionDefault edition_defaults */ 20: + message.editionDefaults.push(FieldOptions_EditionDefault.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.FeatureSet features */ 21: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* optional google.protobuf.FieldOptions.FeatureSupport feature_support */ 22: + message.featureSupport = FieldOptions_FeatureSupport.internalBinaryRead(reader, reader.uint32(), options, message.featureSupport); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FieldOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional google.protobuf.FieldOptions.CType ctype = 1; */ + if (message.ctype !== undefined) + writer.tag(1, WireType.Varint).int32(message.ctype); + /* optional bool packed = 2; */ + if (message.packed !== undefined) + writer.tag(2, WireType.Varint).bool(message.packed); + /* optional google.protobuf.FieldOptions.JSType jstype = 6; */ + if (message.jstype !== undefined) + writer.tag(6, WireType.Varint).int32(message.jstype); + /* optional bool lazy = 5; */ + if (message.lazy !== undefined) + writer.tag(5, WireType.Varint).bool(message.lazy); + /* optional bool unverified_lazy = 15; */ + if (message.unverifiedLazy !== undefined) + writer.tag(15, WireType.Varint).bool(message.unverifiedLazy); + /* optional bool deprecated = 3; */ + if (message.deprecated !== undefined) + writer.tag(3, WireType.Varint).bool(message.deprecated); + /* optional bool weak = 10; */ + if (message.weak !== undefined) + writer.tag(10, WireType.Varint).bool(message.weak); + /* optional bool debug_redact = 16; */ + if (message.debugRedact !== undefined) + writer.tag(16, WireType.Varint).bool(message.debugRedact); + /* optional google.protobuf.FieldOptions.OptionRetention retention = 17; */ + if (message.retention !== undefined) + writer.tag(17, WireType.Varint).int32(message.retention); + /* repeated google.protobuf.FieldOptions.OptionTargetType targets = 19; */ + for (let i = 0; i < message.targets.length; i++) + writer.tag(19, WireType.Varint).int32(message.targets[i]); + /* repeated google.protobuf.FieldOptions.EditionDefault edition_defaults = 20; */ + for (let i = 0; i < message.editionDefaults.length; i++) + FieldOptions_EditionDefault.internalBinaryWrite(message.editionDefaults[i], writer.tag(20, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.FeatureSet features = 21; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(21, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.FieldOptions.FeatureSupport feature_support = 22; */ + if (message.featureSupport) + FieldOptions_FeatureSupport.internalBinaryWrite(message.featureSupport, writer.tag(22, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.syntax !== undefined && message.syntax !== "") { - obj.syntax = message.syntax; +} +/** + * @generated MessageType for protobuf message google.protobuf.FieldOptions + */ +export const FieldOptions = new FieldOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FieldOptions_EditionDefault$Type extends MessageType { + constructor() { + super("google.protobuf.FieldOptions.EditionDefault", [ + { no: 3, name: "edition", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] }, + { no: 2, name: "value", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): FieldOptions_EditionDefault { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FieldOptions_EditionDefault): FieldOptions_EditionDefault { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.Edition edition */ 3: + message.edition = reader.int32(); + break; + case /* optional string value */ 2: + message.value = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.edition !== undefined && message.edition !== 0) { - obj.edition = editionToJSON(message.edition); + internalBinaryWrite(message: FieldOptions_EditionDefault, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional google.protobuf.Edition edition = 3; */ + if (message.edition !== undefined) + writer.tag(3, WireType.Varint).int32(message.edition); + /* optional string value = 2; */ + if (message.value !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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.optionDependency = object.optionDependency?.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: [], - visibility: 0, - }; } - -export const DescriptorProto: MessageFns = { - encode(message: DescriptorProto, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.name !== undefined && message.name !== "") { - writer.uint32(10).string(message.name); +/** + * @generated MessageType for protobuf message google.protobuf.FieldOptions.EditionDefault + */ +export const FieldOptions_EditionDefault = new FieldOptions_EditionDefault$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FieldOptions_FeatureSupport$Type extends MessageType { + constructor() { + super("google.protobuf.FieldOptions.FeatureSupport", [ + { no: 1, name: "edition_introduced", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] }, + { no: 2, name: "edition_deprecated", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] }, + { no: 3, name: "deprecation_warning", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "edition_removed", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] } + ]); + } + create(value?: PartialMessage): FieldOptions_FeatureSupport { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FieldOptions_FeatureSupport): FieldOptions_FeatureSupport { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.Edition edition_introduced */ 1: + message.editionIntroduced = reader.int32(); + break; + case /* optional google.protobuf.Edition edition_deprecated */ 2: + message.editionDeprecated = reader.int32(); + break; + case /* optional string deprecation_warning */ 3: + message.deprecationWarning = reader.string(); + break; + case /* optional google.protobuf.Edition edition_removed */ 4: + message.editionRemoved = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: FieldOptions_FeatureSupport, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional google.protobuf.Edition edition_introduced = 1; */ + if (message.editionIntroduced !== undefined) + writer.tag(1, WireType.Varint).int32(message.editionIntroduced); + /* optional google.protobuf.Edition edition_deprecated = 2; */ + if (message.editionDeprecated !== undefined) + writer.tag(2, WireType.Varint).int32(message.editionDeprecated); + /* optional string deprecation_warning = 3; */ + if (message.deprecationWarning !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.deprecationWarning); + /* optional google.protobuf.Edition edition_removed = 4; */ + if (message.editionRemoved !== undefined) + writer.tag(4, WireType.Varint).int32(message.editionRemoved); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.field) { - FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.FieldOptions.FeatureSupport + */ +export const FieldOptions_FeatureSupport = new FieldOptions_FeatureSupport$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class OneofOptions$Type extends MessageType { + constructor() { + super("google.protobuf.OneofOptions", [ + { no: 1, name: "features", kind: "message", T: () => FeatureSet }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): OneofOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: OneofOptions): OneofOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.FeatureSet features */ 1: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).join(); + internalBinaryWrite(message: OneofOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional google.protobuf.FeatureSet features = 1; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.nestedType) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.OneofOptions + */ +export const OneofOptions = new OneofOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumOptions$Type extends MessageType { + constructor() { + super("google.protobuf.EnumOptions", [ + { no: 2, name: "allow_alias", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "deprecated_legacy_json_field_conflicts", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 7, name: "features", kind: "message", T: () => FeatureSet }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): EnumOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumOptions): EnumOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool allow_alias */ 2: + message.allowAlias = reader.bool(); + break; + case /* optional bool deprecated */ 3: + message.deprecated = reader.bool(); + break; + case /* optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];*/ 6: + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + break; + case /* optional google.protobuf.FeatureSet features */ 7: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: EnumOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool allow_alias = 2; */ + if (message.allowAlias !== undefined) + writer.tag(2, WireType.Varint).bool(message.allowAlias); + /* optional bool deprecated = 3; */ + if (message.deprecated !== undefined) + writer.tag(3, WireType.Varint).bool(message.deprecated); + /* optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; */ + if (message.deprecatedLegacyJsonFieldConflicts !== undefined) + writer.tag(6, WireType.Varint).bool(message.deprecatedLegacyJsonFieldConflicts); + /* optional google.protobuf.FeatureSet features = 7; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumOptions + */ +export const EnumOptions = new EnumOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumValueOptions$Type extends MessageType { + constructor() { + super("google.protobuf.EnumValueOptions", [ + { no: 1, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "features", kind: "message", T: () => FeatureSet }, + { no: 3, name: "debug_redact", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "feature_support", kind: "message", T: () => FieldOptions_FeatureSupport }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): EnumValueOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumValueOptions): EnumValueOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool deprecated */ 1: + message.deprecated = reader.bool(); + break; + case /* optional google.protobuf.FeatureSet features */ 2: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* optional bool debug_redact */ 3: + message.debugRedact = reader.bool(); + break; + case /* optional google.protobuf.FieldOptions.FeatureSupport feature_support */ 4: + message.featureSupport = FieldOptions_FeatureSupport.internalBinaryRead(reader, reader.uint32(), options, message.featureSupport); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: EnumValueOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool deprecated = 1; */ + if (message.deprecated !== undefined) + writer.tag(1, WireType.Varint).bool(message.deprecated); + /* optional google.protobuf.FeatureSet features = 2; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* optional bool debug_redact = 3; */ + if (message.debugRedact !== undefined) + writer.tag(3, WireType.Varint).bool(message.debugRedact); + /* optional google.protobuf.FieldOptions.FeatureSupport feature_support = 4; */ + if (message.featureSupport) + FieldOptions_FeatureSupport.internalBinaryWrite(message.featureSupport, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.extensionRange) { - DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumValueOptions + */ +export const EnumValueOptions = new EnumValueOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ServiceOptions$Type extends MessageType { + constructor() { + super("google.protobuf.ServiceOptions", [ + { no: 34, name: "features", kind: "message", T: () => FeatureSet }, + { no: 33, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): ServiceOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ServiceOptions): ServiceOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.FeatureSet features */ 34: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* optional bool deprecated */ 33: + message.deprecated = reader.bool(); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - for (const v of message.oneofDecl) { - OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).join(); + internalBinaryWrite(message: ServiceOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional google.protobuf.FeatureSet features = 34; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(34, WireType.LengthDelimited).fork(), options).join(); + /* optional bool deprecated = 33; */ + if (message.deprecated !== undefined) + writer.tag(33, WireType.Varint).bool(message.deprecated); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.options !== undefined) { - MessageOptions.encode(message.options, writer.uint32(58).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.ServiceOptions + */ +export const ServiceOptions = new ServiceOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MethodOptions$Type extends MessageType { + constructor() { + super("google.protobuf.MethodOptions", [ + { no: 33, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 34, name: "idempotency_level", kind: "enum", opt: true, T: () => ["google.protobuf.MethodOptions.IdempotencyLevel", MethodOptions_IdempotencyLevel] }, + { no: 35, name: "features", kind: "message", T: () => FeatureSet }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): MethodOptions { + const message = { uninterpretedOption: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MethodOptions): MethodOptions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool deprecated */ 33: + message.deprecated = reader.bool(); + break; + case /* optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level */ 34: + message.idempotencyLevel = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet features */ 35: + message.features = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.features); + break; + case /* repeated google.protobuf.UninterpretedOption uninterpreted_option */ 999: + message.uninterpretedOption.push(UninterpretedOption.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MethodOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool deprecated = 33; */ + if (message.deprecated !== undefined) + writer.tag(33, WireType.Varint).bool(message.deprecated); + /* optional google.protobuf.MethodOptions.IdempotencyLevel idempotency_level = 34; */ + if (message.idempotencyLevel !== undefined) + writer.tag(34, WireType.Varint).int32(message.idempotencyLevel); + /* optional google.protobuf.FeatureSet features = 35; */ + if (message.features) + FeatureSet.internalBinaryWrite(message.features, writer.tag(35, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; */ + for (let i = 0; i < message.uninterpretedOption.length; i++) + UninterpretedOption.internalBinaryWrite(message.uninterpretedOption[i], writer.tag(999, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.reservedRange) { - DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).join(); +} +/** + * @generated MessageType for protobuf message google.protobuf.MethodOptions + */ +export const MethodOptions = new MethodOptions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UninterpretedOption$Type extends MessageType { + constructor() { + super("google.protobuf.UninterpretedOption", [ + { no: 2, name: "name", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption_NamePart }, + { no: 3, name: "identifier_value", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "positive_int_value", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "negative_int_value", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "double_value", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 7, name: "string_value", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 8, name: "aggregate_value", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): UninterpretedOption { + const message = { name: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UninterpretedOption): UninterpretedOption { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.UninterpretedOption.NamePart name */ 2: + message.name.push(UninterpretedOption_NamePart.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional string identifier_value */ 3: + message.identifierValue = reader.string(); + break; + case /* optional uint64 positive_int_value */ 4: + message.positiveIntValue = reader.uint64().toString(); + break; + case /* optional int64 negative_int_value */ 5: + message.negativeIntValue = reader.int64().toString(); + break; + case /* optional double double_value */ 6: + message.doubleValue = reader.double(); + break; + case /* optional bytes string_value */ 7: + message.stringValue = reader.bytes(); + break; + case /* optional string aggregate_value */ 8: + message.aggregateValue = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: UninterpretedOption, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.protobuf.UninterpretedOption.NamePart name = 2; */ + for (let i = 0; i < message.name.length; i++) + UninterpretedOption_NamePart.internalBinaryWrite(message.name[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* optional string identifier_value = 3; */ + if (message.identifierValue !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.identifierValue); + /* optional uint64 positive_int_value = 4; */ + if (message.positiveIntValue !== undefined) + writer.tag(4, WireType.Varint).uint64(message.positiveIntValue); + /* optional int64 negative_int_value = 5; */ + if (message.negativeIntValue !== undefined) + writer.tag(5, WireType.Varint).int64(message.negativeIntValue); + /* optional double double_value = 6; */ + if (message.doubleValue !== undefined) + writer.tag(6, WireType.Bit64).double(message.doubleValue); + /* optional bytes string_value = 7; */ + if (message.stringValue !== undefined) + writer.tag(7, WireType.LengthDelimited).bytes(message.stringValue); + /* optional string aggregate_value = 8; */ + if (message.aggregateValue !== undefined) + writer.tag(8, WireType.LengthDelimited).string(message.aggregateValue); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - for (const v of message.reservedName) { - writer.uint32(82).string(v!); +} +/** + * @generated MessageType for protobuf message google.protobuf.UninterpretedOption + */ +export const UninterpretedOption = new UninterpretedOption$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UninterpretedOption_NamePart$Type extends MessageType { + constructor() { + super("google.protobuf.UninterpretedOption.NamePart", [ + { no: 1, name: "name_part", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "is_extension", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): UninterpretedOption_NamePart { + const message = { namePart: "", isExtension: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UninterpretedOption_NamePart): UninterpretedOption_NamePart { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name_part */ 1: + message.namePart = reader.string(); + break; + case /* bool is_extension */ 2: + message.isExtension = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.visibility !== undefined && message.visibility !== 0) { - writer.uint32(88).int32(message.visibility); + internalBinaryWrite(message: UninterpretedOption_NamePart, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name_part = 1; */ + if (message.namePart !== "") + writer.tag(1, WireType.LengthDelimited).string(message.namePart); + /* bool is_extension = 2; */ + if (message.isExtension !== false) + writer.tag(2, WireType.Varint).bool(message.isExtension); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; - } - case 11: { - if (tag !== 88) { - break; - } - - message.visibility = reader.int32() as any; - continue; +} +/** + * @generated MessageType for protobuf message google.protobuf.UninterpretedOption.NamePart + */ +export const UninterpretedOption_NamePart = new UninterpretedOption_NamePart$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FeatureSet$Type extends MessageType { + constructor() { + super("google.protobuf.FeatureSet", [ + { no: 1, name: "field_presence", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.FieldPresence", FeatureSet_FieldPresence] }, + { no: 2, name: "enum_type", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.EnumType", FeatureSet_EnumType] }, + { no: 3, name: "repeated_field_encoding", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.RepeatedFieldEncoding", FeatureSet_RepeatedFieldEncoding] }, + { no: 4, name: "utf8_validation", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.Utf8Validation", FeatureSet_Utf8Validation] }, + { no: 5, name: "message_encoding", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.MessageEncoding", FeatureSet_MessageEncoding] }, + { no: 6, name: "json_format", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.JsonFormat", FeatureSet_JsonFormat] }, + { no: 7, name: "enforce_naming_style", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.EnforceNamingStyle", FeatureSet_EnforceNamingStyle] }, + { no: 8, name: "default_symbol_visibility", kind: "enum", opt: true, T: () => ["google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility", FeatureSet_VisibilityFeature_DefaultSymbolVisibility] } + ]); + } + create(value?: PartialMessage): FeatureSet { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeatureSet): FeatureSet { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.FeatureSet.FieldPresence field_presence */ 1: + message.fieldPresence = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet.EnumType enum_type */ 2: + message.enumType = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding */ 3: + message.repeatedFieldEncoding = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet.Utf8Validation utf8_validation */ 4: + message.utf8Validation = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet.MessageEncoding message_encoding */ 5: + message.messageEncoding = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet.JsonFormat json_format */ 6: + message.jsonFormat = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style */ 7: + message.enforceNamingStyle = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility */ 8: + message.defaultSymbolVisibility = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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)) - : [], - visibility: isSet(object.visibility) ? symbolVisibilityFromJSON(object.visibility) : 0, - }; - }, - - toJSON(message: DescriptorProto): unknown { - const obj: any = {}; - if (message.name !== undefined && message.name !== "") { - obj.name = message.name; + return message; + } + internalBinaryWrite(message: FeatureSet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional google.protobuf.FeatureSet.FieldPresence field_presence = 1; */ + if (message.fieldPresence !== undefined) + writer.tag(1, WireType.Varint).int32(message.fieldPresence); + /* optional google.protobuf.FeatureSet.EnumType enum_type = 2; */ + if (message.enumType !== undefined) + writer.tag(2, WireType.Varint).int32(message.enumType); + /* optional google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3; */ + if (message.repeatedFieldEncoding !== undefined) + writer.tag(3, WireType.Varint).int32(message.repeatedFieldEncoding); + /* optional google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4; */ + if (message.utf8Validation !== undefined) + writer.tag(4, WireType.Varint).int32(message.utf8Validation); + /* optional google.protobuf.FeatureSet.MessageEncoding message_encoding = 5; */ + if (message.messageEncoding !== undefined) + writer.tag(5, WireType.Varint).int32(message.messageEncoding); + /* optional google.protobuf.FeatureSet.JsonFormat json_format = 6; */ + if (message.jsonFormat !== undefined) + writer.tag(6, WireType.Varint).int32(message.jsonFormat); + /* optional google.protobuf.FeatureSet.EnforceNamingStyle enforce_naming_style = 7; */ + if (message.enforceNamingStyle !== undefined) + writer.tag(7, WireType.Varint).int32(message.enforceNamingStyle); + /* optional google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8; */ + if (message.defaultSymbolVisibility !== undefined) + writer.tag(8, WireType.Varint).int32(message.defaultSymbolVisibility); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.field?.length) { - obj.field = message.field.map((e) => FieldDescriptorProto.toJSON(e)); +} +/** + * @generated MessageType for protobuf message google.protobuf.FeatureSet + */ +export const FeatureSet = new FeatureSet$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FeatureSet_VisibilityFeature$Type extends MessageType { + constructor() { + super("google.protobuf.FeatureSet.VisibilityFeature", []); } - if (message.extension?.length) { - obj.extension = message.extension.map((e) => FieldDescriptorProto.toJSON(e)); + create(value?: PartialMessage): FeatureSet_VisibilityFeature { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; } - if (message.nestedType?.length) { - obj.nestedType = message.nestedType.map((e) => DescriptorProto.toJSON(e)); + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeatureSet_VisibilityFeature): FeatureSet_VisibilityFeature { + return target ?? this.create(); } - if (message.enumType?.length) { - obj.enumType = message.enumType.map((e) => EnumDescriptorProto.toJSON(e)); + internalBinaryWrite(message: FeatureSet_VisibilityFeature, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.extensionRange?.length) { - obj.extensionRange = message.extensionRange.map((e) => DescriptorProto_ExtensionRange.toJSON(e)); +} +/** + * @generated MessageType for protobuf message google.protobuf.FeatureSet.VisibilityFeature + */ +export const FeatureSet_VisibilityFeature = new FeatureSet_VisibilityFeature$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FeatureSetDefaults$Type extends MessageType { + constructor() { + super("google.protobuf.FeatureSetDefaults", [ + { no: 1, name: "defaults", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FeatureSetDefaults_FeatureSetEditionDefault }, + { no: 4, name: "minimum_edition", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] }, + { no: 5, name: "maximum_edition", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] } + ]); + } + create(value?: PartialMessage): FeatureSetDefaults { + const message = { defaults: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeatureSetDefaults): FeatureSetDefaults { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults */ 1: + message.defaults.push(FeatureSetDefaults_FeatureSetEditionDefault.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.Edition minimum_edition */ 4: + message.minimumEdition = reader.int32(); + break; + case /* optional google.protobuf.Edition maximum_edition */ 5: + message.maximumEdition = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.oneofDecl?.length) { - obj.oneofDecl = message.oneofDecl.map((e) => OneofDescriptorProto.toJSON(e)); + internalBinaryWrite(message: FeatureSetDefaults, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1; */ + for (let i = 0; i < message.defaults.length; i++) + FeatureSetDefaults_FeatureSetEditionDefault.internalBinaryWrite(message.defaults[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Edition minimum_edition = 4; */ + if (message.minimumEdition !== undefined) + writer.tag(4, WireType.Varint).int32(message.minimumEdition); + /* optional google.protobuf.Edition maximum_edition = 5; */ + if (message.maximumEdition !== undefined) + writer.tag(5, WireType.Varint).int32(message.maximumEdition); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.options !== undefined) { - obj.options = MessageOptions.toJSON(message.options); +} +/** + * @generated MessageType for protobuf message google.protobuf.FeatureSetDefaults + */ +export const FeatureSetDefaults = new FeatureSetDefaults$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FeatureSetDefaults_FeatureSetEditionDefault$Type extends MessageType { + constructor() { + super("google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault", [ + { no: 3, name: "edition", kind: "enum", opt: true, T: () => ["google.protobuf.Edition", Edition] }, + { no: 4, name: "overridable_features", kind: "message", T: () => FeatureSet }, + { no: 5, name: "fixed_features", kind: "message", T: () => FeatureSet } + ]); + } + create(value?: PartialMessage): FeatureSetDefaults_FeatureSetEditionDefault { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FeatureSetDefaults_FeatureSetEditionDefault): FeatureSetDefaults_FeatureSetEditionDefault { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional google.protobuf.Edition edition */ 3: + message.edition = reader.int32(); + break; + case /* optional google.protobuf.FeatureSet overridable_features */ 4: + message.overridableFeatures = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.overridableFeatures); + break; + case /* optional google.protobuf.FeatureSet fixed_features */ 5: + message.fixedFeatures = FeatureSet.internalBinaryRead(reader, reader.uint32(), options, message.fixedFeatures); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.reservedRange?.length) { - obj.reservedRange = message.reservedRange.map((e) => DescriptorProto_ReservedRange.toJSON(e)); + internalBinaryWrite(message: FeatureSetDefaults_FeatureSetEditionDefault, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional google.protobuf.Edition edition = 3; */ + if (message.edition !== undefined) + writer.tag(3, WireType.Varint).int32(message.edition); + /* optional google.protobuf.FeatureSet overridable_features = 4; */ + if (message.overridableFeatures) + FeatureSet.internalBinaryWrite(message.overridableFeatures, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.FeatureSet fixed_features = 5; */ + if (message.fixedFeatures) + FeatureSet.internalBinaryWrite(message.fixedFeatures, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.reservedName?.length) { - obj.reservedName = message.reservedName; +} +/** + * @generated MessageType for protobuf message google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + */ +export const FeatureSetDefaults_FeatureSetEditionDefault = new FeatureSetDefaults_FeatureSetEditionDefault$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourceCodeInfo$Type extends MessageType { + constructor() { + super("google.protobuf.SourceCodeInfo", [ + { no: 1, name: "location", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => SourceCodeInfo_Location } + ]); + } + create(value?: PartialMessage): SourceCodeInfo { + const message = { location: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceCodeInfo): SourceCodeInfo { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.SourceCodeInfo.Location location */ 1: + message.location.push(SourceCodeInfo_Location.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.visibility !== undefined && message.visibility !== 0) { - obj.visibility = symbolVisibilityToJSON(message.visibility); + internalBinaryWrite(message: SourceCodeInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.protobuf.SourceCodeInfo.Location location = 1; */ + for (let i = 0; i < message.location.length; i++) + SourceCodeInfo_Location.internalBinaryWrite(message.location[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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) || []; - message.visibility = object.visibility ?? 0; - 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); +/** + * @generated MessageType for protobuf message google.protobuf.SourceCodeInfo + */ +export const SourceCodeInfo = new SourceCodeInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SourceCodeInfo_Location$Type extends MessageType { + constructor() { + super("google.protobuf.SourceCodeInfo.Location", [ + { no: 1, name: "path", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "span", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "leading_comments", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "trailing_comments", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "leading_detached_comments", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SourceCodeInfo_Location { + const message = { path: [], span: [], leadingDetachedComments: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceCodeInfo_Location): SourceCodeInfo_Location { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated int32 path = 1 [packed = true];*/ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.path.push(reader.int32()); + else + message.path.push(reader.int32()); + break; + case /* repeated int32 span = 2 [packed = true];*/ 2: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.span.push(reader.int32()); + else + message.span.push(reader.int32()); + break; + case /* optional string leading_comments */ 3: + message.leadingComments = reader.string(); + break; + case /* optional string trailing_comments */ 4: + message.trailingComments = reader.string(); + break; + case /* repeated string leading_detached_comments */ 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SourceCodeInfo_Location, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated int32 path = 1 [packed = true]; */ + if (message.path.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.path.length; i++) + writer.int32(message.path[i]); + writer.join(); + } + /* repeated int32 span = 2 [packed = true]; */ + if (message.span.length) { + writer.tag(2, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.span.length; i++) + writer.int32(message.span[i]); + writer.join(); + } + /* optional string leading_comments = 3; */ + if (message.leadingComments !== undefined) + writer.tag(3, WireType.LengthDelimited).string(message.leadingComments); + /* optional string trailing_comments = 4; */ + if (message.trailingComments !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.trailingComments); + /* repeated string leading_detached_comments = 6; */ + for (let i = 0; i < message.leadingDetachedComments.length; i++) + writer.tag(6, WireType.LengthDelimited).string(message.leadingDetachedComments[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.end !== undefined && message.end !== 0) { - writer.uint32(16).int32(message.end); +} +/** + * @generated MessageType for protobuf message google.protobuf.SourceCodeInfo.Location + */ +export const SourceCodeInfo_Location = new SourceCodeInfo_Location$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GeneratedCodeInfo$Type extends MessageType { + constructor() { + super("google.protobuf.GeneratedCodeInfo", [ + { no: 1, name: "annotation", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => GeneratedCodeInfo_Annotation } + ]); + } + create(value?: PartialMessage): GeneratedCodeInfo { + const message = { annotation: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GeneratedCodeInfo): GeneratedCodeInfo { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.GeneratedCodeInfo.Annotation annotation */ 1: + message.annotation.push(GeneratedCodeInfo_Annotation.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.options !== undefined) { - ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).join(); + internalBinaryWrite(message: GeneratedCodeInfo, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.protobuf.GeneratedCodeInfo.Annotation annotation = 1; */ + for (let i = 0; i < message.annotation.length; i++) + GeneratedCodeInfo_Annotation.internalBinaryWrite(message.annotation[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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: [], visibility: 0 }; -} - -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!); - } - if (message.visibility !== undefined && message.visibility !== 0) { - writer.uint32(48).int32(message.visibility); - } - 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; - } - case 6: { - if (tag !== 48) { - break; - } - - message.visibility = reader.int32() as any; - 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)) - : [], - visibility: isSet(object.visibility) ? symbolVisibilityFromJSON(object.visibility) : 0, - }; - }, - - 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; - } - if (message.visibility !== undefined && message.visibility !== 0) { - obj.visibility = symbolVisibilityToJSON(message.visibility); - } - 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) || []; - message.visibility = object.visibility ?? 0; - 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, - enforceNamingStyle: 0, - defaultSymbolVisibility: 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); - } - if (message.enforceNamingStyle !== undefined && message.enforceNamingStyle !== 0) { - writer.uint32(56).int32(message.enforceNamingStyle); - } - if (message.defaultSymbolVisibility !== undefined && message.defaultSymbolVisibility !== 0) { - writer.uint32(64).int32(message.defaultSymbolVisibility); - } - 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; - } - case 7: { - if (tag !== 56) { - break; - } - - message.enforceNamingStyle = reader.int32() as any; - continue; - } - case 8: { - if (tag !== 64) { - break; - } - - message.defaultSymbolVisibility = 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, - enforceNamingStyle: isSet(object.enforceNamingStyle) - ? featureSet_EnforceNamingStyleFromJSON(object.enforceNamingStyle) - : 0, - defaultSymbolVisibility: isSet(object.defaultSymbolVisibility) - ? featureSet_VisibilityFeature_DefaultSymbolVisibilityFromJSON(object.defaultSymbolVisibility) - : 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); - } - if (message.enforceNamingStyle !== undefined && message.enforceNamingStyle !== 0) { - obj.enforceNamingStyle = featureSet_EnforceNamingStyleToJSON(message.enforceNamingStyle); - } - if (message.defaultSymbolVisibility !== undefined && message.defaultSymbolVisibility !== 0) { - obj.defaultSymbolVisibility = featureSet_VisibilityFeature_DefaultSymbolVisibilityToJSON( - message.defaultSymbolVisibility, - ); - } - 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; - message.enforceNamingStyle = object.enforceNamingStyle ?? 0; - message.defaultSymbolVisibility = object.defaultSymbolVisibility ?? 0; - return message; - }, -}; - -function createBaseFeatureSet_VisibilityFeature(): FeatureSet_VisibilityFeature { - return {}; -} - -export const FeatureSet_VisibilityFeature: MessageFns = { - encode(_: FeatureSet_VisibilityFeature, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): FeatureSet_VisibilityFeature { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFeatureSet_VisibilityFeature(); - 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): FeatureSet_VisibilityFeature { - return {}; - }, - - toJSON(_: FeatureSet_VisibilityFeature): unknown { - const obj: any = {}; - return obj; - }, - - create(base?: DeepPartial): FeatureSet_VisibilityFeature { - return FeatureSet_VisibilityFeature.fromPartial(base ?? {}); - }, - fromPartial(_: DeepPartial): FeatureSet_VisibilityFeature { - const message = createBaseFeatureSet_VisibilityFeature(); - 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()); +/** + * @generated MessageType for protobuf message google.protobuf.GeneratedCodeInfo + */ +export const GeneratedCodeInfo = new GeneratedCodeInfo$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GeneratedCodeInfo_Annotation$Type extends MessageType { + constructor() { + super("google.protobuf.GeneratedCodeInfo.Annotation", [ + { no: 1, name: "path", kind: "scalar", repeat: 1 /*RepeatType.PACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "source_file", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "begin", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "end", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: "semantic", kind: "enum", opt: true, T: () => ["google.protobuf.GeneratedCodeInfo.Annotation.Semantic", GeneratedCodeInfo_Annotation_Semantic] } + ]); + } + create(value?: PartialMessage): GeneratedCodeInfo_Annotation { + const message = { path: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GeneratedCodeInfo_Annotation): GeneratedCodeInfo_Annotation { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated int32 path = 1 [packed = true];*/ 1: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.path.push(reader.int32()); + else + message.path.push(reader.int32()); + break; + case /* optional string source_file */ 2: + message.sourceFile = reader.string(); + break; + case /* optional int32 begin */ 3: + message.begin = reader.int32(); + break; + case /* optional int32 end */ 4: + message.end = reader.int32(); + break; + case /* optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic */ 5: + message.semantic = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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)); + return message; + } + internalBinaryWrite(message: GeneratedCodeInfo_Annotation, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated int32 path = 1 [packed = true]; */ + if (message.path.length) { + writer.tag(1, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.path.length; i++) + writer.int32(message.path[i]); + writer.join(); + } + /* optional string source_file = 2; */ + if (message.sourceFile !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.sourceFile); + /* optional int32 begin = 3; */ + if (message.begin !== undefined) + writer.tag(3, WireType.Varint).int32(message.begin); + /* optional int32 end = 4; */ + if (message.end !== undefined) + writer.tag(4, WireType.Varint).int32(message.end); + /* optional google.protobuf.GeneratedCodeInfo.Annotation.Semantic semantic = 5; */ + if (message.semantic !== undefined) + writer.tag(5, WireType.Varint).int32(message.semantic); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.protobuf.GeneratedCodeInfo.Annotation + */ +export const GeneratedCodeInfo_Annotation = new GeneratedCodeInfo_Annotation$Type(); diff --git a/src/grpc/generated/google/protobuf/duration.ts b/src/grpc/generated/google/protobuf/duration.ts index b4c5aeb..2f59c81 100644 --- a/src/grpc/generated/google/protobuf/duration.ts +++ b/src/grpc/generated/google/protobuf/duration.ts @@ -1,15 +1,52 @@ -// 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"; - +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/protobuf/duration.proto" (package "google.protobuf", syntax proto3) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { typeofJsonValue } from "@protobuf-ts/runtime"; +import type { JsonValue } from "@protobuf-ts/runtime"; +import type { JsonReadOptions } from "@protobuf-ts/runtime"; +import type { JsonWriteOptions } from "@protobuf-ts/runtime"; +import { PbLong } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; /** * A Duration represents a signed, fixed-length span of time represented * as a count of seconds and fractions of seconds at nanosecond @@ -69,121 +106,125 @@ export const protobufPackage = "google.protobuf"; * 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". + * + * + * @generated from protobuf message google.protobuf.Duration */ 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 }; + /** + * 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 + * + * @generated from protobuf field: int64 seconds = 1; + */ + seconds: string; + /** + * 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. + * + * @generated from protobuf field: int32 nanos = 2; + */ + nanos: number; } - -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()); +// @generated message type with reflection information, may provide speed optimized methods +class Duration$Type extends MessageType { + constructor() { + super("google.protobuf.Duration", [ + { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); } - 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; + /** + * Encode `Duration` to JSON string like "3.000001s". + */ + internalJsonWrite(message: Duration, options: JsonWriteOptions): JsonValue { + let s = PbLong.from(message.seconds).toNumber(); + if (s > 315576000000 || s < -315576000000) + throw new Error("Duration value out of range."); + let text = message.seconds.toString(); + if (s === 0 && message.nanos < 0) + text = "-" + text; + if (message.nanos !== 0) { + let nanosStr = Math.abs(message.nanos).toString(); + nanosStr = "0".repeat(9 - nanosStr.length) + nanosStr; + if (nanosStr.substring(3) === "000000") + nanosStr = nanosStr.substring(0, 3); + else if (nanosStr.substring(6) === "000") + nanosStr = nanosStr.substring(0, 6); + text += "." + nanosStr; } - case 2: { - if (tag !== 16) { - break; - } - - message.nanos = reader.int32(); - continue; + return text + "s"; + } + /** + * Decode `Duration` from JSON string like "3.000001s" + */ + internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Duration): Duration { + if (typeof json !== "string") + throw new Error("Unable to parse Duration from JSON " + typeofJsonValue(json) + ". Expected string."); + let match = json.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/); + if (match === null) + throw new Error("Unable to parse Duration from JSON string. Invalid format."); + if (!target) + target = this.create(); + let [, sign, secs, nanos] = match; + let longSeconds = PbLong.from(sign + secs); + if (longSeconds.toNumber() > 315576000000 || longSeconds.toNumber() < -315576000000) + throw new Error("Unable to parse Duration from JSON string. Value out of range."); + target.seconds = longSeconds.toString(); + if (typeof nanos == "string") { + let nanosStr = sign + nanos + "0".repeat(9 - nanos.length); + target.nanos = parseInt(nanosStr); } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return target; } - 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(); + create(value?: PartialMessage): Duration { + const message = { seconds: "0", nanos: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; } - if (message.nanos !== 0) { - obj.nanos = Math.round(message.nanos); + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Duration): Duration { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 seconds */ 1: + message.seconds = reader.int64().toString(); + break; + case /* int32 nanos */ 2: + message.nanos = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Duration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 seconds = 1; */ + if (message.seconds !== "0") + writer.tag(1, WireType.Varint).int64(message.seconds); + /* int32 nanos = 2; */ + if (message.nanos !== 0) + writer.tag(2, WireType.Varint).int32(message.nanos); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.protobuf.Duration + */ +export const Duration = new Duration$Type(); diff --git a/src/grpc/generated/google/protobuf/empty.ts b/src/grpc/generated/google/protobuf/empty.ts index 94d498c..cca6de2 100644 --- a/src/grpc/generated/google/protobuf/empty.ts +++ b/src/grpc/generated/google/protobuf/empty.ts @@ -1,15 +1,46 @@ -// 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"; - +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/protobuf/empty.proto" (package "google.protobuf", syntax proto3) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; /** * 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 @@ -18,67 +49,35 @@ export const protobufPackage = "google.protobuf"; * service Foo { * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); * } + * + * + * @generated from protobuf message 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); +// @generated message type with reflection information, may provide speed optimized methods +class Empty$Type extends MessageType { + constructor() { + super("google.protobuf.Empty", []); + } + create(value?: PartialMessage): Empty { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty { + return target ?? this.create(); + } + internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.protobuf.Empty + */ +export const Empty = new Empty$Type(); diff --git a/src/grpc/generated/google/protobuf/struct.ts b/src/grpc/generated/google/protobuf/struct.ts index 9de517e..bf55e35 100644 --- a/src/grpc/generated/google/protobuf/struct.ts +++ b/src/grpc/generated/google/protobuf/struct.ts @@ -1,49 +1,53 @@ -// 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"; - } -} - +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/protobuf/struct.proto" (package "google.protobuf", syntax proto3) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { isJsonObject } from "@protobuf-ts/runtime"; +import { typeofJsonValue } from "@protobuf-ts/runtime"; +import type { JsonValue } from "@protobuf-ts/runtime"; +import type { JsonReadOptions } from "@protobuf-ts/runtime"; +import type { JsonWriteOptions } from "@protobuf-ts/runtime"; +import type { JsonObject } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; /** * `Struct` represents a structured data value, consisting of fields * which map to dynamically typed values. In some languages, `Struct` @@ -53,17 +57,19 @@ export function nullValueToJSON(object: NullValue): string { * with the proto support for the language. * * The JSON representation for `Struct` is JSON object. + * + * @generated from protobuf message google.protobuf.Struct */ export interface Struct { - /** Unordered map of dynamically typed values. */ - fields: { [key: string]: any | undefined }; -} - -export interface Struct_FieldsEntry { - key: string; - value: any | undefined; + /** + * Unordered map of dynamically typed values. + * + * @generated from protobuf field: map fields = 1; + */ + fields: { + [key: string]: Value; + }; } - /** * `Value` represents a dynamically typed value which can be either * null, a number, a string, a boolean, a recursive struct value, or a @@ -71,545 +77,407 @@ export interface Struct_FieldsEntry { * variants. Absence of any variant indicates an error. * * The JSON representation for `Value` is JSON value. + * + * @generated from protobuf message google.protobuf.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; + /** + * @generated from protobuf oneof: kind + */ + kind: { + oneofKind: "nullValue"; + /** + * Represents a null value. + * + * @generated from protobuf field: google.protobuf.NullValue null_value = 1; + */ + nullValue: NullValue; + } | { + oneofKind: "numberValue"; + /** + * Represents a double value. + * + * @generated from protobuf field: double number_value = 2; + */ + numberValue: number; + } | { + oneofKind: "stringValue"; + /** + * Represents a string value. + * + * @generated from protobuf field: string string_value = 3; + */ + stringValue: string; + } | { + oneofKind: "boolValue"; + /** + * Represents a boolean value. + * + * @generated from protobuf field: bool bool_value = 4; + */ + boolValue: boolean; + } | { + oneofKind: "structValue"; + /** + * Represents a structured value. + * + * @generated from protobuf field: google.protobuf.Struct struct_value = 5; + */ + structValue: Struct; + } | { + oneofKind: "listValue"; + /** + * Represents a repeated `Value`. + * + * @generated from protobuf field: google.protobuf.ListValue list_value = 6; + */ + listValue: ListValue; + } | { + oneofKind: undefined; + }; } - /** * `ListValue` is a wrapper around a repeated field of values. * * The JSON representation for `ListValue` is JSON array. + * + * @generated from protobuf message google.protobuf.ListValue */ export interface ListValue { - /** Repeated field of dynamically typed values. */ - values: any[]; + /** + * Repeated field of dynamically typed values. + * + * @generated from protobuf field: repeated google.protobuf.Value values = 1; + */ + values: Value[]; } - -function createBaseStruct(): Struct { - return { fields: {} }; +/** + * `NullValue` is a singleton enumeration to represent the null value for the + * `Value` type union. + * + * The JSON representation for `NullValue` is JSON `null`. + * + * @generated from protobuf enum google.protobuf.NullValue + */ +export enum NullValue { + /** + * Null value. + * + * @generated from protobuf enum value: NULL_VALUE = 0; + */ + NULL_VALUE = 0 } - -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; - }); - } +// @generated message type with reflection information, may provide speed optimized methods +class Struct$Type extends MessageType { + constructor() { + super("google.protobuf.Struct", [ + { no: 1, name: "fields", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); } - 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; + /** + * Encode `Struct` to JSON object. + */ + internalJsonWrite(message: Struct, options: JsonWriteOptions): JsonValue { + let json: JsonObject = {}; + for (let [k, v] of Object.entries(message.fields)) { + json[k] = Value.toJson(v); } - 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 json; } - 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); + /** + * Decode `Struct` from JSON object. + */ + internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Struct): Struct { + if (!isJsonObject(json)) + throw new globalThis.Error("Unable to parse message " + this.typeName + " from JSON " + typeofJsonValue(json) + "."); + if (!target) + target = this.create(); + for (let [k, v] of globalThis.Object.entries(json)) { + target.fields[k] = Value.fromJson(v); + } + return target; } - if (message.value !== undefined) { - Value.encode(Value.wrap(message.value), writer.uint32(18).fork()).join(); + create(value?: PartialMessage): Struct { + const message = { fields: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; } - 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; + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Struct): Struct { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map fields */ 1: + this.binaryReadMap1(message.fields, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; } - 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; + private binaryReadMap1(map: Struct["fields"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Struct["fields"] | undefined, val: Struct["fields"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field google.protobuf.Struct.fields"); + } + } + map[key ?? ""] = val ?? Value.create(); } - if (message.value !== undefined) { - obj.value = message.value; + internalBinaryWrite(message: Struct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map fields = 1; */ + for (let k of Object.keys(message.fields)) { + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.fields[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message google.protobuf.Struct + */ +export const Struct = new Struct$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Value$Type extends MessageType { + constructor() { + super("google.protobuf.Value", [ + { no: 1, name: "null_value", kind: "enum", oneof: "kind", T: () => ["google.protobuf.NullValue", NullValue] }, + { no: 2, name: "number_value", kind: "scalar", oneof: "kind", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 3, name: "string_value", kind: "scalar", oneof: "kind", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "bool_value", kind: "scalar", oneof: "kind", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "struct_value", kind: "message", oneof: "kind", T: () => Struct }, + { no: 6, name: "list_value", kind: "message", oneof: "kind", T: () => ListValue } + ]); } - 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; + /** + * Encode `Value` to JSON value. + */ + internalJsonWrite(message: Value, options: JsonWriteOptions): JsonValue { + if (message.kind.oneofKind === undefined) + throw new globalThis.Error(); + switch (message.kind.oneofKind) { + case undefined: throw new globalThis.Error(); + case "boolValue": return message.kind.boolValue; + case "nullValue": return null; + case "numberValue": + let numberValue = message.kind.numberValue; + if (typeof numberValue == "number" && !Number.isFinite(numberValue)) + throw new globalThis.Error(); + return numberValue; + case "stringValue": return message.kind.stringValue; + case "listValue": + let listValueField = this.fields.find(f => f.no === 6); + if (listValueField?.kind !== "message") + throw new globalThis.Error(); + return listValueField.T().toJson(message.kind.listValue); + case "structValue": + let structValueField = this.fields.find(f => f.no === 5); + if (structValueField?.kind !== "message") + throw new globalThis.Error(); + return structValueField.T().toJson(message.kind.structValue); } - 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; + } + /** + * Decode `Value` from JSON value. + */ + internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Value): Value { + if (!target) + target = this.create(); + switch (typeof json) { + case "number": + target.kind = { oneofKind: "numberValue", numberValue: json }; + break; + case "string": + target.kind = { oneofKind: "stringValue", stringValue: json }; + break; + case "boolean": + target.kind = { oneofKind: "boolValue", boolValue: json }; + break; + case "object": + if (json === null) { + target.kind = { oneofKind: "nullValue", nullValue: NullValue.NULL_VALUE }; + } + else if (globalThis.Array.isArray(json)) { + target.kind = { oneofKind: "listValue", listValue: ListValue.fromJson(json) }; + } + else { + target.kind = { oneofKind: "structValue", structValue: Struct.fromJson(json) }; + } + break; + default: throw new globalThis.Error("Unable to parse " + this.typeName + " from JSON " + typeofJsonValue(json)); } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return target; } - 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; + create(value?: PartialMessage): Value { + const message = { kind: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; } - 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 }; + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.NullValue null_value */ 1: + message.kind = { + oneofKind: "nullValue", + nullValue: reader.int32() + }; + break; + case /* double number_value */ 2: + message.kind = { + oneofKind: "numberValue", + numberValue: reader.double() + }; + break; + case /* string string_value */ 3: + message.kind = { + oneofKind: "stringValue", + stringValue: reader.string() + }; + break; + case /* bool bool_value */ 4: + message.kind = { + oneofKind: "boolValue", + boolValue: reader.bool() + }; + break; + case /* google.protobuf.Struct struct_value */ 5: + message.kind = { + oneofKind: "structValue", + structValue: Struct.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).structValue) + }; + break; + case /* google.protobuf.ListValue list_value */ 6: + message.kind = { + oneofKind: "listValue", + listValue: ListValue.internalBinaryRead(reader, reader.uint32(), options, (message.kind as any).listValue) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - 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 message; } - 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; + internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.protobuf.NullValue null_value = 1; */ + if (message.kind.oneofKind === "nullValue") + writer.tag(1, WireType.Varint).int32(message.kind.nullValue); + /* double number_value = 2; */ + if (message.kind.oneofKind === "numberValue") + writer.tag(2, WireType.Bit64).double(message.kind.numberValue); + /* string string_value = 3; */ + if (message.kind.oneofKind === "stringValue") + writer.tag(3, WireType.LengthDelimited).string(message.kind.stringValue); + /* bool bool_value = 4; */ + if (message.kind.oneofKind === "boolValue") + writer.tag(4, WireType.Varint).bool(message.kind.boolValue); + /* google.protobuf.Struct struct_value = 5; */ + if (message.kind.oneofKind === "structValue") + Struct.internalBinaryWrite(message.kind.structValue, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.ListValue list_value = 6; */ + if (message.kind.oneofKind === "listValue") + ListValue.internalBinaryWrite(message.kind.listValue, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - }, -}; - -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(); +/** + * @generated MessageType for protobuf message google.protobuf.Value + */ +export const Value = new Value$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ListValue$Type extends MessageType { + constructor() { + super("google.protobuf.ListValue", [ + { no: 1, name: "values", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Value } + ]); } - 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); + /** + * Encode `ListValue` to JSON array. + */ + internalJsonWrite(message: ListValue, options: JsonWriteOptions): JsonValue { + return message.values.map(v => Value.toJson(v)); } - 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; + /** + * Decode `ListValue` from JSON array. + */ + internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: ListValue): ListValue { + if (!globalThis.Array.isArray(json)) + throw new globalThis.Error("Unable to parse " + this.typeName + " from JSON " + typeofJsonValue(json)); + if (!target) + target = this.create(); + let values = json.map(v => Value.fromJson(v)); + target.values.push(...values); + return target; } - 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; + create(value?: PartialMessage): ListValue { + const message = { values: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ListValue): ListValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated google.protobuf.Value values */ 1: + message.values.push(Value.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ListValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated google.protobuf.Value values = 1; */ + for (let i = 0; i < message.values.length; i++) + Value.internalBinaryWrite(message.values[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - }, -}; - -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; } +/** + * @generated MessageType for protobuf message google.protobuf.ListValue + */ +export const ListValue = new ListValue$Type(); diff --git a/src/grpc/generated/google/protobuf/timestamp.ts b/src/grpc/generated/google/protobuf/timestamp.ts index a3fef43..d175bf4 100644 --- a/src/grpc/generated/google/protobuf/timestamp.ts +++ b/src/grpc/generated/google/protobuf/timestamp.ts @@ -1,15 +1,52 @@ -// 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"; - +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "google/protobuf/timestamp.proto" (package "google.protobuf", syntax proto3) +// tslint:disable +// +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { typeofJsonValue } from "@protobuf-ts/runtime"; +import type { JsonValue } from "@protobuf-ts/runtime"; +import type { JsonReadOptions } from "@protobuf-ts/runtime"; +import type { JsonWriteOptions } from "@protobuf-ts/runtime"; +import { PbLong } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; /** * 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 @@ -100,119 +137,151 @@ export const protobufPackage = "google.protobuf"; * 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. + * + * + * @generated from protobuf message google.protobuf.Timestamp */ 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 }; + /** + * 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. + * + * @generated from protobuf field: int64 seconds = 1; + */ + seconds: string; + /** + * 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. + * + * @generated from protobuf field: int32 nanos = 2; + */ + nanos: number; } - -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()); +// @generated message type with reflection information, may provide speed optimized methods +class Timestamp$Type extends MessageType { + constructor() { + super("google.protobuf.Timestamp", [ + { no: 1, name: "seconds", kind: "scalar", T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); + /** + * Creates a new `Timestamp` for the current time. + */ + now(): Timestamp { + const msg = this.create(); + const ms = Date.now(); + msg.seconds = PbLong.from(Math.floor(ms / 1000)).toString(); + msg.nanos = (ms % 1000) * 1000000; + return msg; } - 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; + /** + * Converts a `Timestamp` to a JavaScript Date. + */ + toDate(message: Timestamp): Date { + return new Date(PbLong.from(message.seconds).toNumber() * 1000 + Math.ceil(message.nanos / 1000000)); + } + /** + * Converts a JavaScript Date to a `Timestamp`. + */ + fromDate(date: Date): Timestamp { + const msg = this.create(); + const ms = date.getTime(); + msg.seconds = PbLong.from(Math.floor(ms / 1000)).toString(); + msg.nanos = (ms % 1000) * 1000000; + return msg; + } + /** + * In JSON format, the `Timestamp` type is encoded as a string + * in the RFC 3339 format. + */ + internalJsonWrite(message: Timestamp, options: JsonWriteOptions): JsonValue { + let ms = PbLong.from(message.seconds).toNumber() * 1000; + if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) + throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive."); + if (message.nanos < 0) + throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative."); + let z = "Z"; + if (message.nanos > 0) { + let nanosStr = (message.nanos + 1000000000).toString().substring(1); + if (nanosStr.substring(3) === "000000") + z = "." + nanosStr.substring(0, 3) + "Z"; + else if (nanosStr.substring(6) === "000") + z = "." + nanosStr.substring(0, 6) + "Z"; + else + z = "." + nanosStr + "Z"; } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return new Date(ms).toISOString().replace(".000Z", z); } - 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(); + /** + * In JSON format, the `Timestamp` type is encoded as a string + * in the RFC 3339 format. + */ + internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: Timestamp): Timestamp { + if (typeof json !== "string") + throw new Error("Unable to parse Timestamp from JSON " + typeofJsonValue(json) + "."); + let matches = json.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/); + if (!matches) + throw new Error("Unable to parse Timestamp from JSON. Invalid format."); + let ms = Date.parse(matches[1] + "-" + matches[2] + "-" + matches[3] + "T" + matches[4] + ":" + matches[5] + ":" + matches[6] + (matches[8] ? matches[8] : "Z")); + if (Number.isNaN(ms)) + throw new Error("Unable to parse Timestamp from JSON. Invalid value."); + if (ms < Date.parse("0001-01-01T00:00:00Z") || ms > Date.parse("9999-12-31T23:59:59Z")) + throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive."); + if (!target) + target = this.create(); + target.seconds = PbLong.from(ms / 1000).toString(); + target.nanos = 0; + if (matches[7]) + target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000); + return target; } - if (message.nanos !== 0) { - obj.nanos = Math.round(message.nanos); + create(value?: PartialMessage): Timestamp { + const message = { seconds: "0", nanos: 0 }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Timestamp): Timestamp { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 seconds */ 1: + message.seconds = reader.int64().toString(); + break; + case /* int32 nanos */ 2: + message.nanos = reader.int32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Timestamp, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 seconds = 1; */ + if (message.seconds !== "0") + writer.tag(1, WireType.Varint).int64(message.seconds); + /* int32 nanos = 2; */ + if (message.nanos !== 0) + writer.tag(2, WireType.Varint).int32(message.nanos); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message google.protobuf.Timestamp + */ +export const Timestamp = new Timestamp$Type(); diff --git a/src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts b/src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts index 7f1ed0b..6db810d 100644 --- a/src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts +++ b/src/grpc/generated/protoc-gen-openapiv2/options/openapiv2.ts @@ -1,71 +1,17 @@ -// 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"; +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "protoc-gen-openapiv2/options/openapiv2.proto" (package "grpc.gateway.protoc_gen_openapiv2.options", syntax proto3) +// tslint:disable +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; 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. * @@ -92,101 +38,121 @@ export function schemeToJSON(object: Scheme): string { * consumes: "application/json"; * produces: "application/json"; * }; + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Swagger */ 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; + /** + * 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". + * + * @generated from protobuf field: string swagger = 1; + */ + swagger: string; + /** + * Provides metadata about the API. The metadata can be used by the + * clients if needed. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.Info info = 2; + */ + info?: Info; + /** + * 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. + * + * @generated from protobuf field: string host = 3; + */ + 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`. + * + * @generated from protobuf field: string base_path = 4; + */ + 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. + * + * @generated from protobuf field: repeated grpc.gateway.protoc_gen_openapiv2.options.Scheme schemes = 5; + */ + 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. + * + * @generated from protobuf field: repeated string consumes = 6; + */ + 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. + * + * @generated from protobuf field: repeated string produces = 7; + */ + produces: string[]; + /** + * An object to hold responses that can be used across operations. This + * property does not define global responses for all operations. + * + * @generated from protobuf field: map responses = 10; + */ + responses: { + [key: string]: Response; + }; + /** + * Security scheme definitions that can be used across the specification. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions security_definitions = 11; + */ + securityDefinitions?: SecurityDefinitions; + /** + * 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. + * + * @generated from protobuf field: repeated grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement security = 12; + */ + 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. + * + * @generated from protobuf field: repeated grpc.gateway.protoc_gen_openapiv2.options.Tag tags = 13; + */ + tags: Tag[]; + /** + * Additional external documentation. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 14; + */ + externalDocs?: ExternalDocumentation; + /** + * 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/ + * + * @generated from protobuf field: map extensions = 15; + */ + extensions: { + [key: string]: Value; + }; } - /** * `Operation` is a representation of OpenAPI v2 specification's Operation object. * @@ -213,258 +179,295 @@ export interface Swagger_ExtensionsEntry { * }; * } * } + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Operation */ 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; + /** + * A list of tags for API documentation control. Tags can be used for logical + * grouping of operations by resources or any other qualifier. + * + * @generated from protobuf field: repeated string tags = 1; + */ + 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. + * + * @generated from protobuf field: string summary = 2; + */ + summary: string; + /** + * A verbose explanation of the operation behavior. GFM syntax can be used for + * rich text representation. + * + * @generated from protobuf field: string description = 3; + */ + description: string; + /** + * Additional external documentation for this operation. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 4; + */ + externalDocs?: ExternalDocumentation; + /** + * 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. + * + * @generated from protobuf field: string operation_id = 5; + */ + 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. + * + * @generated from protobuf field: repeated string consumes = 6; + */ + 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. + * + * @generated from protobuf field: repeated string produces = 7; + */ + produces: string[]; + /** + * The list of possible responses as they are returned from executing this + * operation. + * + * @generated from protobuf field: map responses = 9; + */ + 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. + * + * @generated from protobuf field: repeated grpc.gateway.protoc_gen_openapiv2.options.Scheme schemes = 10; + */ + schemes: Scheme[]; + /** + * Declares this operation to be deprecated. Usage of the declared operation + * should be refrained. Default value is false. + * + * @generated from protobuf field: bool deprecated = 11; + */ + 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. + * + * @generated from protobuf field: repeated grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement security = 12; + */ + 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/ + * + * @generated from protobuf field: map extensions = 13; + */ + extensions: { + [key: string]: Value; + }; + /** + * 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. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.Parameters parameters = 14; + */ + parameters?: Parameters; } - /** * `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 + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Parameters */ 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[]; + /** + * `Headers` is one or more HTTP header parameter. + * See: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters + * + * @generated from protobuf field: repeated grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter headers = 1; + */ + headers: HeaderParameter[]; } - /** * `HeaderParameter` a HTTP header parameter. * See: https://swagger.io/specification/v2/#parameter-object + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter */ 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; + /** + * `Name` is the header name. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * `Description` is a short description of the header. + * + * @generated from protobuf field: string description = 2; + */ + 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. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter.Type type = 3; + */ + type: HeaderParameter_Type; + /** + * `Format` The extending format for the previously mentioned type. + * + * @generated from protobuf field: string format = 4; + */ + format: string; + /** + * `Required` indicates if the header is optional + * + * @generated from protobuf field: bool required = 5; + */ + required: boolean; } - /** * `Type` is a supported HTTP header type. * See https://swagger.io/specification/v2/#parameterType. + * + * @generated from protobuf enum grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter.Type */ 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"; - } + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: STRING = 1; + */ + STRING = 1, + /** + * @generated from protobuf enum value: NUMBER = 2; + */ + NUMBER = 2, + /** + * @generated from protobuf enum value: INTEGER = 3; + */ + INTEGER = 3, + /** + * @generated from protobuf enum value: BOOLEAN = 4; + */ + BOOLEAN = 4 } - /** * `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 + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Header */ 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; + /** + * `Description` is a short description of the header. + * + * @generated from protobuf field: string description = 1; + */ + description: string; + /** + * The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. + * + * @generated from protobuf field: string type = 2; + */ + type: string; + /** + * `Format` The extending format for the previously mentioned type. + * + * @generated from protobuf field: string format = 3; + */ + 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. + * + * @generated from protobuf field: string default = 6; + */ + default: string; + /** + * 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. + * + * @generated from protobuf field: string pattern = 13; + */ + 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 + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Response */ 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; + /** + * `Description` is a short description of the response. + * GFM syntax can be used for rich text representation. + * + * @generated from protobuf field: string description = 1; + */ + description: string; + /** + * `Schema` optionally defines the structure of the response. + * If `Schema` is not provided, it means there is no content to the response. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.Schema schema = 2; + */ + schema?: Schema; + /** + * `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 + * + * @generated from protobuf field: map headers = 3; + */ + 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 + * + * @generated from protobuf field: map examples = 4; + */ + 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/ + * + * @generated from protobuf field: map extensions = 5; + */ + extensions: { + [key: string]: Value; + }; } - /** * `Info` is a representation of OpenAPI v2 specification's Info object. * @@ -489,43 +492,60 @@ export interface Response_ExtensionsEntry { * }; * ... * }; + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Info */ 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; + /** + * The title of the application. + * + * @generated from protobuf field: string title = 1; + */ + title: string; + /** + * A short description of the application. GFM syntax can be used for rich + * text representation. + * + * @generated from protobuf field: string description = 2; + */ + description: string; + /** + * The Terms of Service for the API. + * + * @generated from protobuf field: string terms_of_service = 3; + */ + termsOfService: string; + /** + * The contact information for the exposed API. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.Contact contact = 4; + */ + contact?: Contact; + /** + * The license information for the exposed API. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.License license = 5; + */ + license?: License; + /** + * Provides the version of the application API (not to be confused + * with the specification version). + * + * @generated from protobuf field: string version = 6; + */ + 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/ + * + * @generated from protobuf field: map extensions = 7; + */ + extensions: { + [key: string]: Value; + }; } - /** * `Contact` is a representation of OpenAPI v2 specification's Contact object. * @@ -545,22 +565,32 @@ export interface Info_ExtensionsEntry { * }; * ... * }; + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Contact */ 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; + /** + * The identifying name of the contact person/organization. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * The URL pointing to the contact information. MUST be in the format of a + * URL. + * + * @generated from protobuf field: string url = 2; + */ + url: string; + /** + * The email address of the contact person/organization. MUST be in the format + * of an email address. + * + * @generated from protobuf field: string email = 3; + */ + email: string; } - /** * `License` is a representation of OpenAPI v2 specification's License object. * @@ -579,14 +609,24 @@ export interface Contact { * }; * ... * }; + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.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; + /** + * The license name used for the API. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * A URL to the license used for the API. MUST be in the format of a URL. + * + * @generated from protobuf field: string url = 2; + */ + url: string; } - /** * `ExternalDocumentation` is a representation of OpenAPI v2 specification's * ExternalDocumentation object. @@ -603,56 +643,73 @@ export interface License { * } * ... * }; + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation */ 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; + /** + * A short description of the target documentation. GFM syntax can be used for + * rich text representation. + * + * @generated from protobuf field: string description = 1; + */ + description: string; + /** + * The URL for the target documentation. Value MUST be in the format + * of a URL. + * + * @generated from protobuf field: string url = 2; + */ + 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 + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Schema */ 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; + /** + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.JSONSchema json_schema = 1; + */ + jsonSchema?: JSONSchema; + /** + * 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. + * + * @generated from protobuf field: string discriminator = 2; + */ + 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. + * + * @generated from protobuf field: bool read_only = 3; + */ + readOnly: boolean; + /** + * Additional external documentation for this schema. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 5; + */ + externalDocs?: ExternalDocumentation; + /** + * A free-form property to include an example of an instance for this schema in JSON. + * This is copied verbatim to the output. + * + * @generated from protobuf field: string example = 6; + */ + example: string; } - /** * `EnumSchema` is subset of fields from the OpenAPI v2 specification's Schema object. * Only fields that are applicable to Enums are included @@ -668,40 +725,67 @@ export interface Schema { * required: true; * ... * }; + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.EnumSchema */ 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; + /** + * A short description of the schema. + * + * @generated from protobuf field: string description = 1; + */ + description: string; + /** + * @generated from protobuf field: string default = 2; + */ + default: string; + /** + * The title of the schema. + * + * @generated from protobuf field: string title = 3; + */ + title: string; + /** + * @generated from protobuf field: bool required = 4; + */ + required: boolean; + /** + * @generated from protobuf field: bool read_only = 5; + */ + readOnly: boolean; + /** + * Additional external documentation for this schema. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 6; + */ + externalDocs?: ExternalDocumentation; + /** + * @generated from protobuf field: string example = 7; + */ + 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"`. + * + * @generated from protobuf field: string ref = 8; + */ + 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/ + * + * @generated from protobuf field: map extensions = 9; + */ + extensions: { + [key: string]: Value; + }; } - /** * `JSONSchema` represents properties from JSON Schema taken, and as used, in * the OpenAPI v2 spec. @@ -730,192 +814,246 @@ export interface EnumSchema_ExtensionsEntry { * description: "The unique identifier of the simple message." * }]; * } + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.JSONSchema */ 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"; - } + /** + * 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"`. + * + * @generated from protobuf field: string ref = 3; + */ + ref: string; + /** + * The title of the schema. + * + * @generated from protobuf field: string title = 5; + */ + title: string; + /** + * A short description of the schema. + * + * @generated from protobuf field: string description = 6; + */ + description: string; + /** + * @generated from protobuf field: string default = 7; + */ + default: string; + /** + * @generated from protobuf field: bool read_only = 8; + */ + 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 + * + * @generated from protobuf field: string example = 9; + */ + example: string; + /** + * @generated from protobuf field: double multiple_of = 10; + */ + multipleOf: number; + /** + * Maximum represents an inclusive upper limit for a numeric instance. The + * value of MUST be a number, + * + * @generated from protobuf field: double maximum = 11; + */ + maximum: number; + /** + * @generated from protobuf field: bool exclusive_maximum = 12; + */ + exclusiveMaximum: boolean; + /** + * minimum represents an inclusive lower limit for a numeric instance. The + * value of MUST be a number, + * + * @generated from protobuf field: double minimum = 13; + */ + minimum: number; + /** + * @generated from protobuf field: bool exclusive_minimum = 14; + */ + exclusiveMinimum: boolean; + /** + * @generated from protobuf field: uint64 max_length = 15; + */ + maxLength: string; + /** + * @generated from protobuf field: uint64 min_length = 16; + */ + minLength: string; + /** + * @generated from protobuf field: string pattern = 17; + */ + pattern: string; + /** + * @generated from protobuf field: uint64 max_items = 20; + */ + maxItems: string; + /** + * @generated from protobuf field: uint64 min_items = 21; + */ + minItems: string; + /** + * @generated from protobuf field: bool unique_items = 22; + */ + uniqueItems: boolean; + /** + * @generated from protobuf field: uint64 max_properties = 24; + */ + maxProperties: string; + /** + * @generated from protobuf field: uint64 min_properties = 25; + */ + minProperties: string; + /** + * @generated from protobuf field: repeated string required = 26; + */ + required: string[]; + /** + * Items in 'array' must be unique. + * + * @generated from protobuf field: repeated string array = 34; + */ + array: string[]; + /** + * @generated from protobuf field: repeated grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes type = 35; + */ + type: JSONSchema_JSONSchemaSimpleTypes[]; + /** + * `Format` + * + * @generated from protobuf field: string format = 36; + */ + format: string; + /** + * Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 + * + * @generated from protobuf field: repeated string enum = 46; + */ + enum: string[]; + /** + * Additional field level properties used when generating the OpenAPI v2 file. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration field_configuration = 1001; + */ + fieldConfiguration?: JSONSchema_FieldConfiguration; + /** + * 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/ + * + * @generated from protobuf field: map extensions = 48; + */ + extensions: { + [key: string]: Value; + }; } - /** * '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. + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration */ 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; + /** + * 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. + * + * @generated from protobuf field: string path_param_name = 47; + */ + pathParamName: string; } - -export interface JSONSchema_ExtensionsEntry { - key: string; - value: any | undefined; +/** + * @generated from protobuf enum grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes + */ +export enum JSONSchema_JSONSchemaSimpleTypes { + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: ARRAY = 1; + */ + ARRAY = 1, + /** + * @generated from protobuf enum value: BOOLEAN = 2; + */ + BOOLEAN = 2, + /** + * @generated from protobuf enum value: INTEGER = 3; + */ + INTEGER = 3, + /** + * @generated from protobuf enum value: NULL = 4; + */ + NULL = 4, + /** + * @generated from protobuf enum value: NUMBER = 5; + */ + NUMBER = 5, + /** + * @generated from protobuf enum value: OBJECT = 6; + */ + OBJECT = 6, + /** + * @generated from protobuf enum value: STRING = 7; + */ + STRING = 7 } - /** * `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 + * + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Tag */ 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; + /** + * 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. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * A short description for the tag. GFM syntax can be used for rich text + * representation. + * + * @generated from protobuf field: string description = 2; + */ + description: string; + /** + * Additional external documentation for this tag. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 3; + */ + externalDocs?: ExternalDocumentation; + /** + * 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/ + * + * @generated from protobuf field: map extensions = 4; + */ + extensions: { + [key: string]: Value; + }; } - /** * `SecurityDefinitions` is a representation of OpenAPI v2 specification's * Security Definitions object. @@ -925,20 +1063,20 @@ export interface Tag_ExtensionsEntry { * 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. + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions */ 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; + /** + * A single security scheme definition, mapping a "name" to the scheme it + * defines. + * + * @generated from protobuf field: map security = 1; + */ + security: { + [key: string]: SecurityScheme; + }; } - /** * `SecurityScheme` is a representation of OpenAPI v2 specification's * Security Scheme object. @@ -949,208 +1087,151 @@ export interface SecurityDefinitions_SecurityEntry { * 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). + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme */ 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". + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type type = 1; + */ + type: SecurityScheme_Type; + /** + * A short description for security scheme. + * + * @generated from protobuf field: string description = 2; + */ + description: string; + /** + * The name of the header or query parameter to be used. + * Valid for apiKey. + * + * @generated from protobuf field: string name = 3; + */ + name: string; + /** + * The location of the API key. Valid values are "query" or + * "header". + * Valid for apiKey. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In in = 4; + */ + in: SecurityScheme_In; + /** + * The flow used by the OAuth2 security scheme. Valid values are + * "implicit", "password", "application" or "accessCode". + * Valid for oauth2. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow flow = 5; + */ + 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. + * + * @generated from protobuf field: string authorization_url = 6; + */ + 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. + * + * @generated from protobuf field: string token_url = 7; + */ + tokenUrl: string; + /** + * The available scopes for the OAuth2 security scheme. + * Valid for oauth2. + * + * @generated from protobuf field: grpc.gateway.protoc_gen_openapiv2.options.Scopes scopes = 8; + */ + scopes?: Scopes; + /** + * 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/ + * + * @generated from protobuf field: map extensions = 9; + */ + extensions: { + [key: string]: Value; + }; } - /** * The type of the security scheme. Valid values are "basic", * "apiKey" or "oauth2". + * + * @generated from protobuf enum grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type */ 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; - } + /** + * @generated from protobuf enum value: TYPE_INVALID = 0; + */ + INVALID = 0, + /** + * @generated from protobuf enum value: TYPE_BASIC = 1; + */ + BASIC = 1, + /** + * @generated from protobuf enum value: TYPE_API_KEY = 2; + */ + API_KEY = 2, + /** + * @generated from protobuf enum value: TYPE_OAUTH2 = 3; + */ + OAUTH2 = 3 } - -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". */ +/** + * The location of the API key. Valid values are "query" or "header". + * + * @generated from protobuf enum grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In + */ export enum SecurityScheme_In { - IN_INVALID = 0, - IN_QUERY = 1, - IN_HEADER = 2, - UNRECOGNIZED = -1, + /** + * @generated from protobuf enum value: IN_INVALID = 0; + */ + INVALID = 0, + /** + * @generated from protobuf enum value: IN_QUERY = 1; + */ + QUERY = 1, + /** + * @generated from protobuf enum value: IN_HEADER = 2; + */ + HEADER = 2 } - -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". + * + * @generated from protobuf enum grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow */ 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; - } + /** + * @generated from protobuf enum value: FLOW_INVALID = 0; + */ + INVALID = 0, + /** + * @generated from protobuf enum value: FLOW_IMPLICIT = 1; + */ + IMPLICIT = 1, + /** + * @generated from protobuf enum value: FLOW_PASSWORD = 2; + */ + PASSWORD = 2, + /** + * @generated from protobuf enum value: FLOW_APPLICATION = 3; + */ + APPLICATION = 3, + /** + * @generated from protobuf enum value: FLOW_ACCESS_CODE = 4; + */ + ACCESS_CODE = 4 } - -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. @@ -1163,4444 +1244,1994 @@ export interface SecurityScheme_ExtensionsEntry { * * The name used for each property MUST correspond to a security scheme * declared in the Security Definitions. + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement */ 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 }; + /** + * 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. + * + * @generated from protobuf field: map security_requirement = 1; + */ + 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. + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue */ export interface SecurityRequirement_SecurityRequirementValue { - scope: string[]; -} - -export interface SecurityRequirement_SecurityRequirementEntry { - key: string; - value: SecurityRequirement_SecurityRequirementValue | undefined; + /** + * @generated from protobuf field: repeated string scope = 1; + */ + scope: string[]; } - /** * `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. + * + * @generated from protobuf message grpc.gateway.protoc_gen_openapiv2.options.Scopes */ 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: {}, - }; + /** + * Maps between a name of a scope to a short description of it (as the value + * of the property). + * + * @generated from protobuf field: map scope = 1; + */ + scope: { + [key: string]: string; + }; } - -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; +/** + * Scheme describes the schemes supported by the OpenAPI Swagger + * and Operation objects. + * + * @generated from protobuf enum grpc.gateway.protoc_gen_openapiv2.options.Scheme + */ +export enum Scheme { + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * @generated from protobuf enum value: HTTP = 1; + */ + HTTP = 1, + /** + * @generated from protobuf enum value: HTTPS = 2; + */ + HTTPS = 2, + /** + * @generated from protobuf enum value: WS = 3; + */ + WS = 3, + /** + * @generated from protobuf enum value: WSS = 4; + */ + WSS = 4 +} +// @generated message type with reflection information, may provide speed optimized methods +class Swagger$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Swagger", [ + { no: 1, name: "swagger", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "info", kind: "message", T: () => Info }, + { no: 3, name: "host", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "base_path", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "schemes", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["grpc.gateway.protoc_gen_openapiv2.options.Scheme", Scheme] }, + { no: 6, name: "consumes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "produces", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "responses", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Response } }, + { no: 11, name: "security_definitions", kind: "message", T: () => SecurityDefinitions }, + { no: 12, name: "security", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SecurityRequirement }, + { no: 13, name: "tags", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Tag }, + { no: 14, name: "external_docs", kind: "message", T: () => ExternalDocumentation }, + { no: 15, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); + } + create(value?: PartialMessage): Swagger { + const message = { swagger: "", host: "", basePath: "", schemes: [], consumes: [], produces: [], responses: {}, security: [], tags: [], extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Swagger): Swagger { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string swagger */ 1: + message.swagger = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.Info info */ 2: + message.info = Info.internalBinaryRead(reader, reader.uint32(), options, message.info); + break; + case /* string host */ 3: + message.host = reader.string(); + break; + case /* string base_path */ 4: + message.basePath = reader.string(); + break; + case /* repeated grpc.gateway.protoc_gen_openapiv2.options.Scheme schemes */ 5: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.schemes.push(reader.int32()); + else + message.schemes.push(reader.int32()); + break; + case /* repeated string consumes */ 6: + message.consumes.push(reader.string()); + break; + case /* repeated string produces */ 7: + message.produces.push(reader.string()); + break; + case /* map responses */ 10: + this.binaryReadMap10(message.responses, reader, options); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions security_definitions */ 11: + message.securityDefinitions = SecurityDefinitions.internalBinaryRead(reader, reader.uint32(), options, message.securityDefinitions); + break; + case /* repeated grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement security */ 12: + message.security.push(SecurityRequirement.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated grpc.gateway.protoc_gen_openapiv2.options.Tag tags */ 13: + message.tags.push(Tag.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs */ 14: + message.externalDocs = ExternalDocumentation.internalBinaryRead(reader, reader.uint32(), options, message.externalDocs); + break; + case /* map extensions */ 15: + this.binaryReadMap15(message.extensions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 2: { - if (tag !== 18) { - break; - } - - message.info = Info.decode(reader, reader.uint32()); - continue; + return message; + } + private binaryReadMap10(map: Swagger["responses"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Swagger["responses"] | undefined, val: Swagger["responses"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Response.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Swagger.responses"); + } } - case 3: { - if (tag !== 26) { - break; - } - - message.host = reader.string(); - continue; + map[key ?? ""] = val ?? Response.create(); + } + private binaryReadMap15(map: Swagger["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Swagger["extensions"] | undefined, val: Swagger["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Swagger.extensions"); + } } - case 4: { - if (tag !== 34) { - break; - } - - message.basePath = reader.string(); - continue; + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: Swagger, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string swagger = 1; */ + if (message.swagger !== "") + writer.tag(1, WireType.LengthDelimited).string(message.swagger); + /* grpc.gateway.protoc_gen_openapiv2.options.Info info = 2; */ + if (message.info) + Info.internalBinaryWrite(message.info, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string host = 3; */ + if (message.host !== "") + writer.tag(3, WireType.LengthDelimited).string(message.host); + /* string base_path = 4; */ + if (message.basePath !== "") + writer.tag(4, WireType.LengthDelimited).string(message.basePath); + /* repeated grpc.gateway.protoc_gen_openapiv2.options.Scheme schemes = 5; */ + if (message.schemes.length) { + writer.tag(5, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.schemes.length; i++) + writer.int32(message.schemes[i]); + writer.join(); + } + /* repeated string consumes = 6; */ + for (let i = 0; i < message.consumes.length; i++) + writer.tag(6, WireType.LengthDelimited).string(message.consumes[i]); + /* repeated string produces = 7; */ + for (let i = 0; i < message.produces.length; i++) + writer.tag(7, WireType.LengthDelimited).string(message.produces[i]); + /* map responses = 10; */ + for (let k of Object.keys(message.responses)) { + writer.tag(10, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Response.internalBinaryWrite(message.responses[k], writer, options); + writer.join().join(); + } + /* grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions security_definitions = 11; */ + if (message.securityDefinitions) + SecurityDefinitions.internalBinaryWrite(message.securityDefinitions, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + /* repeated grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement security = 12; */ + for (let i = 0; i < message.security.length; i++) + SecurityRequirement.internalBinaryWrite(message.security[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + /* repeated grpc.gateway.protoc_gen_openapiv2.options.Tag tags = 13; */ + for (let i = 0; i < message.tags.length; i++) + Tag.internalBinaryWrite(message.tags[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join(); + /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 14; */ + if (message.externalDocs) + ExternalDocumentation.internalBinaryWrite(message.externalDocs, writer.tag(14, WireType.LengthDelimited).fork(), options).join(); + /* map extensions = 15; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(15, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Swagger + */ +export const Swagger = new Swagger$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Operation$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Operation", [ + { no: 1, name: "tags", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "summary", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "external_docs", kind: "message", T: () => ExternalDocumentation }, + { no: 5, name: "operation_id", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "consumes", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "produces", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "responses", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Response } }, + { no: 10, name: "schemes", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["grpc.gateway.protoc_gen_openapiv2.options.Scheme", Scheme] }, + { no: 11, name: "deprecated", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 12, name: "security", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SecurityRequirement }, + { no: 13, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } }, + { no: 14, name: "parameters", kind: "message", T: () => Parameters } + ]); + } + create(value?: PartialMessage): Operation { + const message = { tags: [], summary: "", description: "", operationId: "", consumes: [], produces: [], responses: {}, schemes: [], deprecated: false, security: [], extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Operation): Operation { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string tags */ 1: + message.tags.push(reader.string()); + break; + case /* string summary */ 2: + message.summary = reader.string(); + break; + case /* string description */ 3: + message.description = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs */ 4: + message.externalDocs = ExternalDocumentation.internalBinaryRead(reader, reader.uint32(), options, message.externalDocs); + break; + case /* string operation_id */ 5: + message.operationId = reader.string(); + break; + case /* repeated string consumes */ 6: + message.consumes.push(reader.string()); + break; + case /* repeated string produces */ 7: + message.produces.push(reader.string()); + break; + case /* map responses */ 9: + this.binaryReadMap9(message.responses, reader, options); + break; + case /* repeated grpc.gateway.protoc_gen_openapiv2.options.Scheme schemes */ 10: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.schemes.push(reader.int32()); + else + message.schemes.push(reader.int32()); + break; + case /* bool deprecated */ 11: + message.deprecated = reader.bool(); + break; + case /* repeated grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement security */ 12: + message.security.push(SecurityRequirement.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* map extensions */ 13: + this.binaryReadMap13(message.extensions, reader, options); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.Parameters parameters */ 14: + message.parameters = Parameters.internalBinaryRead(reader, reader.uint32(), options, message.parameters); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - 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); + return message; + } + private binaryReadMap9(map: Operation["responses"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Operation["responses"] | undefined, val: Operation["responses"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Response.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Operation.responses"); } - - continue; - } - - break; } - case 6: { - if (tag !== 50) { - break; - } - - message.consumes.push(reader.string()); - continue; + map[key ?? ""] = val ?? Response.create(); + } + private binaryReadMap13(map: Operation["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Operation["extensions"] | undefined, val: Operation["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Operation.extensions"); + } } - case 7: { - if (tag !== 58) { - break; - } - - message.produces.push(reader.string()); - continue; + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: Operation, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string tags = 1; */ + for (let i = 0; i < message.tags.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.tags[i]); + /* string summary = 2; */ + if (message.summary !== "") + writer.tag(2, WireType.LengthDelimited).string(message.summary); + /* string description = 3; */ + if (message.description !== "") + writer.tag(3, WireType.LengthDelimited).string(message.description); + /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 4; */ + if (message.externalDocs) + ExternalDocumentation.internalBinaryWrite(message.externalDocs, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* string operation_id = 5; */ + if (message.operationId !== "") + writer.tag(5, WireType.LengthDelimited).string(message.operationId); + /* repeated string consumes = 6; */ + for (let i = 0; i < message.consumes.length; i++) + writer.tag(6, WireType.LengthDelimited).string(message.consumes[i]); + /* repeated string produces = 7; */ + for (let i = 0; i < message.produces.length; i++) + writer.tag(7, WireType.LengthDelimited).string(message.produces[i]); + /* map responses = 9; */ + for (let k of Object.keys(message.responses)) { + writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Response.internalBinaryWrite(message.responses[k], writer, options); + writer.join().join(); + } + /* repeated grpc.gateway.protoc_gen_openapiv2.options.Scheme schemes = 10; */ + if (message.schemes.length) { + writer.tag(10, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.schemes.length; i++) + writer.int32(message.schemes[i]); + writer.join(); + } + /* bool deprecated = 11; */ + if (message.deprecated !== false) + writer.tag(11, WireType.Varint).bool(message.deprecated); + /* repeated grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement security = 12; */ + for (let i = 0; i < message.security.length; i++) + SecurityRequirement.internalBinaryWrite(message.security[i], writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + /* map extensions = 13; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(13, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + /* grpc.gateway.protoc_gen_openapiv2.options.Parameters parameters = 14; */ + if (message.parameters) + Parameters.internalBinaryWrite(message.parameters, writer.tag(14, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Operation + */ +export const Operation = new Operation$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Parameters$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Parameters", [ + { no: 1, name: "headers", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => HeaderParameter } + ]); + } + create(value?: PartialMessage): Parameters { + const message = { headers: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Parameters): Parameters { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter headers */ 1: + message.headers.push(HeaderParameter.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - 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; + return message; + } + internalBinaryWrite(message: Parameters, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter headers = 1; */ + for (let i = 0; i < message.headers.length; i++) + HeaderParameter.internalBinaryWrite(message.headers[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Parameters + */ +export const Parameters = new Parameters$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class HeaderParameter$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "type", kind: "enum", T: () => ["grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter.Type", HeaderParameter_Type] }, + { no: 4, name: "format", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): HeaderParameter { + const message = { name: "", description: "", type: 0, format: "", required: false }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HeaderParameter): HeaderParameter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* string description */ 2: + message.description = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter.Type type */ 3: + message.type = reader.int32(); + break; + case /* string format */ 4: + message.format = reader.string(); + break; + case /* bool required */ 5: + message.required = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 11: { - if (tag !== 90) { - break; - } - - message.securityDefinitions = SecurityDefinitions.decode(reader, reader.uint32()); - continue; + return message; + } + internalBinaryWrite(message: HeaderParameter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string description = 2; */ + if (message.description !== "") + writer.tag(2, WireType.LengthDelimited).string(message.description); + /* grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter.Type type = 3; */ + if (message.type !== 0) + writer.tag(3, WireType.Varint).int32(message.type); + /* string format = 4; */ + if (message.format !== "") + writer.tag(4, WireType.LengthDelimited).string(message.format); + /* bool required = 5; */ + if (message.required !== false) + writer.tag(5, WireType.Varint).bool(message.required); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.HeaderParameter + */ +export const HeaderParameter = new HeaderParameter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Header$Type extends MessageType
{ + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Header", [ + { no: 1, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "format", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "default", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 13, name: "pattern", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage
): Header { + const message = { description: "", type: "", format: "", default: "", pattern: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial
(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Header): Header { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string description */ 1: + message.description = reader.string(); + break; + case /* string type */ 2: + message.type = reader.string(); + break; + case /* string format */ 3: + message.format = reader.string(); + break; + case /* string default */ 6: + message.default = reader.string(); + break; + case /* string pattern */ 13: + message.pattern = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 12: { - if (tag !== 98) { - break; - } - - message.security.push(SecurityRequirement.decode(reader, reader.uint32())); - continue; + return message; + } + internalBinaryWrite(message: Header, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string description = 1; */ + if (message.description !== "") + writer.tag(1, WireType.LengthDelimited).string(message.description); + /* string type = 2; */ + if (message.type !== "") + writer.tag(2, WireType.LengthDelimited).string(message.type); + /* string format = 3; */ + if (message.format !== "") + writer.tag(3, WireType.LengthDelimited).string(message.format); + /* string default = 6; */ + if (message.default !== "") + writer.tag(6, WireType.LengthDelimited).string(message.default); + /* string pattern = 13; */ + if (message.pattern !== "") + writer.tag(13, WireType.LengthDelimited).string(message.pattern); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Header + */ +export const Header = new Header$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Response$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Response", [ + { no: 1, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "schema", kind: "message", T: () => Schema }, + { no: 3, name: "headers", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Header } }, + { no: 4, name: "examples", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } }, + { no: 5, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); + } + create(value?: PartialMessage): Response { + const message = { description: "", headers: {}, examples: {}, extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Response): Response { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string description */ 1: + message.description = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.Schema schema */ 2: + message.schema = Schema.internalBinaryRead(reader, reader.uint32(), options, message.schema); + break; + case /* map headers */ 3: + this.binaryReadMap3(message.headers, reader, options); + break; + case /* map examples */ 4: + this.binaryReadMap4(message.examples, reader, options); + break; + case /* map extensions */ 5: + this.binaryReadMap5(message.extensions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 13: { - if (tag !== 106) { - break; - } - - message.tags.push(Tag.decode(reader, reader.uint32())); - continue; + return message; + } + private binaryReadMap3(map: Response["headers"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Response["headers"] | undefined, val: Response["headers"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Header.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Response.headers"); + } } - case 14: { - if (tag !== 114) { - break; - } - - message.externalDocs = ExternalDocumentation.decode(reader, reader.uint32()); - continue; + map[key ?? ""] = val ?? Header.create(); + } + private binaryReadMap4(map: Response["examples"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Response["examples"] | undefined, val: Response["examples"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Response.examples"); + } } - 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; + map[key ?? ""] = val ?? ""; + } + private binaryReadMap5(map: Response["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Response["extensions"] | undefined, val: Response["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Response.extensions"); + } } - } - 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; + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: Response, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string description = 1; */ + if (message.description !== "") + writer.tag(1, WireType.LengthDelimited).string(message.description); + /* grpc.gateway.protoc_gen_openapiv2.options.Schema schema = 2; */ + if (message.schema) + Schema.internalBinaryWrite(message.schema, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* map headers = 3; */ + for (let k of Object.keys(message.headers)) { + writer.tag(3, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Header.internalBinaryWrite(message.headers[k], writer, options); + writer.join().join(); + } + /* map examples = 4; */ + for (let k of Object.keys(message.examples)) + writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.examples[k]).join(); + /* map extensions = 5; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(5, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Response + */ +export const Response = new Response$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Info$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Info", [ + { no: 1, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "terms_of_service", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "contact", kind: "message", T: () => Contact }, + { no: 5, name: "license", kind: "message", T: () => License }, + { no: 6, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); + } + create(value?: PartialMessage): Info { + const message = { title: "", description: "", termsOfService: "", version: "", extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Info): Info { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string title */ 1: + message.title = reader.string(); + break; + case /* string description */ 2: + message.description = reader.string(); + break; + case /* string terms_of_service */ 3: + message.termsOfService = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.Contact contact */ 4: + message.contact = Contact.internalBinaryRead(reader, reader.uint32(), options, message.contact); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.License license */ 5: + message.license = License.internalBinaryRead(reader, reader.uint32(), options, message.license); + break; + case /* string version */ 6: + message.version = reader.string(); + break; + case /* map extensions */ 7: + this.binaryReadMap7(message.extensions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + private binaryReadMap7(map: Info["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Info["extensions"] | undefined, val: Info["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Info.extensions"); + } + } + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: Info, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string title = 1; */ + if (message.title !== "") + writer.tag(1, WireType.LengthDelimited).string(message.title); + /* string description = 2; */ + if (message.description !== "") + writer.tag(2, WireType.LengthDelimited).string(message.description); + /* string terms_of_service = 3; */ + if (message.termsOfService !== "") + writer.tag(3, WireType.LengthDelimited).string(message.termsOfService); + /* grpc.gateway.protoc_gen_openapiv2.options.Contact contact = 4; */ + if (message.contact) + Contact.internalBinaryWrite(message.contact, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* grpc.gateway.protoc_gen_openapiv2.options.License license = 5; */ + if (message.license) + License.internalBinaryWrite(message.license, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* string version = 6; */ + if (message.version !== "") + writer.tag(6, WireType.LengthDelimited).string(message.version); + /* map extensions = 7; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(7, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); - }); - } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Info + */ +export const Info = new Info$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Contact$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Contact", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "email", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Contact { + const message = { name: "", url: "", email: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Contact): Contact { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* string url */ 2: + message.url = reader.string(); + break; + case /* string email */ 3: + message.email = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.securityDefinitions !== undefined) { - obj.securityDefinitions = SecurityDefinitions.toJSON(message.securityDefinitions); + internalBinaryWrite(message: Contact, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string url = 2; */ + if (message.url !== "") + writer.tag(2, WireType.LengthDelimited).string(message.url); + /* string email = 3; */ + if (message.email !== "") + writer.tag(3, WireType.LengthDelimited).string(message.email); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.security?.length) { - obj.security = message.security.map((e) => SecurityRequirement.toJSON(e)); +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Contact + */ +export const Contact = new Contact$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class License$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.License", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): License { + const message = { name: "", url: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: License): License { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* string url */ 2: + message.url = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.tags?.length) { - obj.tags = message.tags.map((e) => Tag.toJSON(e)); + internalBinaryWrite(message: License, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string url = 2; */ + if (message.url !== "") + writer.tag(2, WireType.LengthDelimited).string(message.url); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.externalDocs !== undefined) { - obj.externalDocs = ExternalDocumentation.toJSON(message.externalDocs); +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.License + */ +export const License = new License$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ExternalDocumentation$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation", [ + { no: 1, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "url", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ExternalDocumentation { + const message = { description: "", url: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ExternalDocumentation): ExternalDocumentation { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string description */ 1: + message.description = reader.string(); + break; + case /* string url */ 2: + message.url = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.extensions) { - const entries = Object.entries(message.extensions); - if (entries.length > 0) { - obj.extensions = {}; - entries.forEach(([k, v]) => { - obj.extensions[k] = v; - }); - } + internalBinaryWrite(message: ExternalDocumentation, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string description = 1; */ + if (message.description !== "") + writer.tag(1, WireType.LengthDelimited).string(message.description); + /* string url = 2; */ + if (message.url !== "") + writer.tag(2, WireType.LengthDelimited).string(message.url); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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(); +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation + */ +export const ExternalDocumentation = new ExternalDocumentation$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Schema$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Schema", [ + { no: 1, name: "json_schema", kind: "message", T: () => JSONSchema }, + { no: 2, name: "discriminator", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "read_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "external_docs", kind: "message", T: () => ExternalDocumentation }, + { no: 6, name: "example", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Schema { + const message = { discriminator: "", readOnly: false, example: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Schema): Schema { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* grpc.gateway.protoc_gen_openapiv2.options.JSONSchema json_schema */ 1: + message.jsonSchema = JSONSchema.internalBinaryRead(reader, reader.uint32(), options, message.jsonSchema); + break; + case /* string discriminator */ 2: + message.discriminator = reader.string(); + break; + case /* bool read_only */ 3: + message.readOnly = reader.bool(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs */ 5: + message.externalDocs = ExternalDocumentation.internalBinaryRead(reader, reader.uint32(), options, message.externalDocs); + break; + case /* string example */ 6: + message.example = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Schema, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* grpc.gateway.protoc_gen_openapiv2.options.JSONSchema json_schema = 1; */ + if (message.jsonSchema) + JSONSchema.internalBinaryWrite(message.jsonSchema, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string discriminator = 2; */ + if (message.discriminator !== "") + writer.tag(2, WireType.LengthDelimited).string(message.discriminator); + /* bool read_only = 3; */ + if (message.readOnly !== false) + writer.tag(3, WireType.Varint).bool(message.readOnly); + /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 5; */ + if (message.externalDocs) + ExternalDocumentation.internalBinaryWrite(message.externalDocs, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* string example = 6; */ + if (message.example !== "") + writer.tag(6, WireType.LengthDelimited).string(message.example); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Schema + */ +export const Schema = new Schema$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumSchema$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.EnumSchema", [ + { no: 1, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "default", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "required", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "read_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "external_docs", kind: "message", T: () => ExternalDocumentation }, + { no: 7, name: "example", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "ref", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); + } + create(value?: PartialMessage): EnumSchema { + const message = { description: "", default: "", title: "", required: false, readOnly: false, example: "", ref: "", extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumSchema): EnumSchema { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string description */ 1: + message.description = reader.string(); + break; + case /* string default */ 2: + message.default = reader.string(); + break; + case /* string title */ 3: + message.title = reader.string(); + break; + case /* bool required */ 4: + message.required = reader.bool(); + break; + case /* bool read_only */ 5: + message.readOnly = reader.bool(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs */ 6: + message.externalDocs = ExternalDocumentation.internalBinaryRead(reader, reader.uint32(), options, message.externalDocs); + break; + case /* string example */ 7: + message.example = reader.string(); + break; + case /* string ref */ 8: + message.ref = reader.string(); + break; + case /* map extensions */ 9: + this.binaryReadMap9(message.extensions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Response.decode(reader, reader.uint32()); - continue; + return message; + } + private binaryReadMap9(map: EnumSchema["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof EnumSchema["extensions"] | undefined, val: EnumSchema["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.EnumSchema.extensions"); + } } - } - 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); + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: EnumSchema, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string description = 1; */ + if (message.description !== "") + writer.tag(1, WireType.LengthDelimited).string(message.description); + /* string default = 2; */ + if (message.default !== "") + writer.tag(2, WireType.LengthDelimited).string(message.default); + /* string title = 3; */ + if (message.title !== "") + writer.tag(3, WireType.LengthDelimited).string(message.title); + /* bool required = 4; */ + if (message.required !== false) + writer.tag(4, WireType.Varint).bool(message.required); + /* bool read_only = 5; */ + if (message.readOnly !== false) + writer.tag(5, WireType.Varint).bool(message.readOnly); + /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 6; */ + if (message.externalDocs) + ExternalDocumentation.internalBinaryWrite(message.externalDocs, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* string example = 7; */ + if (message.example !== "") + writer.tag(7, WireType.LengthDelimited).string(message.example); + /* string ref = 8; */ + if (message.ref !== "") + writer.tag(8, WireType.LengthDelimited).string(message.ref); + /* map extensions = 9; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.EnumSchema + */ +export const EnumSchema = new EnumSchema$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class JSONSchema$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.JSONSchema", [ + { no: 3, name: "ref", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "title", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "default", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "read_only", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "example", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "multiple_of", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 11, name: "maximum", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 12, name: "exclusive_maximum", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 13, name: "minimum", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ }, + { no: 14, name: "exclusive_minimum", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 15, name: "max_length", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 16, name: "min_length", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 17, name: "pattern", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 20, name: "max_items", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 21, name: "min_items", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 22, name: "unique_items", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 24, name: "max_properties", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 25, name: "min_properties", kind: "scalar", T: 4 /*ScalarType.UINT64*/ }, + { no: 26, name: "required", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 34, name: "array", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 35, name: "type", kind: "enum", repeat: 1 /*RepeatType.PACKED*/, T: () => ["grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes", JSONSchema_JSONSchemaSimpleTypes] }, + { no: 36, name: "format", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 46, name: "enum", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 1001, name: "field_configuration", kind: "message", T: () => JSONSchema_FieldConfiguration }, + { no: 48, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); + } + create(value?: PartialMessage): JSONSchema { + const message = { ref: "", title: "", description: "", default: "", readOnly: false, example: "", multipleOf: 0, maximum: 0, exclusiveMaximum: false, minimum: 0, exclusiveMinimum: false, maxLength: "0", minLength: "0", pattern: "", maxItems: "0", minItems: "0", uniqueItems: false, maxProperties: "0", minProperties: "0", required: [], array: [], type: [], format: "", enum: [], extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JSONSchema): JSONSchema { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string ref */ 3: + message.ref = reader.string(); + break; + case /* string title */ 5: + message.title = reader.string(); + break; + case /* string description */ 6: + message.description = reader.string(); + break; + case /* string default */ 7: + message.default = reader.string(); + break; + case /* bool read_only */ 8: + message.readOnly = reader.bool(); + break; + case /* string example */ 9: + message.example = reader.string(); + break; + case /* double multiple_of */ 10: + message.multipleOf = reader.double(); + break; + case /* double maximum */ 11: + message.maximum = reader.double(); + break; + case /* bool exclusive_maximum */ 12: + message.exclusiveMaximum = reader.bool(); + break; + case /* double minimum */ 13: + message.minimum = reader.double(); + break; + case /* bool exclusive_minimum */ 14: + message.exclusiveMinimum = reader.bool(); + break; + case /* uint64 max_length */ 15: + message.maxLength = reader.uint64().toString(); + break; + case /* uint64 min_length */ 16: + message.minLength = reader.uint64().toString(); + break; + case /* string pattern */ 17: + message.pattern = reader.string(); + break; + case /* uint64 max_items */ 20: + message.maxItems = reader.uint64().toString(); + break; + case /* uint64 min_items */ 21: + message.minItems = reader.uint64().toString(); + break; + case /* bool unique_items */ 22: + message.uniqueItems = reader.bool(); + break; + case /* uint64 max_properties */ 24: + message.maxProperties = reader.uint64().toString(); + break; + case /* uint64 min_properties */ 25: + message.minProperties = reader.uint64().toString(); + break; + case /* repeated string required */ 26: + message.required.push(reader.string()); + break; + case /* repeated string array */ 34: + message.array.push(reader.string()); + break; + case /* repeated grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes type */ 35: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.type.push(reader.int32()); + else + message.type.push(reader.int32()); + break; + case /* string format */ 36: + message.format = reader.string(); + break; + case /* repeated string enum */ 46: + message.enum.push(reader.string()); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration field_configuration */ 1001: + message.fieldConfiguration = JSONSchema_FieldConfiguration.internalBinaryRead(reader, reader.uint32(), options, message.fieldConfiguration); + break; + case /* map extensions */ 48: + this.binaryReadMap48(message.extensions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 2: { - if (tag !== 18) { - break; - } - - message.value = Value.unwrap(Value.decode(reader, reader.uint32())); - continue; + return message; + } + private binaryReadMap48(map: JSONSchema["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof JSONSchema["extensions"] | undefined, val: JSONSchema["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.extensions"); + } } - } - 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; + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: JSONSchema, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string ref = 3; */ + if (message.ref !== "") + writer.tag(3, WireType.LengthDelimited).string(message.ref); + /* string title = 5; */ + if (message.title !== "") + writer.tag(5, WireType.LengthDelimited).string(message.title); + /* string description = 6; */ + if (message.description !== "") + writer.tag(6, WireType.LengthDelimited).string(message.description); + /* string default = 7; */ + if (message.default !== "") + writer.tag(7, WireType.LengthDelimited).string(message.default); + /* bool read_only = 8; */ + if (message.readOnly !== false) + writer.tag(8, WireType.Varint).bool(message.readOnly); + /* string example = 9; */ + if (message.example !== "") + writer.tag(9, WireType.LengthDelimited).string(message.example); + /* double multiple_of = 10; */ + if (message.multipleOf !== 0) + writer.tag(10, WireType.Bit64).double(message.multipleOf); + /* double maximum = 11; */ + if (message.maximum !== 0) + writer.tag(11, WireType.Bit64).double(message.maximum); + /* bool exclusive_maximum = 12; */ + if (message.exclusiveMaximum !== false) + writer.tag(12, WireType.Varint).bool(message.exclusiveMaximum); + /* double minimum = 13; */ + if (message.minimum !== 0) + writer.tag(13, WireType.Bit64).double(message.minimum); + /* bool exclusive_minimum = 14; */ + if (message.exclusiveMinimum !== false) + writer.tag(14, WireType.Varint).bool(message.exclusiveMinimum); + /* uint64 max_length = 15; */ + if (message.maxLength !== "0") + writer.tag(15, WireType.Varint).uint64(message.maxLength); + /* uint64 min_length = 16; */ + if (message.minLength !== "0") + writer.tag(16, WireType.Varint).uint64(message.minLength); + /* string pattern = 17; */ + if (message.pattern !== "") + writer.tag(17, WireType.LengthDelimited).string(message.pattern); + /* uint64 max_items = 20; */ + if (message.maxItems !== "0") + writer.tag(20, WireType.Varint).uint64(message.maxItems); + /* uint64 min_items = 21; */ + if (message.minItems !== "0") + writer.tag(21, WireType.Varint).uint64(message.minItems); + /* bool unique_items = 22; */ + if (message.uniqueItems !== false) + writer.tag(22, WireType.Varint).bool(message.uniqueItems); + /* uint64 max_properties = 24; */ + if (message.maxProperties !== "0") + writer.tag(24, WireType.Varint).uint64(message.maxProperties); + /* uint64 min_properties = 25; */ + if (message.minProperties !== "0") + writer.tag(25, WireType.Varint).uint64(message.minProperties); + /* repeated string required = 26; */ + for (let i = 0; i < message.required.length; i++) + writer.tag(26, WireType.LengthDelimited).string(message.required[i]); + /* repeated string array = 34; */ + for (let i = 0; i < message.array.length; i++) + writer.tag(34, WireType.LengthDelimited).string(message.array[i]); + /* repeated grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.JSONSchemaSimpleTypes type = 35; */ + if (message.type.length) { + writer.tag(35, WireType.LengthDelimited).fork(); + for (let i = 0; i < message.type.length; i++) + writer.int32(message.type[i]); + writer.join(); + } + /* string format = 36; */ + if (message.format !== "") + writer.tag(36, WireType.LengthDelimited).string(message.format); + /* repeated string enum = 46; */ + for (let i = 0; i < message.enum.length; i++) + writer.tag(46, WireType.LengthDelimited).string(message.enum[i]); + /* grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration field_configuration = 1001; */ + if (message.fieldConfiguration) + JSONSchema_FieldConfiguration.internalBinaryWrite(message.fieldConfiguration, writer.tag(1001, WireType.LengthDelimited).fork(), options).join(); + /* map extensions = 48; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(48, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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(); +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.JSONSchema + */ +export const JSONSchema = new JSONSchema$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class JSONSchema_FieldConfiguration$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration", [ + { no: 47, name: "path_param_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): JSONSchema_FieldConfiguration { + const message = { pathParamName: "" }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: JSONSchema_FieldConfiguration): JSONSchema_FieldConfiguration { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string path_param_name */ 47: + message.pathParamName = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - 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(); + internalBinaryWrite(message: JSONSchema_FieldConfiguration, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string path_param_name = 47; */ + if (message.pathParamName !== "") + writer.tag(47, WireType.LengthDelimited).string(message.pathParamName); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.JSONSchema.FieldConfiguration + */ +export const JSONSchema_FieldConfiguration = new JSONSchema_FieldConfiguration$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Tag$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Tag", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "external_docs", kind: "message", T: () => ExternalDocumentation }, + { no: 4, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); + } + create(value?: PartialMessage): Tag { + const message = { name: "", description: "", extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Tag): Tag { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string name */ 1: + message.name = reader.string(); + break; + case /* string description */ 2: + message.description = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs */ 3: + message.externalDocs = ExternalDocumentation.internalBinaryRead(reader, reader.uint32(), options, message.externalDocs); + break; + case /* map extensions */ 4: + this.binaryReadMap4(message.extensions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 5: { - if (tag !== 42) { - break; - } - - message.operationId = reader.string(); - continue; + return message; + } + private binaryReadMap4(map: Tag["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Tag["extensions"] | undefined, val: Tag["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Tag.extensions"); + } } - case 6: { - if (tag !== 50) { - break; - } - - message.consumes.push(reader.string()); - continue; + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: Tag, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string description = 2; */ + if (message.description !== "") + writer.tag(2, WireType.LengthDelimited).string(message.description); + /* grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation external_docs = 3; */ + if (message.externalDocs) + ExternalDocumentation.internalBinaryWrite(message.externalDocs, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* map extensions = 4; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(4, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Tag + */ +export const Tag = new Tag$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SecurityDefinitions$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions", [ + { no: 1, name: "security", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => SecurityScheme } } + ]); + } + create(value?: PartialMessage): SecurityDefinitions { + const message = { security: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SecurityDefinitions): SecurityDefinitions { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map security */ 1: + this.binaryReadMap1(message.security, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 7: { - if (tag !== 58) { - break; - } - - message.produces.push(reader.string()); - continue; + return message; + } + private binaryReadMap1(map: SecurityDefinitions["security"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SecurityDefinitions["security"] | undefined, val: SecurityDefinitions["security"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = SecurityScheme.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions.security"); + } } - 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; + map[key ?? ""] = val ?? SecurityScheme.create(); + } + internalBinaryWrite(message: SecurityDefinitions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map security = 1; */ + for (let k of Object.keys(message.security)) { + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + SecurityScheme.internalBinaryWrite(message.security[k], writer, options); + writer.join().join(); } - 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); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityDefinitions + */ +export const SecurityDefinitions = new SecurityDefinitions$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SecurityScheme$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme", [ + { no: 1, name: "type", kind: "enum", T: () => ["grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type", SecurityScheme_Type, "TYPE_"] }, + { no: 2, name: "description", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "in", kind: "enum", T: () => ["grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In", SecurityScheme_In, "IN_"] }, + { no: 5, name: "flow", kind: "enum", T: () => ["grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow", SecurityScheme_Flow, "FLOW_"] }, + { no: 6, name: "authorization_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "token_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "scopes", kind: "message", T: () => Scopes }, + { no: 9, name: "extensions", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => Value } } + ]); + } + create(value?: PartialMessage): SecurityScheme { + const message = { type: 0, description: "", name: "", in: 0, flow: 0, authorizationUrl: "", tokenUrl: "", extensions: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SecurityScheme): SecurityScheme { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type type */ 1: + message.type = reader.int32(); + break; + case /* string description */ 2: + message.description = reader.string(); + break; + case /* string name */ 3: + message.name = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In in */ 4: + message.in = reader.int32(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow flow */ 5: + message.flow = reader.int32(); + break; + case /* string authorization_url */ 6: + message.authorizationUrl = reader.string(); + break; + case /* string token_url */ 7: + message.tokenUrl = reader.string(); + break; + case /* grpc.gateway.protoc_gen_openapiv2.options.Scopes scopes */ 8: + message.scopes = Scopes.internalBinaryRead(reader, reader.uint32(), options, message.scopes); + break; + case /* map extensions */ 9: + this.binaryReadMap9(message.extensions, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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; + return message; + } + private binaryReadMap9(map: SecurityScheme["extensions"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SecurityScheme["extensions"] | undefined, val: SecurityScheme["extensions"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = Value.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.extensions"); + } } - 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; + map[key ?? ""] = val ?? Value.create(); + } + internalBinaryWrite(message: SecurityScheme, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Type type = 1; */ + if (message.type !== 0) + writer.tag(1, WireType.Varint).int32(message.type); + /* string description = 2; */ + if (message.description !== "") + writer.tag(2, WireType.LengthDelimited).string(message.description); + /* string name = 3; */ + if (message.name !== "") + writer.tag(3, WireType.LengthDelimited).string(message.name); + /* grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.In in = 4; */ + if (message.in !== 0) + writer.tag(4, WireType.Varint).int32(message.in); + /* grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme.Flow flow = 5; */ + if (message.flow !== 0) + writer.tag(5, WireType.Varint).int32(message.flow); + /* string authorization_url = 6; */ + if (message.authorizationUrl !== "") + writer.tag(6, WireType.LengthDelimited).string(message.authorizationUrl); + /* string token_url = 7; */ + if (message.tokenUrl !== "") + writer.tag(7, WireType.LengthDelimited).string(message.tokenUrl); + /* grpc.gateway.protoc_gen_openapiv2.options.Scopes scopes = 8; */ + if (message.scopes) + Scopes.internalBinaryWrite(message.scopes, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* map extensions = 9; */ + for (let k of Object.keys(message.extensions)) { + writer.tag(9, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + Value.internalBinaryWrite(message.extensions[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityScheme + */ +export const SecurityScheme = new SecurityScheme$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SecurityRequirement$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement", [ + { no: 1, name: "security_requirement", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "message", T: () => SecurityRequirement_SecurityRequirementValue } } + ]); + } + create(value?: PartialMessage): SecurityRequirement { + const message = { securityRequirement: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SecurityRequirement): SecurityRequirement { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map security_requirement */ 1: + this.binaryReadMap1(message.securityRequirement, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - case 14: { - if (tag !== 114) { - break; - } - - message.parameters = Parameters.decode(reader, reader.uint32()); - continue; + return message; + } + private binaryReadMap1(map: SecurityRequirement["securityRequirement"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof SecurityRequirement["securityRequirement"] | undefined, val: SecurityRequirement["securityRequirement"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = SecurityRequirement_SecurityRequirementValue.internalBinaryRead(reader, reader.uint32(), options); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.security_requirement"); + } } - } - 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; + map[key ?? ""] = val ?? SecurityRequirement_SecurityRequirementValue.create(); } - 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)); + internalBinaryWrite(message: SecurityRequirement, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map security_requirement = 1; */ + for (let k of Object.keys(message.securityRequirement)) { + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k); + writer.tag(2, WireType.LengthDelimited).fork(); + SecurityRequirement_SecurityRequirementValue.internalBinaryWrite(message.securityRequirement[k], writer, options); + writer.join().join(); + } + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.extensions) { - const entries = Object.entries(message.extensions); - if (entries.length > 0) { - obj.extensions = {}; - entries.forEach(([k, v]) => { - obj.extensions[k] = v; - }); - } +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement + */ +export const SecurityRequirement = new SecurityRequirement$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SecurityRequirement_SecurityRequirementValue$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue", [ + { no: 1, name: "scope", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SecurityRequirement_SecurityRequirementValue { + const message = { scope: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SecurityRequirement_SecurityRequirementValue): SecurityRequirement_SecurityRequirementValue { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string scope */ 1: + message.scope.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.parameters !== undefined) { - obj.parameters = Parameters.toJSON(message.parameters); + internalBinaryWrite(message: SecurityRequirement_SecurityRequirementValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string scope = 1; */ + for (let i = 0; i < message.scope.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.scope[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +} +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.SecurityRequirement.SecurityRequirementValue + */ +export const SecurityRequirement_SecurityRequirementValue = new SecurityRequirement_SecurityRequirementValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Scopes$Type extends MessageType { + constructor() { + super("grpc.gateway.protoc_gen_openapiv2.options.Scopes", [ + { no: 1, name: "scope", kind: "map", K: 9 /*ScalarType.STRING*/, V: { kind: "scalar", T: 9 /*ScalarType.STRING*/ } } + ]); + } + create(value?: PartialMessage): Scopes { + const message = { scope: {} }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Scopes): Scopes { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* map scope */ 1: + this.binaryReadMap1(message.scope, reader, options); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - return 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 message; + } + private binaryReadMap1(map: Scopes["scope"], reader: IBinaryReader, options: BinaryReadOptions): void { + let len = reader.uint32(), end = reader.pos + len, key: keyof Scopes["scope"] | undefined, val: Scopes["scope"][any] | undefined; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case 1: + key = reader.string(); + break; + case 2: + val = reader.string(); + break; + default: throw new globalThis.Error("unknown map entry field for field grpc.gateway.protoc_gen_openapiv2.options.Scopes.scope"); + } } - 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); + map[key ?? ""] = val ?? ""; } - if (message.value !== undefined) { - Response.encode(message.value, writer.uint32(18).fork()).join(); + internalBinaryWrite(message: Scopes, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map scope = 1; */ + for (let k of Object.keys(message.scope)) + writer.tag(1, WireType.LengthDelimited).fork().tag(1, WireType.LengthDelimited).string(k).tag(2, WireType.LengthDelimited).string(message.scope[k]).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; } +/** + * @generated MessageType for protobuf message grpc.gateway.protoc_gen_openapiv2.options.Scopes + */ +export const Scopes = new Scopes$Type(); diff --git a/src/grpc/generated/validate/validate.ts b/src/grpc/generated/validate/validate.ts index 7d741fc..16fa589 100644 --- a/src/grpc/generated/validate/validate.ts +++ b/src/grpc/generated/validate/validate.ts @@ -1,6048 +1,4111 @@ -// 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"; +// @generated by protobuf-ts 2.9.1 with parameter long_type_string,client_grpc1,generate_dependencies +// @generated from protobuf file "validate/validate.proto" (package "validate", syntax proto2) +// tslint:disable +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MESSAGE_TYPE } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; 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"; - } -} - +import { Duration } from "../google/protobuf/duration"; /** * FieldRules encapsulates the rules for each type of field. Depending on the * field, the correct set should be used to ensure proper validations. + * + * @generated from protobuf message validate.FieldRules */ 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; + /** + * @generated from protobuf field: optional validate.MessageRules message = 17; + */ + message?: MessageRules; + /** + * @generated from protobuf oneof: type + */ + type: { + oneofKind: "float"; + /** + * Scalar Field Types + * + * @generated from protobuf field: validate.FloatRules float = 1; + */ + float: FloatRules; + } | { + oneofKind: "double"; + /** + * @generated from protobuf field: validate.DoubleRules double = 2; + */ + double: DoubleRules; + } | { + oneofKind: "int32"; + /** + * @generated from protobuf field: validate.Int32Rules int32 = 3; + */ + int32: Int32Rules; + } | { + oneofKind: "int64"; + /** + * @generated from protobuf field: validate.Int64Rules int64 = 4; + */ + int64: Int64Rules; + } | { + oneofKind: "uint32"; + /** + * @generated from protobuf field: validate.UInt32Rules uint32 = 5; + */ + uint32: UInt32Rules; + } | { + oneofKind: "uint64"; + /** + * @generated from protobuf field: validate.UInt64Rules uint64 = 6; + */ + uint64: UInt64Rules; + } | { + oneofKind: "sint32"; + /** + * @generated from protobuf field: validate.SInt32Rules sint32 = 7; + */ + sint32: SInt32Rules; + } | { + oneofKind: "sint64"; + /** + * @generated from protobuf field: validate.SInt64Rules sint64 = 8; + */ + sint64: SInt64Rules; + } | { + oneofKind: "fixed32"; + /** + * @generated from protobuf field: validate.Fixed32Rules fixed32 = 9; + */ + fixed32: Fixed32Rules; + } | { + oneofKind: "fixed64"; + /** + * @generated from protobuf field: validate.Fixed64Rules fixed64 = 10; + */ + fixed64: Fixed64Rules; + } | { + oneofKind: "sfixed32"; + /** + * @generated from protobuf field: validate.SFixed32Rules sfixed32 = 11; + */ + sfixed32: SFixed32Rules; + } | { + oneofKind: "sfixed64"; + /** + * @generated from protobuf field: validate.SFixed64Rules sfixed64 = 12; + */ + sfixed64: SFixed64Rules; + } | { + oneofKind: "bool"; + /** + * @generated from protobuf field: validate.BoolRules bool = 13; + */ + bool: BoolRules; + } | { + oneofKind: "string"; + /** + * @generated from protobuf field: validate.StringRules string = 14; + */ + string: StringRules; + } | { + oneofKind: "bytes"; + /** + * @generated from protobuf field: validate.BytesRules bytes = 15; + */ + bytes: BytesRules; + } | { + oneofKind: "enum"; + /** + * Complex Field Types + * + * @generated from protobuf field: validate.EnumRules enum = 16; + */ + enum: EnumRules; + } | { + oneofKind: "repeated"; + /** + * @generated from protobuf field: validate.RepeatedRules repeated = 18; + */ + repeated: RepeatedRules; + } | { + oneofKind: "map"; + /** + * @generated from protobuf field: validate.MapRules map = 19; + */ + map: MapRules; + } | { + oneofKind: "any"; + /** + * Well-Known Field Types + * + * @generated from protobuf field: validate.AnyRules any = 20; + */ + any: AnyRules; + } | { + oneofKind: "duration"; + /** + * @generated from protobuf field: validate.DurationRules duration = 21; + */ + duration: DurationRules; + } | { + oneofKind: "timestamp"; + /** + * @generated from protobuf field: validate.TimestampRules timestamp = 22; + */ + timestamp: TimestampRules; + } | { + oneofKind: undefined; + }; } - -/** FloatRules describes the constraints applied to `float` values */ +/** + * FloatRules describes the constraints applied to `float` values + * + * @generated from protobuf message validate.FloatRules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional float const = 1; + */ + const?: number; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional float lt = 2; + */ + lt?: number; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional float lte = 3; + */ + lte?: number; + /** + * 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. + * + * @generated from protobuf field: optional float gt = 4; + */ + gt?: number; + /** + * 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. + * + * @generated from protobuf field: optional float gte = 5; + */ + gte?: number; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated float in = 6; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated float not_in = 7; + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** DoubleRules describes the constraints applied to `double` values */ +/** + * DoubleRules describes the constraints applied to `double` values + * + * @generated from protobuf message validate.DoubleRules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional double const = 1; + */ + const?: number; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional double lt = 2; + */ + lt?: number; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional double lte = 3; + */ + lte?: number; + /** + * 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. + * + * @generated from protobuf field: optional double gt = 4; + */ + gt?: number; + /** + * 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. + * + * @generated from protobuf field: optional double gte = 5; + */ + gte?: number; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated double in = 6; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated double not_in = 7; + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** Int32Rules describes the constraints applied to `int32` values */ +/** + * Int32Rules describes the constraints applied to `int32` values + * + * @generated from protobuf message validate.Int32Rules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional int32 const = 1; + */ + const?: number; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional int32 lt = 2; + */ + lt?: number; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional int32 lte = 3; + */ + lte?: number; + /** + * 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. + * + * @generated from protobuf field: optional int32 gt = 4; + */ + gt?: number; + /** + * 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. + * + * @generated from protobuf field: optional int32 gte = 5; + */ + gte?: number; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated int32 in = 6; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated int32 not_in = 7; + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** Int64Rules describes the constraints applied to `int64` values */ +/** + * Int64Rules describes the constraints applied to `int64` values + * + * @generated from protobuf message validate.Int64Rules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional int64 const = 1; + */ + const?: string; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional int64 lt = 2; + */ + lt?: string; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional int64 lte = 3; + */ + lte?: string; + /** + * 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. + * + * @generated from protobuf field: optional int64 gt = 4; + */ + gt?: string; + /** + * 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. + * + * @generated from protobuf field: optional int64 gte = 5; + */ + gte?: string; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated int64 in = 6; + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated int64 not_in = 7; + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** UInt32Rules describes the constraints applied to `uint32` values */ +/** + * UInt32Rules describes the constraints applied to `uint32` values + * + * @generated from protobuf message validate.UInt32Rules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional uint32 const = 1; + */ + const?: number; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional uint32 lt = 2; + */ + lt?: number; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional uint32 lte = 3; + */ + lte?: number; + /** + * 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. + * + * @generated from protobuf field: optional uint32 gt = 4; + */ + gt?: number; + /** + * 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. + * + * @generated from protobuf field: optional uint32 gte = 5; + */ + gte?: number; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated uint32 in = 6; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated uint32 not_in = 7; + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** UInt64Rules describes the constraints applied to `uint64` values */ +/** + * UInt64Rules describes the constraints applied to `uint64` values + * + * @generated from protobuf message validate.UInt64Rules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional uint64 const = 1; + */ + const?: string; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional uint64 lt = 2; + */ + lt?: string; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional uint64 lte = 3; + */ + lte?: string; + /** + * 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. + * + * @generated from protobuf field: optional uint64 gt = 4; + */ + gt?: string; + /** + * 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. + * + * @generated from protobuf field: optional uint64 gte = 5; + */ + gte?: string; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated uint64 in = 6; + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated uint64 not_in = 7; + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** SInt32Rules describes the constraints applied to `sint32` values */ +/** + * SInt32Rules describes the constraints applied to `sint32` values + * + * @generated from protobuf message validate.SInt32Rules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional sint32 const = 1; + */ + const?: number; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional sint32 lt = 2; + */ + lt?: number; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional sint32 lte = 3; + */ + lte?: number; + /** + * 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. + * + * @generated from protobuf field: optional sint32 gt = 4; + */ + gt?: number; + /** + * 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. + * + * @generated from protobuf field: optional sint32 gte = 5; + */ + gte?: number; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sint32 in = 6; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sint32 not_in = 7; + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** SInt64Rules describes the constraints applied to `sint64` values */ +/** + * SInt64Rules describes the constraints applied to `sint64` values + * + * @generated from protobuf message validate.SInt64Rules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional sint64 const = 1; + */ + const?: string; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional sint64 lt = 2; + */ + lt?: string; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional sint64 lte = 3; + */ + lte?: string; + /** + * 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. + * + * @generated from protobuf field: optional sint64 gt = 4; + */ + gt?: string; + /** + * 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. + * + * @generated from protobuf field: optional sint64 gte = 5; + */ + gte?: string; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sint64 in = 6; + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sint64 not_in = 7; + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** Fixed32Rules describes the constraints applied to `fixed32` values */ +/** + * Fixed32Rules describes the constraints applied to `fixed32` values + * + * @generated from protobuf message validate.Fixed32Rules + */ 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; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional fixed32 const = 1; + */ + const?: number; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional fixed32 lt = 2; + */ + lt?: number; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional fixed32 lte = 3; + */ + lte?: number; + /** + * 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. + * + * @generated from protobuf field: optional fixed32 gt = 4; + */ + gt?: number; + /** + * 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. + * + * @generated from protobuf field: optional fixed32 gte = 5; + */ + gte?: number; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated fixed32 in = 6; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated fixed32 not_in = 7; + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - -/** Fixed64Rules describes the constraints applied to `fixed64` values */ +/** + * Fixed64Rules describes the constraints applied to `fixed64` values + * + * @generated from protobuf message validate.Fixed64Rules + */ 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[]; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional fixed64 const = 1; + */ + const?: string; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional fixed64 lt = 2; + */ + lt?: string; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional fixed64 lte = 3; + */ + lte?: string; + /** + * 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. + * + * @generated from protobuf field: optional fixed64 gt = 4; + */ + gt?: string; + /** + * 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. + * + * @generated from protobuf field: optional fixed64 gte = 5; + */ + gte?: string; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated fixed64 in = 6; + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated fixed64 not_in = 7; + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - /** - * MessageRules describe the constraints applied to embedded message values. - * For message-type fields, validation is performed recursively. + * SFixed32Rules describes the constraints applied to `sfixed32` values + * + * @generated from protobuf message validate.SFixed32Rules */ -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; +export interface SFixed32Rules { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional sfixed32 const = 1; + */ + const?: number; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional sfixed32 lt = 2; + */ + lt?: number; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional sfixed32 lte = 3; + */ + lte?: number; + /** + * 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. + * + * @generated from protobuf field: optional sfixed32 gt = 4; + */ + gt?: number; + /** + * 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. + * + * @generated from protobuf field: optional sfixed32 gte = 5; + */ + gte?: number; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sfixed32 in = 6; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sfixed32 not_in = 7; + */ + notIn: number[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - /** - * AnyRules describe constraints applied exclusively to the - * `google.protobuf.Any` well-known type + * SFixed64Rules describes the constraints applied to `sfixed64` values + * + * @generated from protobuf message validate.SFixed64Rules */ -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[]; +export interface SFixed64Rules { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional sfixed64 const = 1; + */ + const?: string; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional sfixed64 lt = 2; + */ + lt?: string; + /** + * Lte specifies that this field must be less than or equal to the + * specified value, inclusive + * + * @generated from protobuf field: optional sfixed64 lte = 3; + */ + lte?: string; + /** + * 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. + * + * @generated from protobuf field: optional sfixed64 gt = 4; + */ + gt?: string; + /** + * 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. + * + * @generated from protobuf field: optional sfixed64 gte = 5; + */ + gte?: string; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sfixed64 in = 6; + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated sfixed64 not_in = 7; + */ + notIn: string[]; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 8; + */ + ignoreEmpty?: boolean; } - /** - * DurationRules describe the constraints applied exclusively to the - * `google.protobuf.Duration` well-known type + * BoolRules describes the constraints applied to `bool` values + * + * @generated from protobuf message validate.BoolRules */ -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[]; +export interface BoolRules { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional bool const = 1; + */ + const?: boolean; } - /** - * TimestampRules describe the constraints applied exclusively to the - * `google.protobuf.Timestamp` well-known type + * StringRules describe the constraints applied to `string` values + * + * @generated from protobuf message validate.StringRules */ -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, +export interface StringRules { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional string const = 1; + */ + const?: string; + /** + * 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. + * + * @generated from protobuf field: optional uint64 len = 19; + */ + len?: string; + /** + * 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. + * + * @generated from protobuf field: optional uint64 min_len = 2; + */ + minLen?: string; + /** + * 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. + * + * @generated from protobuf field: optional uint64 max_len = 3; + */ + maxLen?: string; + /** + * LenBytes specifies that this field must be the specified number of bytes + * + * @generated from protobuf field: optional uint64 len_bytes = 20; + */ + lenBytes?: string; + /** + * MinBytes specifies that this field must be the specified number of bytes + * at a minimum + * + * @generated from protobuf field: optional uint64 min_bytes = 4; + */ + minBytes?: string; + /** + * MaxBytes specifies that this field must be the specified number of bytes + * at a maximum + * + * @generated from protobuf field: optional uint64 max_bytes = 5; + */ + maxBytes?: string; + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + * + * @generated from protobuf field: optional string pattern = 6; + */ + pattern?: string; + /** + * Prefix specifies that this field must have the specified substring at + * the beginning of the string. + * + * @generated from protobuf field: optional string prefix = 7; + */ + prefix?: string; + /** + * Suffix specifies that this field must have the specified substring at + * the end of the string. + * + * @generated from protobuf field: optional string suffix = 8; + */ + suffix?: string; + /** + * Contains specifies that this field must have the specified substring + * anywhere in the string. + * + * @generated from protobuf field: optional string contains = 9; + */ + contains?: string; + /** + * NotContains specifies that this field cannot have the specified substring + * anywhere in the string. + * + * @generated from protobuf field: optional string not_contains = 23; + */ + notContains?: string; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated string in = 10; + */ + in: string[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated string not_in = 11; + */ + notIn: string[]; + /** + * @generated from protobuf oneof: well_known + */ + wellKnown: { + oneofKind: "email"; + /** + * Email specifies that the field must be a valid email address as + * defined by RFC 5322 + * + * @generated from protobuf field: bool email = 12; + */ + email: boolean; + } | { + oneofKind: "hostname"; + /** + * Hostname specifies that the field must be a valid hostname as + * defined by RFC 1034. This constraint does not support + * internationalized domain names (IDNs). + * + * @generated from protobuf field: bool hostname = 13; + */ + hostname: boolean; + } | { + oneofKind: "ip"; + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address. + * Valid IPv6 addresses should not include surrounding square brackets. + * + * @generated from protobuf field: bool ip = 14; + */ + ip: boolean; + } | { + oneofKind: "ipv4"; + /** + * Ipv4 specifies that the field must be a valid IPv4 address. + * + * @generated from protobuf field: bool ipv4 = 15; + */ + ipv4: boolean; + } | { + oneofKind: "ipv6"; + /** + * Ipv6 specifies that the field must be a valid IPv6 address. Valid + * IPv6 addresses should not include surrounding square brackets. + * + * @generated from protobuf field: bool ipv6 = 16; + */ + ipv6: boolean; + } | { + oneofKind: "uri"; + /** + * Uri specifies that the field must be a valid, absolute URI as defined + * by RFC 3986 + * + * @generated from protobuf field: bool uri = 17; + */ + uri: boolean; + } | { + oneofKind: "uriRef"; + /** + * UriRef specifies that the field must be a valid URI as defined by RFC + * 3986 and may be relative or absolute. + * + * @generated from protobuf field: bool uri_ref = 18; + */ + uriRef: boolean; + } | { + oneofKind: "address"; + /** + * 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). + * + * @generated from protobuf field: bool address = 21; + */ + address: boolean; + } | { + oneofKind: "uuid"; + /** + * Uuid specifies that the field must be a valid UUID as defined by + * RFC 4122 + * + * @generated from protobuf field: bool uuid = 22; + */ + uuid: boolean; + } | { + oneofKind: "wellKnownRegex"; + /** + * WellKnownRegex specifies a common well known pattern defined as a regex. + * + * @generated from protobuf field: validate.KnownRegex well_known_regex = 24; + */ + wellKnownRegex: KnownRegex; + } | { + oneofKind: undefined; }; - }, - - 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 }; + /** + * 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. + * + * @generated from protobuf field: optional bool strict = 25; + */ + strict?: boolean; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 26; + */ + ignoreEmpty?: boolean; } - -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, +/** + * BytesRules describe the constraints applied to `bytes` values + * + * @generated from protobuf message validate.BytesRules + */ +export interface BytesRules { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional bytes const = 1; + */ + const?: Uint8Array; + /** + * Len specifies that this field must be the specified number of bytes + * + * @generated from protobuf field: optional uint64 len = 13; + */ + len?: string; + /** + * MinLen specifies that this field must be the specified number of bytes + * at a minimum + * + * @generated from protobuf field: optional uint64 min_len = 2; + */ + minLen?: string; + /** + * MaxLen specifies that this field must be the specified number of bytes + * at a maximum + * + * @generated from protobuf field: optional uint64 max_len = 3; + */ + maxLen?: string; + /** + * Pattern specifies that this field must match against the specified + * regular expression (RE2 syntax). The included expression should elide + * any delimiters. + * + * @generated from protobuf field: optional string pattern = 4; + */ + pattern?: string; + /** + * Prefix specifies that this field must have the specified bytes at the + * beginning of the string. + * + * @generated from protobuf field: optional bytes prefix = 5; + */ + prefix?: Uint8Array; + /** + * Suffix specifies that this field must have the specified bytes at the + * end of the string. + * + * @generated from protobuf field: optional bytes suffix = 6; + */ + suffix?: Uint8Array; + /** + * Contains specifies that this field must have the specified bytes + * anywhere in the string. + * + * @generated from protobuf field: optional bytes contains = 7; + */ + contains?: Uint8Array; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated bytes in = 8; + */ + in: Uint8Array[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated bytes not_in = 9; + */ + notIn: Uint8Array[]; + /** + * @generated from protobuf oneof: well_known + */ + wellKnown: { + oneofKind: "ip"; + /** + * Ip specifies that the field must be a valid IP (v4 or v6) address in + * byte format + * + * @generated from protobuf field: bool ip = 10; + */ + ip: boolean; + } | { + oneofKind: "ipv4"; + /** + * Ipv4 specifies that the field must be a valid IPv4 address in byte + * format + * + * @generated from protobuf field: bool ipv4 = 11; + */ + ipv4: boolean; + } | { + oneofKind: "ipv6"; + /** + * Ipv6 specifies that the field must be a valid IPv6 address in byte + * format + * + * @generated from protobuf field: bool ipv6 = 12; + */ + ipv6: boolean; + } | { + oneofKind: undefined; }; - }, - - 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 }; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 14; + */ + ignoreEmpty?: boolean; } - -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, - }; +/** + * EnumRules describe the constraints applied to enum values + * + * @generated from protobuf message validate.EnumRules + */ +export interface EnumRules { + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional int32 const = 1; + */ + const?: number; + /** + * DefinedOnly specifies that this field must be only one of the defined + * values for this enum, failing on any undefined value. + * + * @generated from protobuf field: optional bool defined_only = 2; + */ + definedOnly?: boolean; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated int32 in = 3; + */ + in: number[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated int32 not_in = 4; + */ + notIn: number[]; } - -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 }; +/** + * MessageRules describe the constraints applied to embedded message values. + * For message-type fields, validation is performed recursively. + * + * @generated from protobuf message validate.MessageRules + */ +export interface MessageRules { + /** + * Skip specifies that the validation rules of this field should not be + * evaluated + * + * @generated from protobuf field: optional bool skip = 1; + */ + skip?: boolean; + /** + * Required specifies that this field must be set + * + * @generated from protobuf field: optional bool required = 2; + */ + required?: boolean; } - -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 }; +/** + * RepeatedRules describe the constraints applied to `repeated` values + * + * @generated from protobuf message validate.RepeatedRules + */ +export interface RepeatedRules { + /** + * MinItems specifies that this field must have the specified number of + * items at a minimum + * + * @generated from protobuf field: optional uint64 min_items = 1; + */ + minItems?: string; + /** + * MaxItems specifies that this field must have the specified number of + * items at a maximum + * + * @generated from protobuf field: optional uint64 max_items = 2; + */ + maxItems?: string; + /** + * 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). + * + * @generated from protobuf field: optional bool unique = 3; + */ + unique?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional validate.FieldRules items = 4; + */ + items?: FieldRules; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 5; + */ + ignoreEmpty?: boolean; } - -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, - }; +/** + * MapRules describe the constraints applied to `map` values + * + * @generated from protobuf message validate.MapRules + */ +export interface MapRules { + /** + * MinPairs specifies that this field must have the specified number of + * KVs at a minimum + * + * @generated from protobuf field: optional uint64 min_pairs = 1; + */ + minPairs?: string; + /** + * MaxPairs specifies that this field must have the specified number of + * KVs at a maximum + * + * @generated from protobuf field: optional uint64 max_pairs = 2; + */ + maxPairs?: string; + /** + * NoSparse specifies values in this field cannot be unset. This only + * applies to map's with message value types. + * + * @generated from protobuf field: optional bool no_sparse = 3; + */ + noSparse?: boolean; + /** + * Keys specifies the constraints to be applied to each key in the field. + * + * @generated from protobuf field: optional validate.FieldRules keys = 4; + */ + keys?: FieldRules; + /** + * 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. + * + * @generated from protobuf field: optional validate.FieldRules values = 5; + */ + values?: FieldRules; + /** + * IgnoreEmpty specifies that the validation rules of this field should be + * evaluated only if the field is not empty + * + * @generated from protobuf field: optional bool ignore_empty = 6; + */ + ignoreEmpty?: boolean; } - -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 }; +/** + * AnyRules describe constraints applied exclusively to the + * `google.protobuf.Any` well-known type + * + * @generated from protobuf message validate.AnyRules + */ +export interface AnyRules { + /** + * Required specifies that this field must be set + * + * @generated from protobuf field: optional bool required = 1; + */ + required?: boolean; + /** + * In specifies that this field's `type_url` must be equal to one of the + * specified values. + * + * @generated from protobuf field: repeated string in = 2; + */ + in: string[]; + /** + * NotIn specifies that this field's `type_url` must not be equal to any of + * the specified values. + * + * @generated from protobuf field: repeated string not_in = 3; + */ + notIn: string[]; } - -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, - }; +/** + * DurationRules describe the constraints applied exclusively to the + * `google.protobuf.Duration` well-known type + * + * @generated from protobuf message validate.DurationRules + */ +export interface DurationRules { + /** + * Required specifies that this field must be set + * + * @generated from protobuf field: optional bool required = 1; + */ + required?: boolean; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional google.protobuf.Duration const = 2; + */ + const?: Duration; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional google.protobuf.Duration lt = 3; + */ + lt?: Duration; + /** + * Lt specifies that this field must be less than the specified value, + * inclusive + * + * @generated from protobuf field: optional google.protobuf.Duration lte = 4; + */ + lte?: Duration; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + * + * @generated from protobuf field: optional google.protobuf.Duration gt = 5; + */ + gt?: Duration; + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + * + * @generated from protobuf field: optional google.protobuf.Duration gte = 6; + */ + gte?: Duration; + /** + * In specifies that this field must be equal to one of the specified + * values + * + * @generated from protobuf field: repeated google.protobuf.Duration in = 7; + */ + in: Duration[]; + /** + * NotIn specifies that this field cannot be equal to one of the specified + * values + * + * @generated from protobuf field: repeated google.protobuf.Duration not_in = 8; + */ + notIn: Duration[]; } - -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 }; +/** + * TimestampRules describe the constraints applied exclusively to the + * `google.protobuf.Timestamp` well-known type + * + * @generated from protobuf message validate.TimestampRules + */ +export interface TimestampRules { + /** + * Required specifies that this field must be set + * + * @generated from protobuf field: optional bool required = 1; + */ + required?: boolean; + /** + * Const specifies that this field must be exactly the specified value + * + * @generated from protobuf field: optional google.protobuf.Timestamp const = 2; + */ + const?: Timestamp; + /** + * Lt specifies that this field must be less than the specified value, + * exclusive + * + * @generated from protobuf field: optional google.protobuf.Timestamp lt = 3; + */ + lt?: Timestamp; + /** + * Lte specifies that this field must be less than the specified value, + * inclusive + * + * @generated from protobuf field: optional google.protobuf.Timestamp lte = 4; + */ + lte?: Timestamp; + /** + * Gt specifies that this field must be greater than the specified value, + * exclusive + * + * @generated from protobuf field: optional google.protobuf.Timestamp gt = 5; + */ + gt?: Timestamp; + /** + * Gte specifies that this field must be greater than the specified value, + * inclusive + * + * @generated from protobuf field: optional google.protobuf.Timestamp gte = 6; + */ + gte?: Timestamp; + /** + * LtNow specifies that this must be less than the current time. LtNow + * can only be used with the Within rule. + * + * @generated from protobuf field: optional bool lt_now = 7; + */ + ltNow?: boolean; + /** + * GtNow specifies that this must be greater than the current time. GtNow + * can only be used with the Within rule. + * + * @generated from protobuf field: optional bool gt_now = 8; + */ + gtNow?: boolean; + /** + * 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. + * + * @generated from protobuf field: optional google.protobuf.Duration within = 9; + */ + within?: Duration; +} +/** + * WellKnownRegex contain some well-known patterns. + * + * @generated from protobuf enum validate.KnownRegex + */ +export enum KnownRegex { + /** + * @generated from protobuf enum value: UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * HTTP header name as defined by RFC 7230. + * + * @generated from protobuf enum value: HTTP_HEADER_NAME = 1; + */ + HTTP_HEADER_NAME = 1, + /** + * HTTP header value as defined by RFC 7230. + * + * @generated from protobuf enum value: HTTP_HEADER_VALUE = 2; + */ + HTTP_HEADER_VALUE = 2 +} +// @generated message type with reflection information, may provide speed optimized methods +class FieldRules$Type extends MessageType { + constructor() { + super("validate.FieldRules", [ + { no: 17, name: "message", kind: "message", T: () => MessageRules }, + { no: 1, name: "float", kind: "message", oneof: "type", T: () => FloatRules }, + { no: 2, name: "double", kind: "message", oneof: "type", T: () => DoubleRules }, + { no: 3, name: "int32", kind: "message", oneof: "type", T: () => Int32Rules }, + { no: 4, name: "int64", kind: "message", oneof: "type", T: () => Int64Rules }, + { no: 5, name: "uint32", kind: "message", oneof: "type", T: () => UInt32Rules }, + { no: 6, name: "uint64", kind: "message", oneof: "type", T: () => UInt64Rules }, + { no: 7, name: "sint32", kind: "message", oneof: "type", T: () => SInt32Rules }, + { no: 8, name: "sint64", kind: "message", oneof: "type", T: () => SInt64Rules }, + { no: 9, name: "fixed32", kind: "message", oneof: "type", T: () => Fixed32Rules }, + { no: 10, name: "fixed64", kind: "message", oneof: "type", T: () => Fixed64Rules }, + { no: 11, name: "sfixed32", kind: "message", oneof: "type", T: () => SFixed32Rules }, + { no: 12, name: "sfixed64", kind: "message", oneof: "type", T: () => SFixed64Rules }, + { no: 13, name: "bool", kind: "message", oneof: "type", T: () => BoolRules }, + { no: 14, name: "string", kind: "message", oneof: "type", T: () => StringRules }, + { no: 15, name: "bytes", kind: "message", oneof: "type", T: () => BytesRules }, + { no: 16, name: "enum", kind: "message", oneof: "type", T: () => EnumRules }, + { no: 18, name: "repeated", kind: "message", oneof: "type", T: () => RepeatedRules }, + { no: 19, name: "map", kind: "message", oneof: "type", T: () => MapRules }, + { no: 20, name: "any", kind: "message", oneof: "type", T: () => AnyRules }, + { no: 21, name: "duration", kind: "message", oneof: "type", T: () => DurationRules }, + { no: 22, name: "timestamp", kind: "message", oneof: "type", T: () => TimestampRules } + ]); + } + create(value?: PartialMessage): FieldRules { + const message = { type: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FieldRules): FieldRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional validate.MessageRules message */ 17: + message.message = MessageRules.internalBinaryRead(reader, reader.uint32(), options, message.message); + break; + case /* validate.FloatRules float */ 1: + message.type = { + oneofKind: "float", + float: FloatRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).float) + }; + break; + case /* validate.DoubleRules double */ 2: + message.type = { + oneofKind: "double", + double: DoubleRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).double) + }; + break; + case /* validate.Int32Rules int32 */ 3: + message.type = { + oneofKind: "int32", + int32: Int32Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).int32) + }; + break; + case /* validate.Int64Rules int64 */ 4: + message.type = { + oneofKind: "int64", + int64: Int64Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).int64) + }; + break; + case /* validate.UInt32Rules uint32 */ 5: + message.type = { + oneofKind: "uint32", + uint32: UInt32Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).uint32) + }; + break; + case /* validate.UInt64Rules uint64 */ 6: + message.type = { + oneofKind: "uint64", + uint64: UInt64Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).uint64) + }; + break; + case /* validate.SInt32Rules sint32 */ 7: + message.type = { + oneofKind: "sint32", + sint32: SInt32Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).sint32) + }; + break; + case /* validate.SInt64Rules sint64 */ 8: + message.type = { + oneofKind: "sint64", + sint64: SInt64Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).sint64) + }; + break; + case /* validate.Fixed32Rules fixed32 */ 9: + message.type = { + oneofKind: "fixed32", + fixed32: Fixed32Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).fixed32) + }; + break; + case /* validate.Fixed64Rules fixed64 */ 10: + message.type = { + oneofKind: "fixed64", + fixed64: Fixed64Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).fixed64) + }; + break; + case /* validate.SFixed32Rules sfixed32 */ 11: + message.type = { + oneofKind: "sfixed32", + sfixed32: SFixed32Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).sfixed32) + }; + break; + case /* validate.SFixed64Rules sfixed64 */ 12: + message.type = { + oneofKind: "sfixed64", + sfixed64: SFixed64Rules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).sfixed64) + }; + break; + case /* validate.BoolRules bool */ 13: + message.type = { + oneofKind: "bool", + bool: BoolRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).bool) + }; + break; + case /* validate.StringRules string */ 14: + message.type = { + oneofKind: "string", + string: StringRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).string) + }; + break; + case /* validate.BytesRules bytes */ 15: + message.type = { + oneofKind: "bytes", + bytes: BytesRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).bytes) + }; + break; + case /* validate.EnumRules enum */ 16: + message.type = { + oneofKind: "enum", + enum: EnumRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).enum) + }; + break; + case /* validate.RepeatedRules repeated */ 18: + message.type = { + oneofKind: "repeated", + repeated: RepeatedRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).repeated) + }; + break; + case /* validate.MapRules map */ 19: + message.type = { + oneofKind: "map", + map: MapRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).map) + }; + break; + case /* validate.AnyRules any */ 20: + message.type = { + oneofKind: "any", + any: AnyRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).any) + }; + break; + case /* validate.DurationRules duration */ 21: + message.type = { + oneofKind: "duration", + duration: DurationRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).duration) + }; + break; + case /* validate.TimestampRules timestamp */ 22: + message.type = { + oneofKind: "timestamp", + timestamp: TimestampRules.internalBinaryRead(reader, reader.uint32(), options, (message.type as any).timestamp) + }; + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } + return message; + } + internalBinaryWrite(message: FieldRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional validate.MessageRules message = 17; */ + if (message.message) + MessageRules.internalBinaryWrite(message.message, writer.tag(17, WireType.LengthDelimited).fork(), options).join(); + /* validate.FloatRules float = 1; */ + if (message.type.oneofKind === "float") + FloatRules.internalBinaryWrite(message.type.float, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* validate.DoubleRules double = 2; */ + if (message.type.oneofKind === "double") + DoubleRules.internalBinaryWrite(message.type.double, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* validate.Int32Rules int32 = 3; */ + if (message.type.oneofKind === "int32") + Int32Rules.internalBinaryWrite(message.type.int32, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* validate.Int64Rules int64 = 4; */ + if (message.type.oneofKind === "int64") + Int64Rules.internalBinaryWrite(message.type.int64, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* validate.UInt32Rules uint32 = 5; */ + if (message.type.oneofKind === "uint32") + UInt32Rules.internalBinaryWrite(message.type.uint32, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* validate.UInt64Rules uint64 = 6; */ + if (message.type.oneofKind === "uint64") + UInt64Rules.internalBinaryWrite(message.type.uint64, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* validate.SInt32Rules sint32 = 7; */ + if (message.type.oneofKind === "sint32") + SInt32Rules.internalBinaryWrite(message.type.sint32, writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* validate.SInt64Rules sint64 = 8; */ + if (message.type.oneofKind === "sint64") + SInt64Rules.internalBinaryWrite(message.type.sint64, writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + /* validate.Fixed32Rules fixed32 = 9; */ + if (message.type.oneofKind === "fixed32") + Fixed32Rules.internalBinaryWrite(message.type.fixed32, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + /* validate.Fixed64Rules fixed64 = 10; */ + if (message.type.oneofKind === "fixed64") + Fixed64Rules.internalBinaryWrite(message.type.fixed64, writer.tag(10, WireType.LengthDelimited).fork(), options).join(); + /* validate.SFixed32Rules sfixed32 = 11; */ + if (message.type.oneofKind === "sfixed32") + SFixed32Rules.internalBinaryWrite(message.type.sfixed32, writer.tag(11, WireType.LengthDelimited).fork(), options).join(); + /* validate.SFixed64Rules sfixed64 = 12; */ + if (message.type.oneofKind === "sfixed64") + SFixed64Rules.internalBinaryWrite(message.type.sfixed64, writer.tag(12, WireType.LengthDelimited).fork(), options).join(); + /* validate.BoolRules bool = 13; */ + if (message.type.oneofKind === "bool") + BoolRules.internalBinaryWrite(message.type.bool, writer.tag(13, WireType.LengthDelimited).fork(), options).join(); + /* validate.StringRules string = 14; */ + if (message.type.oneofKind === "string") + StringRules.internalBinaryWrite(message.type.string, writer.tag(14, WireType.LengthDelimited).fork(), options).join(); + /* validate.BytesRules bytes = 15; */ + if (message.type.oneofKind === "bytes") + BytesRules.internalBinaryWrite(message.type.bytes, writer.tag(15, WireType.LengthDelimited).fork(), options).join(); + /* validate.EnumRules enum = 16; */ + if (message.type.oneofKind === "enum") + EnumRules.internalBinaryWrite(message.type.enum, writer.tag(16, WireType.LengthDelimited).fork(), options).join(); + /* validate.RepeatedRules repeated = 18; */ + if (message.type.oneofKind === "repeated") + RepeatedRules.internalBinaryWrite(message.type.repeated, writer.tag(18, WireType.LengthDelimited).fork(), options).join(); + /* validate.MapRules map = 19; */ + if (message.type.oneofKind === "map") + MapRules.internalBinaryWrite(message.type.map, writer.tag(19, WireType.LengthDelimited).fork(), options).join(); + /* validate.AnyRules any = 20; */ + if (message.type.oneofKind === "any") + AnyRules.internalBinaryWrite(message.type.any, writer.tag(20, WireType.LengthDelimited).fork(), options).join(); + /* validate.DurationRules duration = 21; */ + if (message.type.oneofKind === "duration") + DurationRules.internalBinaryWrite(message.type.duration, writer.tag(21, WireType.LengthDelimited).fork(), options).join(); + /* validate.TimestampRules timestamp = 22; */ + if (message.type.oneofKind === "timestamp") + TimestampRules.internalBinaryWrite(message.type.timestamp, writer.tag(22, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message validate.FieldRules + */ +export const FieldRules = new FieldRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class FloatRules$Type extends MessageType { + constructor() { + super("validate.FloatRules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 2 /*ScalarType.FLOAT*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 2 /*ScalarType.FLOAT*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 2 /*ScalarType.FLOAT*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): FloatRules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FloatRules): FloatRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional float const */ 1: + message.const = reader.float(); + break; + case /* optional float lt */ 2: + message.lt = reader.float(); + break; + case /* optional float lte */ 3: + message.lte = reader.float(); + break; + case /* optional float gt */ 4: + message.gt = reader.float(); + break; + case /* optional float gte */ 5: + message.gte = reader.float(); + break; + case /* repeated float in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.float()); + else + message.in.push(reader.float()); + break; + case /* repeated float not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.float()); + else + message.notIn.push(reader.float()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; + } + internalBinaryWrite(message: FloatRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional float const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Bit32).float(message.const); + /* optional float lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Bit32).float(message.lt); + /* optional float lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Bit32).float(message.lte); + /* optional float gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Bit32).float(message.gt); + /* optional float gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Bit32).float(message.gte); + /* repeated float in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Bit32).float(message.in[i]); + /* repeated float not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Bit32).float(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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 }; +} +/** + * @generated MessageType for protobuf message validate.FloatRules + */ +export const FloatRules = new FloatRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DoubleRules$Type extends MessageType { + constructor() { + super("validate.DoubleRules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 1 /*ScalarType.DOUBLE*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): DoubleRules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DoubleRules): DoubleRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional double const */ 1: + message.const = reader.double(); + break; + case /* optional double lt */ 2: + message.lt = reader.double(); + break; + case /* optional double lte */ 3: + message.lte = reader.double(); + break; + case /* optional double gt */ 4: + message.gt = reader.double(); + break; + case /* optional double gte */ 5: + message.gte = reader.double(); + break; + case /* repeated double in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.double()); + else + message.in.push(reader.double()); + break; + case /* repeated double not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.double()); + else + message.notIn.push(reader.double()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - break; - } + return message; + } + internalBinaryWrite(message: DoubleRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional double const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Bit64).double(message.const); + /* optional double lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Bit64).double(message.lt); + /* optional double lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Bit64).double(message.lte); + /* optional double gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Bit64).double(message.gt); + /* optional double gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Bit64).double(message.gte); + /* repeated double in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Bit64).double(message.in[i]); + /* repeated double not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Bit64).double(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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()); +/** + * @generated MessageType for protobuf message validate.DoubleRules + */ +export const DoubleRules = new DoubleRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Int32Rules$Type extends MessageType { + constructor() { + super("validate.Int32Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): Int32Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int32Rules): Int32Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 const */ 1: + message.const = reader.int32(); + break; + case /* optional int32 lt */ 2: + message.lt = reader.int32(); + break; + case /* optional int32 lte */ 3: + message.lte = reader.int32(); + break; + case /* optional int32 gt */ 4: + message.gt = reader.int32(); + break; + case /* optional int32 gte */ 5: + message.gte = reader.int32(); + break; + case /* repeated int32 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.int32()); + else + message.in.push(reader.int32()); + break; + case /* repeated int32 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.int32()); + else + message.notIn.push(reader.int32()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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()); + return message; + } + internalBinaryWrite(message: Int32Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int32 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).int32(message.const); + /* optional int32 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Varint).int32(message.lt); + /* optional int32 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Varint).int32(message.lte); + /* optional int32 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Varint).int32(message.gt); + /* optional int32 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Varint).int32(message.gte); + /* repeated int32 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Varint).int32(message.in[i]); + /* repeated int32 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Varint).int32(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message validate.Int32Rules + */ +export const Int32Rules = new Int32Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Int64Rules$Type extends MessageType { + constructor() { + super("validate.Int64Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 3 /*ScalarType.INT64*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 3 /*ScalarType.INT64*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): Int64Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int64Rules): Int64Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int64 const */ 1: + message.const = reader.int64().toString(); + break; + case /* optional int64 lt */ 2: + message.lt = reader.int64().toString(); + break; + case /* optional int64 lte */ 3: + message.lte = reader.int64().toString(); + break; + case /* optional int64 gt */ 4: + message.gt = reader.int64().toString(); + break; + case /* optional int64 gte */ 5: + message.gte = reader.int64().toString(); + break; + case /* repeated int64 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.int64().toString()); + else + message.in.push(reader.int64().toString()); + break; + case /* repeated int64 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.int64().toString()); + else + message.notIn.push(reader.int64().toString()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); } - - 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 message; + } + internalBinaryWrite(message: Int64Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int64 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).int64(message.const); + /* optional int64 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Varint).int64(message.lt); + /* optional int64 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Varint).int64(message.lte); + /* optional int64 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Varint).int64(message.gt); + /* optional int64 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Varint).int64(message.gte); + /* repeated int64 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Varint).int64(message.in[i]); + /* repeated int64 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Varint).int64(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message validate.Int64Rules + */ +export const Int64Rules = new Int64Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UInt32Rules$Type extends MessageType { + constructor() { + super("validate.UInt32Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 13 /*ScalarType.UINT32*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 13 /*ScalarType.UINT32*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 13 /*ScalarType.UINT32*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): UInt32Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt32Rules): UInt32Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional uint32 const */ 1: + message.const = reader.uint32(); + break; + case /* optional uint32 lt */ 2: + message.lt = reader.uint32(); + break; + case /* optional uint32 lte */ 3: + message.lte = reader.uint32(); + break; + case /* optional uint32 gt */ 4: + message.gt = reader.uint32(); + break; + case /* optional uint32 gte */ 5: + message.gte = reader.uint32(); + break; + case /* repeated uint32 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.uint32()); + else + message.in.push(reader.uint32()); + break; + case /* repeated uint32 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.uint32()); + else + message.notIn.push(reader.uint32()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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; + return message; + } + internalBinaryWrite(message: UInt32Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional uint32 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).uint32(message.const); + /* optional uint32 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Varint).uint32(message.lt); + /* optional uint32 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Varint).uint32(message.lte); + /* optional uint32 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Varint).uint32(message.gt); + /* optional uint32 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Varint).uint32(message.gte); + /* repeated uint32 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Varint).uint32(message.in[i]); + /* repeated uint32 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Varint).uint32(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message validate.UInt32Rules + */ +export const UInt32Rules = new UInt32Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class UInt64Rules$Type extends MessageType { + constructor() { + super("validate.UInt64Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 4 /*ScalarType.UINT64*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 4 /*ScalarType.UINT64*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): UInt64Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: UInt64Rules): UInt64Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional uint64 const */ 1: + message.const = reader.uint64().toString(); + break; + case /* optional uint64 lt */ 2: + message.lt = reader.uint64().toString(); + break; + case /* optional uint64 lte */ 3: + message.lte = reader.uint64().toString(); + break; + case /* optional uint64 gt */ 4: + message.gt = reader.uint64().toString(); + break; + case /* optional uint64 gte */ 5: + message.gte = reader.uint64().toString(); + break; + case /* repeated uint64 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.uint64().toString()); + else + message.in.push(reader.uint64().toString()); + break; + case /* repeated uint64 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.uint64().toString()); + else + message.notIn.push(reader.uint64().toString()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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(); + return message; + } + internalBinaryWrite(message: UInt64Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional uint64 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).uint64(message.const); + /* optional uint64 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Varint).uint64(message.lt); + /* optional uint64 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Varint).uint64(message.lte); + /* optional uint64 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Varint).uint64(message.gt); + /* optional uint64 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Varint).uint64(message.gte); + /* repeated uint64 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Varint).uint64(message.in[i]); + /* repeated uint64 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Varint).uint64(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message validate.UInt64Rules + */ +export const UInt64Rules = new UInt64Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SInt32Rules$Type extends MessageType { + constructor() { + super("validate.SInt32Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 17 /*ScalarType.SINT32*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 17 /*ScalarType.SINT32*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 17 /*ScalarType.SINT32*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 17 /*ScalarType.SINT32*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 17 /*ScalarType.SINT32*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 17 /*ScalarType.SINT32*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 17 /*ScalarType.SINT32*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SInt32Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SInt32Rules): SInt32Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional sint32 const */ 1: + message.const = reader.sint32(); + break; + case /* optional sint32 lt */ 2: + message.lt = reader.sint32(); + break; + case /* optional sint32 lte */ 3: + message.lte = reader.sint32(); + break; + case /* optional sint32 gt */ 4: + message.gt = reader.sint32(); + break; + case /* optional sint32 gte */ 5: + message.gte = reader.sint32(); + break; + case /* repeated sint32 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.sint32()); + else + message.in.push(reader.sint32()); + break; + case /* repeated sint32 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.sint32()); + else + message.notIn.push(reader.sint32()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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(); + return message; + } + internalBinaryWrite(message: SInt32Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional sint32 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).sint32(message.const); + /* optional sint32 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Varint).sint32(message.lt); + /* optional sint32 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Varint).sint32(message.lte); + /* optional sint32 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Varint).sint32(message.gt); + /* optional sint32 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Varint).sint32(message.gte); + /* repeated sint32 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Varint).sint32(message.in[i]); + /* repeated sint32 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Varint).sint32(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message validate.SInt32Rules + */ +export const SInt32Rules = new SInt32Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SInt64Rules$Type extends MessageType { + constructor() { + super("validate.SInt64Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 18 /*ScalarType.SINT64*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 18 /*ScalarType.SINT64*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 18 /*ScalarType.SINT64*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 18 /*ScalarType.SINT64*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 18 /*ScalarType.SINT64*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 18 /*ScalarType.SINT64*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 18 /*ScalarType.SINT64*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SInt64Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SInt64Rules): SInt64Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional sint64 const */ 1: + message.const = reader.sint64().toString(); + break; + case /* optional sint64 lt */ 2: + message.lt = reader.sint64().toString(); + break; + case /* optional sint64 lte */ 3: + message.lte = reader.sint64().toString(); + break; + case /* optional sint64 gt */ 4: + message.gt = reader.sint64().toString(); + break; + case /* optional sint64 gte */ 5: + message.gte = reader.sint64().toString(); + break; + case /* repeated sint64 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.sint64().toString()); + else + message.in.push(reader.sint64().toString()); + break; + case /* repeated sint64 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.sint64().toString()); + else + message.notIn.push(reader.sint64().toString()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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 message; + } + internalBinaryWrite(message: SInt64Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional sint64 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).sint64(message.const); + /* optional sint64 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Varint).sint64(message.lt); + /* optional sint64 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Varint).sint64(message.lte); + /* optional sint64 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Varint).sint64(message.gt); + /* optional sint64 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Varint).sint64(message.gte); + /* repeated sint64 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Varint).sint64(message.in[i]); + /* repeated sint64 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Varint).sint64(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message validate.SInt64Rules + */ +export const SInt64Rules = new SInt64Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Fixed32Rules$Type extends MessageType { + constructor() { + super("validate.Fixed32Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 7 /*ScalarType.FIXED32*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 7 /*ScalarType.FIXED32*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 7 /*ScalarType.FIXED32*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 7 /*ScalarType.FIXED32*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 7 /*ScalarType.FIXED32*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 7 /*ScalarType.FIXED32*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 7 /*ScalarType.FIXED32*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): Fixed32Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Fixed32Rules): Fixed32Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional fixed32 const */ 1: + message.const = reader.fixed32(); + break; + case /* optional fixed32 lt */ 2: + message.lt = reader.fixed32(); + break; + case /* optional fixed32 lte */ 3: + message.lte = reader.fixed32(); + break; + case /* optional fixed32 gt */ 4: + message.gt = reader.fixed32(); + break; + case /* optional fixed32 gte */ 5: + message.gte = reader.fixed32(); + break; + case /* repeated fixed32 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.fixed32()); + else + message.in.push(reader.fixed32()); + break; + case /* repeated fixed32 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.fixed32()); + else + message.notIn.push(reader.fixed32()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - 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); + return message; + } + internalBinaryWrite(message: Fixed32Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional fixed32 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Bit32).fixed32(message.const); + /* optional fixed32 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Bit32).fixed32(message.lt); + /* optional fixed32 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Bit32).fixed32(message.lte); + /* optional fixed32 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Bit32).fixed32(message.gt); + /* optional fixed32 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Bit32).fixed32(message.gte); + /* repeated fixed32 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Bit32).fixed32(message.in[i]); + /* repeated fixed32 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Bit32).fixed32(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +/** + * @generated MessageType for protobuf message validate.Fixed32Rules + */ +export const Fixed32Rules = new Fixed32Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Fixed64Rules$Type extends MessageType { + constructor() { + super("validate.Fixed64Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 6 /*ScalarType.FIXED64*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 6 /*ScalarType.FIXED64*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 6 /*ScalarType.FIXED64*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 6 /*ScalarType.FIXED64*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 6 /*ScalarType.FIXED64*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 6 /*ScalarType.FIXED64*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 6 /*ScalarType.FIXED64*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): Fixed64Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Fixed64Rules): Fixed64Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional fixed64 const */ 1: + message.const = reader.fixed64().toString(); + break; + case /* optional fixed64 lt */ 2: + message.lt = reader.fixed64().toString(); + break; + case /* optional fixed64 lte */ 3: + message.lte = reader.fixed64().toString(); + break; + case /* optional fixed64 gt */ 4: + message.gt = reader.fixed64().toString(); + break; + case /* optional fixed64 gte */ 5: + message.gte = reader.fixed64().toString(); + break; + case /* repeated fixed64 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.fixed64().toString()); + else + message.in.push(reader.fixed64().toString()); + break; + case /* repeated fixed64 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.fixed64().toString()); + else + message.notIn.push(reader.fixed64().toString()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + return message; + } + internalBinaryWrite(message: Fixed64Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional fixed64 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Bit64).fixed64(message.const); + /* optional fixed64 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Bit64).fixed64(message.lt); + /* optional fixed64 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Bit64).fixed64(message.lte); + /* optional fixed64 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Bit64).fixed64(message.gt); + /* optional fixed64 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Bit64).fixed64(message.gte); + /* repeated fixed64 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Bit64).fixed64(message.in[i]); + /* repeated fixed64 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Bit64).fixed64(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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; +} +/** + * @generated MessageType for protobuf message validate.Fixed64Rules + */ +export const Fixed64Rules = new Fixed64Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SFixed32Rules$Type extends MessageType { + constructor() { + super("validate.SFixed32Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 15 /*ScalarType.SFIXED32*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 15 /*ScalarType.SFIXED32*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 15 /*ScalarType.SFIXED32*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 15 /*ScalarType.SFIXED32*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 15 /*ScalarType.SFIXED32*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 15 /*ScalarType.SFIXED32*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 15 /*ScalarType.SFIXED32*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SFixed32Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SFixed32Rules): SFixed32Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional sfixed32 const */ 1: + message.const = reader.sfixed32(); + break; + case /* optional sfixed32 lt */ 2: + message.lt = reader.sfixed32(); + break; + case /* optional sfixed32 lte */ 3: + message.lte = reader.sfixed32(); + break; + case /* optional sfixed32 gt */ 4: + message.gt = reader.sfixed32(); + break; + case /* optional sfixed32 gte */ 5: + message.gte = reader.sfixed32(); + break; + case /* repeated sfixed32 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.sfixed32()); + else + message.in.push(reader.sfixed32()); + break; + case /* repeated sfixed32 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.sfixed32()); + else + message.notIn.push(reader.sfixed32()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SFixed32Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional sfixed32 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Bit32).sfixed32(message.const); + /* optional sfixed32 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Bit32).sfixed32(message.lt); + /* optional sfixed32 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Bit32).sfixed32(message.lte); + /* optional sfixed32 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Bit32).sfixed32(message.gt); + /* optional sfixed32 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Bit32).sfixed32(message.gte); + /* repeated sfixed32 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Bit32).sfixed32(message.in[i]); + /* repeated sfixed32 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Bit32).sfixed32(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.const !== undefined) { - obj.const = message.const.toISOString(); +} +/** + * @generated MessageType for protobuf message validate.SFixed32Rules + */ +export const SFixed32Rules = new SFixed32Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SFixed64Rules$Type extends MessageType { + constructor() { + super("validate.SFixed64Rules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 16 /*ScalarType.SFIXED64*/ }, + { no: 2, name: "lt", kind: "scalar", opt: true, T: 16 /*ScalarType.SFIXED64*/ }, + { no: 3, name: "lte", kind: "scalar", opt: true, T: 16 /*ScalarType.SFIXED64*/ }, + { no: 4, name: "gt", kind: "scalar", opt: true, T: 16 /*ScalarType.SFIXED64*/ }, + { no: 5, name: "gte", kind: "scalar", opt: true, T: 16 /*ScalarType.SFIXED64*/ }, + { no: 6, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 16 /*ScalarType.SFIXED64*/ }, + { no: 7, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 16 /*ScalarType.SFIXED64*/ }, + { no: 8, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): SFixed64Rules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SFixed64Rules): SFixed64Rules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional sfixed64 const */ 1: + message.const = reader.sfixed64().toString(); + break; + case /* optional sfixed64 lt */ 2: + message.lt = reader.sfixed64().toString(); + break; + case /* optional sfixed64 lte */ 3: + message.lte = reader.sfixed64().toString(); + break; + case /* optional sfixed64 gt */ 4: + message.gt = reader.sfixed64().toString(); + break; + case /* optional sfixed64 gte */ 5: + message.gte = reader.sfixed64().toString(); + break; + case /* repeated sfixed64 in */ 6: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.sfixed64().toString()); + else + message.in.push(reader.sfixed64().toString()); + break; + case /* repeated sfixed64 not_in */ 7: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.sfixed64().toString()); + else + message.notIn.push(reader.sfixed64().toString()); + break; + case /* optional bool ignore_empty */ 8: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SFixed64Rules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional sfixed64 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Bit64).sfixed64(message.const); + /* optional sfixed64 lt = 2; */ + if (message.lt !== undefined) + writer.tag(2, WireType.Bit64).sfixed64(message.lt); + /* optional sfixed64 lte = 3; */ + if (message.lte !== undefined) + writer.tag(3, WireType.Bit64).sfixed64(message.lte); + /* optional sfixed64 gt = 4; */ + if (message.gt !== undefined) + writer.tag(4, WireType.Bit64).sfixed64(message.gt); + /* optional sfixed64 gte = 5; */ + if (message.gte !== undefined) + writer.tag(5, WireType.Bit64).sfixed64(message.gte); + /* repeated sfixed64 in = 6; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(6, WireType.Bit64).sfixed64(message.in[i]); + /* repeated sfixed64 not_in = 7; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(7, WireType.Bit64).sfixed64(message.notIn[i]); + /* optional bool ignore_empty = 8; */ + if (message.ignoreEmpty !== undefined) + writer.tag(8, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.lt !== undefined) { - obj.lt = message.lt.toISOString(); +} +/** + * @generated MessageType for protobuf message validate.SFixed64Rules + */ +export const SFixed64Rules = new SFixed64Rules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BoolRules$Type extends MessageType { + constructor() { + super("validate.BoolRules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): BoolRules { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BoolRules): BoolRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool const */ 1: + message.const = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.lte !== undefined) { - obj.lte = message.lte.toISOString(); + internalBinaryWrite(message: BoolRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).bool(message.const); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.gt !== undefined) { - obj.gt = message.gt.toISOString(); +} +/** + * @generated MessageType for protobuf message validate.BoolRules + */ +export const BoolRules = new BoolRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StringRules$Type extends MessageType { + constructor() { + super("validate.StringRules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 19, name: "len", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "min_len", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "max_len", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 20, name: "len_bytes", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "min_bytes", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 5, name: "max_bytes", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 6, name: "pattern", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "prefix", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 8, name: "suffix", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "contains", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 23, name: "not_contains", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 10, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 12, name: "email", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 13, name: "hostname", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 14, name: "ip", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 15, name: "ipv4", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 16, name: "ipv6", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 17, name: "uri", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 18, name: "uri_ref", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 21, name: "address", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 22, name: "uuid", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 24, name: "well_known_regex", kind: "enum", oneof: "wellKnown", T: () => ["validate.KnownRegex", KnownRegex] }, + { no: 25, name: "strict", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 26, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): StringRules { + const message = { in: [], notIn: [], wellKnown: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringRules): StringRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string const */ 1: + message.const = reader.string(); + break; + case /* optional uint64 len */ 19: + message.len = reader.uint64().toString(); + break; + case /* optional uint64 min_len */ 2: + message.minLen = reader.uint64().toString(); + break; + case /* optional uint64 max_len */ 3: + message.maxLen = reader.uint64().toString(); + break; + case /* optional uint64 len_bytes */ 20: + message.lenBytes = reader.uint64().toString(); + break; + case /* optional uint64 min_bytes */ 4: + message.minBytes = reader.uint64().toString(); + break; + case /* optional uint64 max_bytes */ 5: + message.maxBytes = reader.uint64().toString(); + break; + case /* optional string pattern */ 6: + message.pattern = reader.string(); + break; + case /* optional string prefix */ 7: + message.prefix = reader.string(); + break; + case /* optional string suffix */ 8: + message.suffix = reader.string(); + break; + case /* optional string contains */ 9: + message.contains = reader.string(); + break; + case /* optional string not_contains */ 23: + message.notContains = reader.string(); + break; + case /* repeated string in */ 10: + message.in.push(reader.string()); + break; + case /* repeated string not_in */ 11: + message.notIn.push(reader.string()); + break; + case /* bool email */ 12: + message.wellKnown = { + oneofKind: "email", + email: reader.bool() + }; + break; + case /* bool hostname */ 13: + message.wellKnown = { + oneofKind: "hostname", + hostname: reader.bool() + }; + break; + case /* bool ip */ 14: + message.wellKnown = { + oneofKind: "ip", + ip: reader.bool() + }; + break; + case /* bool ipv4 */ 15: + message.wellKnown = { + oneofKind: "ipv4", + ipv4: reader.bool() + }; + break; + case /* bool ipv6 */ 16: + message.wellKnown = { + oneofKind: "ipv6", + ipv6: reader.bool() + }; + break; + case /* bool uri */ 17: + message.wellKnown = { + oneofKind: "uri", + uri: reader.bool() + }; + break; + case /* bool uri_ref */ 18: + message.wellKnown = { + oneofKind: "uriRef", + uriRef: reader.bool() + }; + break; + case /* bool address */ 21: + message.wellKnown = { + oneofKind: "address", + address: reader.bool() + }; + break; + case /* bool uuid */ 22: + message.wellKnown = { + oneofKind: "uuid", + uuid: reader.bool() + }; + break; + case /* validate.KnownRegex well_known_regex */ 24: + message.wellKnown = { + oneofKind: "wellKnownRegex", + wellKnownRegex: reader.int32() + }; + break; + case /* optional bool strict */ 25: + message.strict = reader.bool(); + break; + case /* optional bool ignore_empty */ 26: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: StringRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.const); + /* optional uint64 len = 19; */ + if (message.len !== undefined) + writer.tag(19, WireType.Varint).uint64(message.len); + /* optional uint64 min_len = 2; */ + if (message.minLen !== undefined) + writer.tag(2, WireType.Varint).uint64(message.minLen); + /* optional uint64 max_len = 3; */ + if (message.maxLen !== undefined) + writer.tag(3, WireType.Varint).uint64(message.maxLen); + /* optional uint64 len_bytes = 20; */ + if (message.lenBytes !== undefined) + writer.tag(20, WireType.Varint).uint64(message.lenBytes); + /* optional uint64 min_bytes = 4; */ + if (message.minBytes !== undefined) + writer.tag(4, WireType.Varint).uint64(message.minBytes); + /* optional uint64 max_bytes = 5; */ + if (message.maxBytes !== undefined) + writer.tag(5, WireType.Varint).uint64(message.maxBytes); + /* optional string pattern = 6; */ + if (message.pattern !== undefined) + writer.tag(6, WireType.LengthDelimited).string(message.pattern); + /* optional string prefix = 7; */ + if (message.prefix !== undefined) + writer.tag(7, WireType.LengthDelimited).string(message.prefix); + /* optional string suffix = 8; */ + if (message.suffix !== undefined) + writer.tag(8, WireType.LengthDelimited).string(message.suffix); + /* optional string contains = 9; */ + if (message.contains !== undefined) + writer.tag(9, WireType.LengthDelimited).string(message.contains); + /* optional string not_contains = 23; */ + if (message.notContains !== undefined) + writer.tag(23, WireType.LengthDelimited).string(message.notContains); + /* repeated string in = 10; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(10, WireType.LengthDelimited).string(message.in[i]); + /* repeated string not_in = 11; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(11, WireType.LengthDelimited).string(message.notIn[i]); + /* bool email = 12; */ + if (message.wellKnown.oneofKind === "email") + writer.tag(12, WireType.Varint).bool(message.wellKnown.email); + /* bool hostname = 13; */ + if (message.wellKnown.oneofKind === "hostname") + writer.tag(13, WireType.Varint).bool(message.wellKnown.hostname); + /* bool ip = 14; */ + if (message.wellKnown.oneofKind === "ip") + writer.tag(14, WireType.Varint).bool(message.wellKnown.ip); + /* bool ipv4 = 15; */ + if (message.wellKnown.oneofKind === "ipv4") + writer.tag(15, WireType.Varint).bool(message.wellKnown.ipv4); + /* bool ipv6 = 16; */ + if (message.wellKnown.oneofKind === "ipv6") + writer.tag(16, WireType.Varint).bool(message.wellKnown.ipv6); + /* bool uri = 17; */ + if (message.wellKnown.oneofKind === "uri") + writer.tag(17, WireType.Varint).bool(message.wellKnown.uri); + /* bool uri_ref = 18; */ + if (message.wellKnown.oneofKind === "uriRef") + writer.tag(18, WireType.Varint).bool(message.wellKnown.uriRef); + /* bool address = 21; */ + if (message.wellKnown.oneofKind === "address") + writer.tag(21, WireType.Varint).bool(message.wellKnown.address); + /* bool uuid = 22; */ + if (message.wellKnown.oneofKind === "uuid") + writer.tag(22, WireType.Varint).bool(message.wellKnown.uuid); + /* validate.KnownRegex well_known_regex = 24; */ + if (message.wellKnown.oneofKind === "wellKnownRegex") + writer.tag(24, WireType.Varint).int32(message.wellKnown.wellKnownRegex); + /* optional bool strict = 25; */ + if (message.strict !== undefined) + writer.tag(25, WireType.Varint).bool(message.strict); + /* optional bool ignore_empty = 26; */ + if (message.ignoreEmpty !== undefined) + writer.tag(26, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.gte !== undefined) { - obj.gte = message.gte.toISOString(); +} +/** + * @generated MessageType for protobuf message validate.StringRules + */ +export const StringRules = new StringRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BytesRules$Type extends MessageType { + constructor() { + super("validate.BytesRules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 13, name: "len", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "min_len", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "max_len", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 4, name: "pattern", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "prefix", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 6, name: "suffix", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 7, name: "contains", kind: "scalar", opt: true, T: 12 /*ScalarType.BYTES*/ }, + { no: 8, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, + { no: 9, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 12 /*ScalarType.BYTES*/ }, + { no: 10, name: "ip", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 11, name: "ipv4", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 12, name: "ipv6", kind: "scalar", oneof: "wellKnown", T: 8 /*ScalarType.BOOL*/ }, + { no: 14, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): BytesRules { + const message = { in: [], notIn: [], wellKnown: { oneofKind: undefined } }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BytesRules): BytesRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bytes const */ 1: + message.const = reader.bytes(); + break; + case /* optional uint64 len */ 13: + message.len = reader.uint64().toString(); + break; + case /* optional uint64 min_len */ 2: + message.minLen = reader.uint64().toString(); + break; + case /* optional uint64 max_len */ 3: + message.maxLen = reader.uint64().toString(); + break; + case /* optional string pattern */ 4: + message.pattern = reader.string(); + break; + case /* optional bytes prefix */ 5: + message.prefix = reader.bytes(); + break; + case /* optional bytes suffix */ 6: + message.suffix = reader.bytes(); + break; + case /* optional bytes contains */ 7: + message.contains = reader.bytes(); + break; + case /* repeated bytes in */ 8: + message.in.push(reader.bytes()); + break; + case /* repeated bytes not_in */ 9: + message.notIn.push(reader.bytes()); + break; + case /* bool ip */ 10: + message.wellKnown = { + oneofKind: "ip", + ip: reader.bool() + }; + break; + case /* bool ipv4 */ 11: + message.wellKnown = { + oneofKind: "ipv4", + ipv4: reader.bool() + }; + break; + case /* bool ipv6 */ 12: + message.wellKnown = { + oneofKind: "ipv6", + ipv6: reader.bool() + }; + break; + case /* optional bool ignore_empty */ 14: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: BytesRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bytes const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.LengthDelimited).bytes(message.const); + /* optional uint64 len = 13; */ + if (message.len !== undefined) + writer.tag(13, WireType.Varint).uint64(message.len); + /* optional uint64 min_len = 2; */ + if (message.minLen !== undefined) + writer.tag(2, WireType.Varint).uint64(message.minLen); + /* optional uint64 max_len = 3; */ + if (message.maxLen !== undefined) + writer.tag(3, WireType.Varint).uint64(message.maxLen); + /* optional string pattern = 4; */ + if (message.pattern !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.pattern); + /* optional bytes prefix = 5; */ + if (message.prefix !== undefined) + writer.tag(5, WireType.LengthDelimited).bytes(message.prefix); + /* optional bytes suffix = 6; */ + if (message.suffix !== undefined) + writer.tag(6, WireType.LengthDelimited).bytes(message.suffix); + /* optional bytes contains = 7; */ + if (message.contains !== undefined) + writer.tag(7, WireType.LengthDelimited).bytes(message.contains); + /* repeated bytes in = 8; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(8, WireType.LengthDelimited).bytes(message.in[i]); + /* repeated bytes not_in = 9; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(9, WireType.LengthDelimited).bytes(message.notIn[i]); + /* bool ip = 10; */ + if (message.wellKnown.oneofKind === "ip") + writer.tag(10, WireType.Varint).bool(message.wellKnown.ip); + /* bool ipv4 = 11; */ + if (message.wellKnown.oneofKind === "ipv4") + writer.tag(11, WireType.Varint).bool(message.wellKnown.ipv4); + /* bool ipv6 = 12; */ + if (message.wellKnown.oneofKind === "ipv6") + writer.tag(12, WireType.Varint).bool(message.wellKnown.ipv6); + /* optional bool ignore_empty = 14; */ + if (message.ignoreEmpty !== undefined) + writer.tag(14, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.ltNow !== undefined && message.ltNow !== false) { - obj.ltNow = message.ltNow; +} +/** + * @generated MessageType for protobuf message validate.BytesRules + */ +export const BytesRules = new BytesRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumRules$Type extends MessageType { + constructor() { + super("validate.EnumRules", [ + { no: 1, name: "const", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "defined_only", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 3, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): EnumRules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumRules): EnumRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 const */ 1: + message.const = reader.int32(); + break; + case /* optional bool defined_only */ 2: + message.definedOnly = reader.bool(); + break; + case /* repeated int32 in */ 3: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.in.push(reader.int32()); + else + message.in.push(reader.int32()); + break; + case /* repeated int32 not_in */ 4: + if (wireType === WireType.LengthDelimited) + for (let e = reader.int32() + reader.pos; reader.pos < e;) + message.notIn.push(reader.int32()); + else + message.notIn.push(reader.int32()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: EnumRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int32 const = 1; */ + if (message.const !== undefined) + writer.tag(1, WireType.Varint).int32(message.const); + /* optional bool defined_only = 2; */ + if (message.definedOnly !== undefined) + writer.tag(2, WireType.Varint).bool(message.definedOnly); + /* repeated int32 in = 3; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(3, WireType.Varint).int32(message.in[i]); + /* repeated int32 not_in = 4; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(4, WireType.Varint).int32(message.notIn[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - if (message.gtNow !== undefined && message.gtNow !== false) { - obj.gtNow = message.gtNow; +} +/** + * @generated MessageType for protobuf message validate.EnumRules + */ +export const EnumRules = new EnumRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MessageRules$Type extends MessageType { + constructor() { + super("validate.MessageRules", [ + { no: 1, name: "skip", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "required", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): MessageRules { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MessageRules): MessageRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool skip */ 1: + message.skip = reader.bool(); + break; + case /* optional bool required */ 2: + message.required = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; } - if (message.within !== undefined) { - obj.within = Duration.toJSON(message.within); + internalBinaryWrite(message: MessageRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool skip = 1; */ + if (message.skip !== undefined) + writer.tag(1, WireType.Varint).bool(message.skip); + /* optional bool required = 2; */ + if (message.required !== undefined) + writer.tag(2, WireType.Varint).bool(message.required); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; } - 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); +/** + * @generated MessageType for protobuf message validate.MessageRules + */ +export const MessageRules = new MessageRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RepeatedRules$Type extends MessageType { + constructor() { + super("validate.RepeatedRules", [ + { no: 1, name: "min_items", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "max_items", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "unique", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "items", kind: "message", T: () => FieldRules }, + { no: 5, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): RepeatedRules { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RepeatedRules): RepeatedRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional uint64 min_items */ 1: + message.minItems = reader.uint64().toString(); + break; + case /* optional uint64 max_items */ 2: + message.maxItems = reader.uint64().toString(); + break; + case /* optional bool unique */ 3: + message.unique = reader.bool(); + break; + case /* optional validate.FieldRules items */ 4: + message.items = FieldRules.internalBinaryRead(reader, reader.uint32(), options, message.items); + break; + case /* optional bool ignore_empty */ 5: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: RepeatedRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional uint64 min_items = 1; */ + if (message.minItems !== undefined) + writer.tag(1, WireType.Varint).uint64(message.minItems); + /* optional uint64 max_items = 2; */ + if (message.maxItems !== undefined) + writer.tag(2, WireType.Varint).uint64(message.maxItems); + /* optional bool unique = 3; */ + if (message.unique !== undefined) + writer.tag(3, WireType.Varint).bool(message.unique); + /* optional validate.FieldRules items = 4; */ + if (message.items) + FieldRules.internalBinaryWrite(message.items, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* optional bool ignore_empty = 5; */ + if (message.ignoreEmpty !== undefined) + writer.tag(5, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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)); - } +/** + * @generated MessageType for protobuf message validate.RepeatedRules + */ +export const RepeatedRules = new RepeatedRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MapRules$Type extends MessageType { + constructor() { + super("validate.MapRules", [ + { no: 1, name: "min_pairs", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 2, name: "max_pairs", kind: "scalar", opt: true, T: 4 /*ScalarType.UINT64*/ }, + { no: 3, name: "no_sparse", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "keys", kind: "message", T: () => FieldRules }, + { no: 5, name: "values", kind: "message", T: () => FieldRules }, + { no: 6, name: "ignore_empty", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): MapRules { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MapRules): MapRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional uint64 min_pairs */ 1: + message.minPairs = reader.uint64().toString(); + break; + case /* optional uint64 max_pairs */ 2: + message.maxPairs = reader.uint64().toString(); + break; + case /* optional bool no_sparse */ 3: + message.noSparse = reader.bool(); + break; + case /* optional validate.FieldRules keys */ 4: + message.keys = FieldRules.internalBinaryRead(reader, reader.uint32(), options, message.keys); + break; + case /* optional validate.FieldRules values */ 5: + message.values = FieldRules.internalBinaryRead(reader, reader.uint32(), options, message.values); + break; + case /* optional bool ignore_empty */ 6: + message.ignoreEmpty = reader.bool(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: MapRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional uint64 min_pairs = 1; */ + if (message.minPairs !== undefined) + writer.tag(1, WireType.Varint).uint64(message.minPairs); + /* optional uint64 max_pairs = 2; */ + if (message.maxPairs !== undefined) + writer.tag(2, WireType.Varint).uint64(message.maxPairs); + /* optional bool no_sparse = 3; */ + if (message.noSparse !== undefined) + writer.tag(3, WireType.Varint).bool(message.noSparse); + /* optional validate.FieldRules keys = 4; */ + if (message.keys) + FieldRules.internalBinaryWrite(message.keys, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* optional validate.FieldRules values = 5; */ + if (message.values) + FieldRules.internalBinaryWrite(message.values, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* optional bool ignore_empty = 6; */ + if (message.ignoreEmpty !== undefined) + writer.tag(6, WireType.Varint).bool(message.ignoreEmpty); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -function numberToLong(number: number) { - return Long.fromNumber(number); +/** + * @generated MessageType for protobuf message validate.MapRules + */ +export const MapRules = new MapRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class AnyRules$Type extends MessageType { + constructor() { + super("validate.AnyRules", [ + { no: 1, name: "required", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "not_in", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): AnyRules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AnyRules): AnyRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool required */ 1: + message.required = reader.bool(); + break; + case /* repeated string in */ 2: + message.in.push(reader.string()); + break; + case /* repeated string not_in */ 3: + message.notIn.push(reader.string()); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: AnyRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool required = 1; */ + if (message.required !== undefined) + writer.tag(1, WireType.Varint).bool(message.required); + /* repeated string in = 2; */ + for (let i = 0; i < message.in.length; i++) + writer.tag(2, WireType.LengthDelimited).string(message.in[i]); + /* repeated string not_in = 3; */ + for (let i = 0; i < message.notIn.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.notIn[i]); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -function isSet(value: any): boolean { - return value !== null && value !== undefined; +/** + * @generated MessageType for protobuf message validate.AnyRules + */ +export const AnyRules = new AnyRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DurationRules$Type extends MessageType { + constructor() { + super("validate.DurationRules", [ + { no: 1, name: "required", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "const", kind: "message", T: () => Duration }, + { no: 3, name: "lt", kind: "message", T: () => Duration }, + { no: 4, name: "lte", kind: "message", T: () => Duration }, + { no: 5, name: "gt", kind: "message", T: () => Duration }, + { no: 6, name: "gte", kind: "message", T: () => Duration }, + { no: 7, name: "in", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Duration }, + { no: 8, name: "not_in", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Duration } + ]); + } + create(value?: PartialMessage): DurationRules { + const message = { in: [], notIn: [] }; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DurationRules): DurationRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool required */ 1: + message.required = reader.bool(); + break; + case /* optional google.protobuf.Duration const */ 2: + message.const = Duration.internalBinaryRead(reader, reader.uint32(), options, message.const); + break; + case /* optional google.protobuf.Duration lt */ 3: + message.lt = Duration.internalBinaryRead(reader, reader.uint32(), options, message.lt); + break; + case /* optional google.protobuf.Duration lte */ 4: + message.lte = Duration.internalBinaryRead(reader, reader.uint32(), options, message.lte); + break; + case /* optional google.protobuf.Duration gt */ 5: + message.gt = Duration.internalBinaryRead(reader, reader.uint32(), options, message.gt); + break; + case /* optional google.protobuf.Duration gte */ 6: + message.gte = Duration.internalBinaryRead(reader, reader.uint32(), options, message.gte); + break; + case /* repeated google.protobuf.Duration in */ 7: + message.in.push(Duration.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.Duration not_in */ 8: + message.notIn.push(Duration.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DurationRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool required = 1; */ + if (message.required !== undefined) + writer.tag(1, WireType.Varint).bool(message.required); + /* optional google.protobuf.Duration const = 2; */ + if (message.const) + Duration.internalBinaryWrite(message.const, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Duration lt = 3; */ + if (message.lt) + Duration.internalBinaryWrite(message.lt, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Duration lte = 4; */ + if (message.lte) + Duration.internalBinaryWrite(message.lte, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Duration gt = 5; */ + if (message.gt) + Duration.internalBinaryWrite(message.gt, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Duration gte = 6; */ + if (message.gte) + Duration.internalBinaryWrite(message.gte, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.Duration in = 7; */ + for (let i = 0; i < message.in.length; i++) + Duration.internalBinaryWrite(message.in[i], writer.tag(7, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.Duration not_in = 8; */ + for (let i = 0; i < message.notIn.length; i++) + Duration.internalBinaryWrite(message.notIn[i], writer.tag(8, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } - -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; +/** + * @generated MessageType for protobuf message validate.DurationRules + */ +export const DurationRules = new DurationRules$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class TimestampRules$Type extends MessageType { + constructor() { + super("validate.TimestampRules", [ + { no: 1, name: "required", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 2, name: "const", kind: "message", T: () => Timestamp }, + { no: 3, name: "lt", kind: "message", T: () => Timestamp }, + { no: 4, name: "lte", kind: "message", T: () => Timestamp }, + { no: 5, name: "gt", kind: "message", T: () => Timestamp }, + { no: 6, name: "gte", kind: "message", T: () => Timestamp }, + { no: 7, name: "lt_now", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 8, name: "gt_now", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "within", kind: "message", T: () => Duration } + ]); + } + create(value?: PartialMessage): TimestampRules { + const message = {}; + globalThis.Object.defineProperty(message, MESSAGE_TYPE, { enumerable: false, value: this }); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TimestampRules): TimestampRules { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional bool required */ 1: + message.required = reader.bool(); + break; + case /* optional google.protobuf.Timestamp const */ 2: + message.const = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.const); + break; + case /* optional google.protobuf.Timestamp lt */ 3: + message.lt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lt); + break; + case /* optional google.protobuf.Timestamp lte */ 4: + message.lte = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.lte); + break; + case /* optional google.protobuf.Timestamp gt */ 5: + message.gt = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.gt); + break; + case /* optional google.protobuf.Timestamp gte */ 6: + message.gte = Timestamp.internalBinaryRead(reader, reader.uint32(), options, message.gte); + break; + case /* optional bool lt_now */ 7: + message.ltNow = reader.bool(); + break; + case /* optional bool gt_now */ 8: + message.gtNow = reader.bool(); + break; + case /* optional google.protobuf.Duration within */ 9: + message.within = Duration.internalBinaryRead(reader, reader.uint32(), options, message.within); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: TimestampRules, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional bool required = 1; */ + if (message.required !== undefined) + writer.tag(1, WireType.Varint).bool(message.required); + /* optional google.protobuf.Timestamp const = 2; */ + if (message.const) + Timestamp.internalBinaryWrite(message.const, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Timestamp lt = 3; */ + if (message.lt) + Timestamp.internalBinaryWrite(message.lt, writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Timestamp lte = 4; */ + if (message.lte) + Timestamp.internalBinaryWrite(message.lte, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Timestamp gt = 5; */ + if (message.gt) + Timestamp.internalBinaryWrite(message.gt, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.Timestamp gte = 6; */ + if (message.gte) + Timestamp.internalBinaryWrite(message.gte, writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* optional bool lt_now = 7; */ + if (message.ltNow !== undefined) + writer.tag(7, WireType.Varint).bool(message.ltNow); + /* optional bool gt_now = 8; */ + if (message.gtNow !== undefined) + writer.tag(8, WireType.Varint).bool(message.gtNow); + /* optional google.protobuf.Duration within = 9; */ + if (message.within) + Duration.internalBinaryWrite(message.within, writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } } +/** + * @generated MessageType for protobuf message validate.TimestampRules + */ +export const TimestampRules = new TimestampRules$Type();