From c6344f1d3a76e4bff26cf4f71cdd52f2ac182762 Mon Sep 17 00:00:00 2001 From: ci viz model Date: Tue, 18 Mar 2025 15:51:18 +0000 Subject: [PATCH] Latest generation --- core/shared.ts | 3150 +++++++++++++++++++ core/unitOfMeasures.ts | 322 ++ counter.client.ts | 37 + counter.ts | 143 + google/api/field_behavior.ts | 77 + google/api/http.ts | 687 +++++ google/api/httpbody.ts | 155 + google/protobuf/any.ts | 319 ++ google/protobuf/api.ts | 515 ++++ google/protobuf/compiler/plugin.ts | 478 +++ google/protobuf/descriptor.ts | 3422 +++++++++++++++++++++ google/protobuf/duration.ts | 231 ++ google/protobuf/empty.ts | 95 + google/protobuf/field_mask.ts | 336 ++ google/protobuf/source_context.ts | 105 + google/protobuf/struct.ts | 482 +++ google/protobuf/timestamp.ts | 281 ++ google/protobuf/type.ts | 816 +++++ google/protobuf/wrappers.ts | 752 +++++ google/rpc/code.ts | 235 ++ google/rpc/error_details.ts | 1024 +++++++ google/rpc/status.ts | 170 + index.ts | 28 + openapiv2.ts | 2681 ++++++++++++++++ package.json | 4 +- validate.ts | 4434 +++++++++++++++++++++++++++ visibility.ts | 201 ++ viz-composed-field.client.ts | 89 + viz-composed-field.ts | 953 ++++++ viz-dashboard.client.ts | 128 + viz-dashboard.ts | 1261 ++++++++ viz-default-view.client.ts | 50 + viz-default-view.ts | 310 ++ viz-motd.client.ts | 89 + viz-motd.ts | 978 ++++++ viz-organisation-settings.client.ts | 89 + viz-organisation-settings.ts | 783 +++++ viz-project-settings.client.ts | 102 + viz-project-settings.ts | 833 +++++ viz-tab.client.ts | 37 + viz-tab.ts | 135 + viz-translations.client.ts | 110 + viz-translations.ts | 1193 +++++++ viz-user-settings.client.ts | 76 + viz-user-settings.ts | 574 ++++ viz-view.client.ts | 115 + viz-view.ts | 1599 ++++++++++ 47 files changed, 30682 insertions(+), 2 deletions(-) create mode 100644 core/shared.ts create mode 100644 core/unitOfMeasures.ts create mode 100644 counter.client.ts create mode 100644 counter.ts create mode 100644 google/api/field_behavior.ts create mode 100644 google/api/http.ts create mode 100644 google/api/httpbody.ts create mode 100644 google/protobuf/any.ts create mode 100644 google/protobuf/api.ts create mode 100644 google/protobuf/compiler/plugin.ts create mode 100644 google/protobuf/descriptor.ts create mode 100644 google/protobuf/duration.ts create mode 100644 google/protobuf/empty.ts create mode 100644 google/protobuf/field_mask.ts create mode 100644 google/protobuf/source_context.ts create mode 100644 google/protobuf/struct.ts create mode 100644 google/protobuf/timestamp.ts create mode 100644 google/protobuf/type.ts create mode 100644 google/protobuf/wrappers.ts create mode 100644 google/rpc/code.ts create mode 100644 google/rpc/error_details.ts create mode 100644 google/rpc/status.ts create mode 100644 index.ts create mode 100644 openapiv2.ts create mode 100644 validate.ts create mode 100644 visibility.ts create mode 100644 viz-composed-field.client.ts create mode 100644 viz-composed-field.ts create mode 100644 viz-dashboard.client.ts create mode 100644 viz-dashboard.ts create mode 100644 viz-default-view.client.ts create mode 100644 viz-default-view.ts create mode 100644 viz-motd.client.ts create mode 100644 viz-motd.ts create mode 100644 viz-organisation-settings.client.ts create mode 100644 viz-organisation-settings.ts create mode 100644 viz-project-settings.client.ts create mode 100644 viz-project-settings.ts create mode 100644 viz-tab.client.ts create mode 100644 viz-tab.ts create mode 100644 viz-translations.client.ts create mode 100644 viz-translations.ts create mode 100644 viz-user-settings.client.ts create mode 100644 viz-user-settings.ts create mode 100644 viz-view.client.ts create mode 100644 viz-view.ts diff --git a/core/shared.ts b/core/shared.ts new file mode 100644 index 0000000..4f49846 --- /dev/null +++ b/core/shared.ts @@ -0,0 +1,3150 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "core/shared.proto" (package "api", 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 { MessageType } from "@protobuf-ts/runtime"; +import { DimensionLess } from "./unitOfMeasures"; +import { Area } from "./unitOfMeasures"; +import { Weight } from "./unitOfMeasures"; +import { Volume } from "./unitOfMeasures"; +import { Length } from "./unitOfMeasures"; +// Deprecated Header for all requests on project resource + +/** + * @generated from protobuf message api.RequestHeader + */ +export interface RequestHeader { + /** + * @generated from protobuf field: string Project = 1 [json_name = "Project"]; + */ + project: string; // string Author = 2 [(validate.rules).string.min_len = 1]; + // string Sync = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "(Not use yet) Wait the event request to be applied"}]; +} +// Header for all requests on project resources + +/** + * Header for all requests on project resource + * + * @generated from protobuf message api.RequestProjectHeader + */ +export interface RequestProjectHeader { + /** + * @generated from protobuf field: string ProjectID = 1 [json_name = "ProjectID"]; + */ + projectID: string; +} +// Header for all requests on organisation resources + +/** + * Header for all requests on project resource + * + * @generated from protobuf message api.RequestOrganisationHeader + */ +export interface RequestOrganisationHeader { + /** + * @generated from protobuf field: string OrganisationID = 1 [json_name = "OrganisationID"]; + */ + organisationID: string; +} +/** + * Header for all requests on bucket resources + * + * @generated from protobuf message api.RequestBucketHeader + */ +export interface RequestBucketHeader { + /** + * @generated from protobuf field: string BucketID = 1 [json_name = "BucketID"]; + */ + bucketID: string; +} +/** + * Header for all requests on partnerApp resources + * + * @generated from protobuf message api.RequestPartnerAppHeader + */ +export interface RequestPartnerAppHeader { + /** + * @generated from protobuf field: string PartnerAppID = 1 [json_name = "PartnerAppID"]; + */ + partnerAppID: string; +} +/** + * Header for all response messages + * + * @generated from protobuf message api.ResponseHeader + */ +export interface ResponseHeader { +} +/** + * Header for all query messages + * + * @generated from protobuf message api.QueryHeader + */ +export interface QueryHeader { + /** + * @generated from protobuf field: string Project = 1 [json_name = "Project"]; + */ + project: string; + /** + * string Author = 2; + * + * @generated from protobuf field: string PagingState = 3 [json_name = "PagingState"]; + */ + pagingState: string; + /** + * @generated from protobuf field: string Limit = 4 [json_name = "Limit"]; + */ + limit: string; + /** + * @generated from protobuf field: bool LocalizedLabel = 5 [json_name = "LocalizedLabel"]; + */ + localizedLabel: boolean; +} +/** + * Header for all query project messages + * + * @generated from protobuf message api.QueryProjectHeader + */ +export interface QueryProjectHeader { + /** + * @generated from protobuf field: string ProjectID = 1 [json_name = "ProjectID"]; + */ + projectID: string; + /** + * @generated from protobuf field: string PagingState = 3 [json_name = "PagingState"]; + */ + pagingState: string; + /** + * @generated from protobuf field: string Limit = 4 [json_name = "Limit"]; + */ + limit: string; + /** + * @generated from protobuf field: bool LocalizedLabel = 5 [json_name = "LocalizedLabel"]; + */ + localizedLabel: boolean; +} +/** + * @generated from protobuf message api.ResultHeader + */ +export interface ResultHeader { + /** + * @generated from protobuf field: string PagingState = 1 [json_name = "PagingState"]; + */ + pagingState: string; +} +/** + * Header for all command messages + * + * @generated from protobuf message api.CommandHeader + */ +export interface CommandHeader { + /** + * @generated from protobuf field: string ActionCommand = 1 [json_name = "ActionCommand"]; + */ + actionCommand: string; + /** + * @generated from protobuf field: api.DateTime CommandTS = 2 [json_name = "CommandTS"]; + */ + commandTS?: DateTime; + /** + * @generated from protobuf field: string Project = 3 [json_name = "Project"]; + */ + project: string; + /** + * @generated from protobuf field: string FromDomain = 4 [json_name = "FromDomain"]; + */ + fromDomain: string; + /** + * @generated from protobuf field: string FromObject = 5 [json_name = "FromObject"]; + */ + fromObject: string; + /** + * @generated from protobuf field: string FromRule = 6 [json_name = "FromRule"]; + */ + fromRule: string; +} +/** + * Header for all event messages + * + * @generated from protobuf message api.EventHeader + */ +export interface EventHeader { + /** + * @generated from protobuf field: string InputEvent = 1 [json_name = "InputEvent"]; + */ + inputEvent: string; + /** + * @generated from protobuf field: api.DateTime EventTS = 2 [json_name = "EventTS"]; + */ + eventTS?: DateTime; + /** + * @generated from protobuf field: string Project = 3 [json_name = "Project"]; + */ + project: string; + /** + * @generated from protobuf field: string Author = 4 [json_name = "Author"]; + */ + author: string; + /** + * @generated from protobuf field: string EventID = 5 [json_name = "EventID"]; + */ + eventID: string; +} +/** + * Generic Object structures + * + * @generated from protobuf message api.EntityID + */ +export interface EntityID { + /** + * string UuID = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {read_only: true, description: "Internal identifier"}, (validate.rules).string.unauthorized = true]; + * + * @generated from protobuf field: string RefID = 2 [json_name = "RefID"]; + */ + refID: string; +} +/** + * @generated from protobuf message api.GenericObject + */ +export interface GenericObject { + /** + * @generated from protobuf field: api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"]; + */ + lastEventHeader?: EventHeader; + /** + * @generated from protobuf field: api.GenericObjectPayload Payload = 2 [json_name = "Payload"]; + */ + payload?: GenericObjectPayload; +} +/** + * @generated from protobuf message api.GenericObjectPayload + */ +export interface GenericObjectPayload { + /** + * @generated from protobuf field: api.EntityID ID = 1 [json_name = "ID"]; + */ + iD?: EntityID; +} +/** + * Common structures + * + * @generated from protobuf message api.DateTime + */ +export interface DateTime { + /** + * UTC date/time in ISO 8601 format with time zone (accepted tzd formats: [+01:00, -01:00, Z]) + * + * @generated from protobuf field: string DateTime = 1 [json_name = "DateTime"]; + */ + dateTime: string; + /** + * Time zone from where the author emits the event + * + * @generated from protobuf field: string AuthorTimeZone = 2 [json_name = "AuthorTimeZone"]; + */ + authorTimeZone: string; +} +/** + * @generated from protobuf message api.ValueType + */ +export interface ValueType { + /** + * @generated from protobuf oneof: ValueType + */ + valueType: { + oneofKind: "string"; + /** + * @generated from protobuf field: string String = 1 [json_name = "String"]; + */ + string: string; + } | { + oneofKind: "int"; + /** + * @generated from protobuf field: int64 Int = 2 [json_name = "Int"]; + */ + int: bigint; + } | { + oneofKind: "float"; + /** + * @generated from protobuf field: float Float = 3 [json_name = "Float"]; + */ + float: number; + } | { + oneofKind: "bool"; + /** + * @generated from protobuf field: bool Bool = 4 [json_name = "Bool"]; + */ + bool: boolean; + } | { + oneofKind: "timestamp"; + /** + * @generated from protobuf field: api.DateTime Timestamp = 5 [json_name = "Timestamp"]; + */ + timestamp: DateTime; + } | { + oneofKind: undefined; + }; +} +/** + * @generated from protobuf message api.QuantityLength + */ +export interface QuantityLength { + /** + * @generated from protobuf field: float Value = 1 [json_name = "Value"]; + */ + value: number; + /** + * @generated from protobuf field: api.Length Unit = 2 [json_name = "Unit"]; + */ + unit: Length; +} +/** + * @generated from protobuf message api.QuantityVolume + */ +export interface QuantityVolume { + /** + * @generated from protobuf field: float Value = 1 [json_name = "Value"]; + */ + value: number; + /** + * @generated from protobuf field: api.Volume Unit = 2 [json_name = "Unit"]; + */ + unit: Volume; +} +/** + * @generated from protobuf message api.QuantityWeight + */ +export interface QuantityWeight { + /** + * @generated from protobuf field: float Value = 1 [json_name = "Value"]; + */ + value: number; + /** + * @generated from protobuf field: api.Weight Unit = 2 [json_name = "Unit"]; + */ + unit: Weight; +} +/** + * @generated from protobuf message api.QuantityArea + */ +export interface QuantityArea { + /** + * @generated from protobuf field: float Value = 1 [json_name = "Value"]; + */ + value: number; + /** + * @generated from protobuf field: api.Area Unit = 2 [json_name = "Unit"]; + */ + unit: Area; +} +/** + * @generated from protobuf message api.QuantityUnit + */ +export interface QuantityUnit { + /** + * @generated from protobuf field: float Value = 1 [json_name = "Value"]; + */ + value: number; + /** + * @generated from protobuf field: api.DimensionLess Unit = 2 [json_name = "Unit"]; + */ + unit: DimensionLess; +} +/** + * Domain description + * + * RequestProjectHeader Header = 1; + * + * @generated from protobuf message api.DomainDescriptionRequest + */ +export interface DomainDescriptionRequest { +} +/** + * @generated from protobuf message api.DomainDescriptionResponse + */ +export interface DomainDescriptionResponse { + /** + * @generated from protobuf field: api.ResponseHeader Header = 1 [json_name = "Header"]; + */ + header?: ResponseHeader; + /** + * @generated from protobuf field: api.DomainDescription Payload = 2 [json_name = "Payload"]; + */ + payload?: DomainDescription; +} +/** + * @generated from protobuf message api.DomainDescription + */ +export interface DomainDescription { + /** + * @generated from protobuf field: string Name = 1 [json_name = "Name"]; + */ + name: string; + /** + * @generated from protobuf field: repeated api.ObjectDescription ObjectDescription = 2 [json_name = "ObjectDescription"]; + */ + objectDescription: ObjectDescription[]; +} +/** + * @generated from protobuf message api.ObjectDescription + */ +export interface ObjectDescription { + /** + * @generated from protobuf field: string Name = 1 [json_name = "Name"]; + */ + name: string; + /** + * @generated from protobuf field: repeated api.ObjectAction ApiAction = 2 [json_name = "ApiAction"]; + */ + apiAction: ObjectAction[]; + /** + * @generated from protobuf field: string PayloadJSON = 3 [json_name = "PayloadJSON"]; + */ + payloadJSON: string; + /** + * @generated from protobuf field: repeated api.ObjectAction ApiInput = 4 [json_name = "ApiInput"]; + */ + apiInput: ObjectAction[]; + /** + * @generated from protobuf field: repeated api.ObjectAction ApiQuery = 5 [json_name = "ApiQuery"]; + */ + apiQuery: ObjectAction[]; +} +/** + * @generated from protobuf message api.ObjectAction + */ +export interface ObjectAction { + /** + * @generated from protobuf field: string Name = 1 [json_name = "Name"]; + */ + name: string; + /** + * @generated from protobuf field: string JsonTemplate = 2 [json_name = "JsonTemplate"]; + */ + jsonTemplate: string; +} +/** + * * + * Message to store metadata definition + * + * @generated from protobuf message api.MetadataElement + */ +export interface MetadataElement { + /** + * @generated from protobuf field: string Key = 1 [json_name = "Key"]; + */ + key: string; + /** + * @generated from protobuf field: api.ValueType Value = 2 [json_name = "Value"]; + */ + value?: ValueType; +} +// +// Simple filter structure for Find query + +/** + * Filter on a simple value + * + * @generated from protobuf message api.SimpleFilter + */ +export interface SimpleFilter { + /** + * Filter path + * + * @generated from protobuf field: string Attribute = 1 [json_name = "Attribute"]; + */ + attribute: string; + /** + * Use this parameter if only one value + * + * @generated from protobuf field: string Value = 2 [json_name = "Value"]; + */ + value: string; + /** + * Use this parameter if more than one value + * + * @generated from protobuf field: repeated string Values = 3 [json_name = "Values"]; + */ + values: string[]; + /** + * \" EQUAL: 'EQUAL',  DIFF: 'DIFF',  START_BY: 'START_BY',  NOT_START_BY: 'NOT_START_BY',  FINISH_BY: 'FINISH_BY',  NOT_FINISH_BY: 'NOT_FINISH_BY',  CONTAINS: 'CONTAINS',  NOT_CONTAINS: 'NOT_CONTAINS'\" + * + * @generated from protobuf field: string Operator = 4 [json_name = "Operator"]; + */ + operator: string; + /** + * metadata's key + * + * @generated from protobuf field: string CombinedID = 5 [json_name = "CombinedID"]; + */ + combinedID: string; +} +/** + * + * Combined filter structure for Find query + * + * @generated from protobuf message api.CombinedFilter + */ +export interface CombinedFilter { + /** + * @generated from protobuf field: string Path = 1 [json_name = "Path"]; + */ + path: string; + /** + * Simple filter structure for Find query + * + * @generated from protobuf field: repeated api.SimpleFilter simpleFilters = 2; + */ + simpleFilters: SimpleFilter[]; + /** + * Range filter structure for Find query + * + * @generated from protobuf field: repeated api.RangeFilter rangeFilters = 3; + */ + rangeFilters: RangeFilter[]; + /** + * @generated from protobuf field: string CombinedID = 4 [json_name = "CombinedID"]; + */ + combinedID: string; +} +// +// Range filter structure for Find query + +/** + * Filter between two values + * + * @generated from protobuf message api.RangeFilter + */ +export interface RangeFilter { + /** + * Filter path + * + * @generated from protobuf field: string Attribute = 1 [json_name = "Attribute"]; + */ + attribute: string; + /** + * Maximum value + * + * @generated from protobuf field: string valueLt = 2; + */ + valueLt: string; + /** + * Minimum value + * + * @generated from protobuf field: string valueGt = 3; + */ + valueGt: string; + /** + * Metadata's key + * + * @generated from protobuf field: string CombinedID = 4 [json_name = "CombinedID"]; + */ + combinedID: string; +} +/** + * + * Block filter structure for Find query, each element (SimpleFilter, RangeFilter & BlockFilter) is an "AND" part of the query + * + * @generated from protobuf message api.BlockFilter + */ +export interface BlockFilter { + /** + * Simple filter structure for Find query + * + * @generated from protobuf field: repeated api.SimpleFilter simpleFilters = 1; + */ + simpleFilters: SimpleFilter[]; + /** + * Range filter structure for Find query + * + * @generated from protobuf field: repeated api.RangeFilter rangeFilters = 2; + */ + rangeFilters: RangeFilter[]; + /** + * block filter structure for Find query + * + * @generated from protobuf field: repeated api.BlockFilter BlockFilters = 3 [json_name = "BlockFilters"]; + */ + blockFilters: BlockFilter[]; +} +/** + * + * MatchField structure, for FindMatching query + * + * @generated from protobuf message api.MatchField + */ +export interface MatchField { + /** + * @generated from protobuf field: string Attribute = 1 [json_name = "Attribute"]; + */ + attribute: string; + /** + * @generated from protobuf field: string AttributeCombined = 2 [json_name = "AttributeCombined"]; + */ + attributeCombined: string; + /** + * @generated from protobuf field: string CombinedID = 3 [json_name = "CombinedID"]; + */ + combinedID: string; +} +/** + * + * structure containing error key & value + * + * @generated from protobuf message api.ErrorDetail + */ +export interface ErrorDetail { + /** + * @generated from protobuf field: string Key = 1 [json_name = "Key"]; + */ + key: string; + /** + * @generated from protobuf field: string Value = 2 [json_name = "Value"]; + */ + value: string; +} +/** + * + * Error message to be found in all rpc responses + * + * @generated from protobuf message api.Errors + */ +export interface Errors { + /** + * @generated from protobuf field: string ErrorCode = 1 [json_name = "ErrorCode"]; + */ + errorCode: string; // n1error code (xxyyzzzz) + /** + * @generated from protobuf field: string ErrorTrace = 2 [json_name = "ErrorTrace"]; + */ + errorTrace: string; // generated error code, for debugging purposes(in logs) + /** + * @generated from protobuf field: repeated api.ErrorDetail ErrorDetails = 3 [json_name = "ErrorDetails"]; + */ + errorDetails: ErrorDetail[]; + /** + * @generated from protobuf field: string ContextType = 4 [json_name = "ContextType"]; + */ + contextType: string; // Entity + /** + * @generated from protobuf field: string ContextProcess = 5 [json_name = "ContextProcess"]; + */ + contextProcess: string; // Method grpc + /** + * @generated from protobuf field: string ContextPayload = 6 [json_name = "ContextPayload"]; + */ + contextPayload: string; // Payload request +} +/** + * + * structure containing error key & value + * + * @generated from protobuf message api.ParamElement + */ +export interface ParamElement { + /** + * @generated from protobuf field: string Key = 1 [json_name = "Key"]; + */ + key: string; + /** + * string Value = 2; + * + * @generated from protobuf field: api.ValueType Value = 3 [json_name = "Value"]; + */ + value?: ValueType; +} +/** + * @generated from protobuf message api.LabelStructure + */ +export interface LabelStructure { + /** + * @generated from protobuf field: string Code = 1 [json_name = "Code"]; + */ + code: string; + /** + * @generated from protobuf field: string Label = 2 [json_name = "Label"]; + */ + label: string; + /** + * @generated from protobuf field: repeated api.ParamElement Params = 3 [json_name = "Params"]; + */ + params: ParamElement[]; // map of parameter to be put/replaced in the error label +} +// +// NATS + +/** + * @generated from protobuf message api.Credentials + */ +export interface Credentials { + /** + * @generated from protobuf field: string Jwt = 1 [json_name = "Jwt"]; + */ + jwt: string; + /** + * @generated from protobuf field: string Seed = 2 [json_name = "Seed"]; + */ + seed: string; +} +// +// basic messages (int, bool, string ,etc ) encapsulation inside a message +// we can use these message to escape default values of basic messages, and have the possibility to put an empty +// ex: not sending a string in a payload is the same as sending an empty string -> solution: use StringObject + +/** + * @generated from protobuf message api.Int32Object + */ +export interface Int32Object { + /** + * @generated from protobuf field: int32 Int32 = 1 [json_name = "Int32"]; + */ + int32: number; +} +/** + * @generated from protobuf message api.BoolObject + */ +export interface BoolObject { + /** + * @generated from protobuf field: bool Bool = 1 [json_name = "Bool"]; + */ + bool: boolean; +} +/** + * @generated from protobuf message api.StringObject + */ +export interface StringObject { + /** + * @generated from protobuf field: string String = 1 [json_name = "String"]; + */ + string: string; +} +/** + * @generated from protobuf message api.StringDateObject + */ +export interface StringDateObject { + /** + * UTC date/time in ISO 8601 format with time zone (accepted tzd formats: [+01:00, -01:00, Z]) + * + * @generated from protobuf field: string DateTime = 10 [json_name = "DateTime"]; + */ + dateTime: string; +} +/** + * @generated from protobuf enum api.ResponseStatus + */ +export enum ResponseStatus { + /** + * @generated from protobuf enum value: RESPONSESTATUS_UNKNOWN = 0; + */ + RESPONSESTATUS_UNKNOWN = 0, + /** + * @generated from protobuf enum value: OK = 1; + */ + OK = 1, + /** + * @generated from protobuf enum value: INTERNAL_ERROR = 2; + */ + INTERNAL_ERROR = 2, + /** + * @generated from protobuf enum value: PAYLOAD_INCORRECT = 3; + */ + PAYLOAD_INCORRECT = 3, + /** + * @generated from protobuf enum value: OBJECT_ID_NOT_FOUND = 4; + */ + OBJECT_ID_NOT_FOUND = 4, + /** + * @generated from protobuf enum value: PROJECT_NOT_FOUND = 5; + */ + PROJECT_NOT_FOUND = 5, + /** + * @generated from protobuf enum value: UNAUTHORIZED = 6; + */ + UNAUTHORIZED = 6, + /** + * @generated from protobuf enum value: TIMEOUT = 7; + */ + TIMEOUT = 7 +} +// @generated message type with reflection information, may provide speed optimized methods +class RequestHeader$Type extends MessageType { + constructor() { + super("api.RequestHeader", [ + { no: 1, name: "Project", kind: "scalar", jsonName: "Project", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the project" }, "validate.rules": { string: { minLen: "1", notContains: " " } } } } + ]); + } + create(value?: PartialMessage): RequestHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.project = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RequestHeader): RequestHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Project = 1 [json_name = "Project"];*/ 1: + message.project = 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: RequestHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Project = 1 [json_name = "Project"]; */ + if (message.project !== "") + writer.tag(1, WireType.LengthDelimited).string(message.project); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.RequestHeader + */ +export const RequestHeader = new RequestHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RequestProjectHeader$Type extends MessageType { + constructor() { + super("api.RequestProjectHeader", [ + { no: 1, name: "ProjectID", kind: "scalar", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the project" }, "validate.rules": { string: { minLen: "1", notContains: " " } } } } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Header for all requests on project resource", required: ["ProjectID"] } } }); + } + create(value?: PartialMessage): RequestProjectHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.projectID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RequestProjectHeader): RequestProjectHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string ProjectID = 1 [json_name = "ProjectID"];*/ 1: + message.projectID = 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: RequestProjectHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string ProjectID = 1 [json_name = "ProjectID"]; */ + if (message.projectID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.projectID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.RequestProjectHeader + */ +export const RequestProjectHeader = new RequestProjectHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RequestOrganisationHeader$Type extends MessageType { + constructor() { + super("api.RequestOrganisationHeader", [ + { no: 1, name: "OrganisationID", kind: "scalar", jsonName: "OrganisationID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the organisation" }, "validate.rules": { string: { minLen: "1", notContains: " " } } } } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Header for all requests on project resource", required: ["OrganisationID"] } } }); + } + create(value?: PartialMessage): RequestOrganisationHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.organisationID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RequestOrganisationHeader): RequestOrganisationHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string OrganisationID = 1 [json_name = "OrganisationID"];*/ 1: + message.organisationID = 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: RequestOrganisationHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string OrganisationID = 1 [json_name = "OrganisationID"]; */ + if (message.organisationID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.organisationID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.RequestOrganisationHeader + */ +export const RequestOrganisationHeader = new RequestOrganisationHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RequestBucketHeader$Type extends MessageType { + constructor() { + super("api.RequestBucketHeader", [ + { no: 1, name: "BucketID", kind: "scalar", jsonName: "BucketID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the bucket" }, "validate.rules": { string: { minLen: "1", notContains: " " } } } } + ]); + } + create(value?: PartialMessage): RequestBucketHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.bucketID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RequestBucketHeader): RequestBucketHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string BucketID = 1 [json_name = "BucketID"];*/ 1: + message.bucketID = 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: RequestBucketHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string BucketID = 1 [json_name = "BucketID"]; */ + if (message.bucketID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.bucketID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.RequestBucketHeader + */ +export const RequestBucketHeader = new RequestBucketHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RequestPartnerAppHeader$Type extends MessageType { + constructor() { + super("api.RequestPartnerAppHeader", [ + { no: 1, name: "PartnerAppID", kind: "scalar", jsonName: "PartnerAppID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the partnerApp" }, "validate.rules": { string: { minLen: "1", notContains: " " } } } } + ]); + } + create(value?: PartialMessage): RequestPartnerAppHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.partnerAppID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RequestPartnerAppHeader): RequestPartnerAppHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string PartnerAppID = 1 [json_name = "PartnerAppID"];*/ 1: + message.partnerAppID = 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: RequestPartnerAppHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string PartnerAppID = 1 [json_name = "PartnerAppID"]; */ + if (message.partnerAppID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.partnerAppID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.RequestPartnerAppHeader + */ +export const RequestPartnerAppHeader = new RequestPartnerAppHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ResponseHeader$Type extends MessageType { + constructor() { + super("api.ResponseHeader", []); + } + create(value?: PartialMessage): ResponseHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResponseHeader): ResponseHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ResponseHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ResponseHeader + */ +export const ResponseHeader = new ResponseHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryHeader$Type extends MessageType { + constructor() { + super("api.QueryHeader", [ + { no: 1, name: "Project", kind: "scalar", jsonName: "Project", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", notContains: " " } } } }, + { no: 3, name: "PagingState", kind: "scalar", jsonName: "PagingState", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "Limit", kind: "scalar", jsonName: "Limit", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "LocalizedLabel", kind: "scalar", jsonName: "LocalizedLabel", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): QueryHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.project = ""; + message.pagingState = ""; + message.limit = ""; + message.localizedLabel = false; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryHeader): QueryHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Project = 1 [json_name = "Project"];*/ 1: + message.project = reader.string(); + break; + case /* string PagingState = 3 [json_name = "PagingState"];*/ 3: + message.pagingState = reader.string(); + break; + case /* string Limit = 4 [json_name = "Limit"];*/ 4: + message.limit = reader.string(); + break; + case /* bool LocalizedLabel = 5 [json_name = "LocalizedLabel"];*/ 5: + message.localizedLabel = 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: QueryHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Project = 1 [json_name = "Project"]; */ + if (message.project !== "") + writer.tag(1, WireType.LengthDelimited).string(message.project); + /* string PagingState = 3 [json_name = "PagingState"]; */ + if (message.pagingState !== "") + writer.tag(3, WireType.LengthDelimited).string(message.pagingState); + /* string Limit = 4 [json_name = "Limit"]; */ + if (message.limit !== "") + writer.tag(4, WireType.LengthDelimited).string(message.limit); + /* bool LocalizedLabel = 5 [json_name = "LocalizedLabel"]; */ + if (message.localizedLabel !== false) + writer.tag(5, WireType.Varint).bool(message.localizedLabel); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.QueryHeader + */ +export const QueryHeader = new QueryHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QueryProjectHeader$Type extends MessageType { + constructor() { + super("api.QueryProjectHeader", [ + { no: 1, name: "ProjectID", kind: "scalar", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Identifier of the project" }, "validate.rules": { string: { minLen: "1", notContains: " " } } } }, + { no: 3, name: "PagingState", kind: "scalar", jsonName: "PagingState", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "Limit", kind: "scalar", jsonName: "Limit", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "LocalizedLabel", kind: "scalar", jsonName: "LocalizedLabel", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): QueryProjectHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.projectID = ""; + message.pagingState = ""; + message.limit = ""; + message.localizedLabel = false; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QueryProjectHeader): QueryProjectHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string ProjectID = 1 [json_name = "ProjectID"];*/ 1: + message.projectID = reader.string(); + break; + case /* string PagingState = 3 [json_name = "PagingState"];*/ 3: + message.pagingState = reader.string(); + break; + case /* string Limit = 4 [json_name = "Limit"];*/ 4: + message.limit = reader.string(); + break; + case /* bool LocalizedLabel = 5 [json_name = "LocalizedLabel"];*/ 5: + message.localizedLabel = 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: QueryProjectHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string ProjectID = 1 [json_name = "ProjectID"]; */ + if (message.projectID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.projectID); + /* string PagingState = 3 [json_name = "PagingState"]; */ + if (message.pagingState !== "") + writer.tag(3, WireType.LengthDelimited).string(message.pagingState); + /* string Limit = 4 [json_name = "Limit"]; */ + if (message.limit !== "") + writer.tag(4, WireType.LengthDelimited).string(message.limit); + /* bool LocalizedLabel = 5 [json_name = "LocalizedLabel"]; */ + if (message.localizedLabel !== false) + writer.tag(5, WireType.Varint).bool(message.localizedLabel); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.QueryProjectHeader + */ +export const QueryProjectHeader = new QueryProjectHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ResultHeader$Type extends MessageType { + constructor() { + super("api.ResultHeader", [ + { no: 1, name: "PagingState", kind: "scalar", jsonName: "PagingState", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ResultHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.pagingState = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ResultHeader): ResultHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string PagingState = 1 [json_name = "PagingState"];*/ 1: + message.pagingState = 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: ResultHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string PagingState = 1 [json_name = "PagingState"]; */ + if (message.pagingState !== "") + writer.tag(1, WireType.LengthDelimited).string(message.pagingState); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ResultHeader + */ +export const ResultHeader = new ResultHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CommandHeader$Type extends MessageType { + constructor() { + super("api.CommandHeader", [ + { no: 1, name: "ActionCommand", kind: "scalar", jsonName: "ActionCommand", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "CommandTS", kind: "message", jsonName: "CommandTS", T: () => DateTime }, + { no: 3, name: "Project", kind: "scalar", jsonName: "Project", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "FromDomain", kind: "scalar", jsonName: "FromDomain", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "FromObject", kind: "scalar", jsonName: "FromObject", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "FromRule", kind: "scalar", jsonName: "FromRule", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): CommandHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.actionCommand = ""; + message.project = ""; + message.fromDomain = ""; + message.fromObject = ""; + message.fromRule = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CommandHeader): CommandHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string ActionCommand = 1 [json_name = "ActionCommand"];*/ 1: + message.actionCommand = reader.string(); + break; + case /* api.DateTime CommandTS = 2 [json_name = "CommandTS"];*/ 2: + message.commandTS = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.commandTS); + break; + case /* string Project = 3 [json_name = "Project"];*/ 3: + message.project = reader.string(); + break; + case /* string FromDomain = 4 [json_name = "FromDomain"];*/ 4: + message.fromDomain = reader.string(); + break; + case /* string FromObject = 5 [json_name = "FromObject"];*/ 5: + message.fromObject = reader.string(); + break; + case /* string FromRule = 6 [json_name = "FromRule"];*/ 6: + message.fromRule = 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: CommandHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string ActionCommand = 1 [json_name = "ActionCommand"]; */ + if (message.actionCommand !== "") + writer.tag(1, WireType.LengthDelimited).string(message.actionCommand); + /* api.DateTime CommandTS = 2 [json_name = "CommandTS"]; */ + if (message.commandTS) + DateTime.internalBinaryWrite(message.commandTS, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string Project = 3 [json_name = "Project"]; */ + if (message.project !== "") + writer.tag(3, WireType.LengthDelimited).string(message.project); + /* string FromDomain = 4 [json_name = "FromDomain"]; */ + if (message.fromDomain !== "") + writer.tag(4, WireType.LengthDelimited).string(message.fromDomain); + /* string FromObject = 5 [json_name = "FromObject"]; */ + if (message.fromObject !== "") + writer.tag(5, WireType.LengthDelimited).string(message.fromObject); + /* string FromRule = 6 [json_name = "FromRule"]; */ + if (message.fromRule !== "") + writer.tag(6, WireType.LengthDelimited).string(message.fromRule); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.CommandHeader + */ +export const CommandHeader = new CommandHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EventHeader$Type extends MessageType { + constructor() { + super("api.EventHeader", [ + { no: 1, name: "InputEvent", kind: "scalar", jsonName: "InputEvent", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 2, name: "EventTS", kind: "message", jsonName: "EventTS", T: () => DateTime, options: { "validate.rules": { message: { required: true } } } }, + { no: 3, name: "Project", kind: "scalar", jsonName: "Project", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1", notContains: " " } } } }, + { no: 4, name: "Author", kind: "scalar", jsonName: "Author", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 5, name: "EventID", kind: "scalar", jsonName: "EventID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } } + ]); + } + create(value?: PartialMessage): EventHeader { + const message = globalThis.Object.create((this.messagePrototype!)); + message.inputEvent = ""; + message.project = ""; + message.author = ""; + message.eventID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EventHeader): EventHeader { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string InputEvent = 1 [json_name = "InputEvent"];*/ 1: + message.inputEvent = reader.string(); + break; + case /* api.DateTime EventTS = 2 [json_name = "EventTS"];*/ 2: + message.eventTS = DateTime.internalBinaryRead(reader, reader.uint32(), options, message.eventTS); + break; + case /* string Project = 3 [json_name = "Project"];*/ 3: + message.project = reader.string(); + break; + case /* string Author = 4 [json_name = "Author"];*/ 4: + message.author = reader.string(); + break; + case /* string EventID = 5 [json_name = "EventID"];*/ 5: + message.eventID = 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: EventHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string InputEvent = 1 [json_name = "InputEvent"]; */ + if (message.inputEvent !== "") + writer.tag(1, WireType.LengthDelimited).string(message.inputEvent); + /* api.DateTime EventTS = 2 [json_name = "EventTS"]; */ + if (message.eventTS) + DateTime.internalBinaryWrite(message.eventTS, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string Project = 3 [json_name = "Project"]; */ + if (message.project !== "") + writer.tag(3, WireType.LengthDelimited).string(message.project); + /* string Author = 4 [json_name = "Author"]; */ + if (message.author !== "") + writer.tag(4, WireType.LengthDelimited).string(message.author); + /* string EventID = 5 [json_name = "EventID"]; */ + if (message.eventID !== "") + writer.tag(5, WireType.LengthDelimited).string(message.eventID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.EventHeader + */ +export const EventHeader = new EventHeader$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EntityID$Type extends MessageType { + constructor() { + super("api.EntityID", [ + { no: 2, name: "RefID", kind: "scalar", jsonName: "RefID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Your identifier" }, "validate.rules": { string: { minLen: "1" } } } } + ]); + } + create(value?: PartialMessage): EntityID { + const message = globalThis.Object.create((this.messagePrototype!)); + message.refID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EntityID): EntityID { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string RefID = 2 [json_name = "RefID"];*/ 2: + message.refID = 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: EntityID, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string RefID = 2 [json_name = "RefID"]; */ + if (message.refID !== "") + writer.tag(2, WireType.LengthDelimited).string(message.refID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.EntityID + */ +export const EntityID = new EntityID$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GenericObject$Type extends MessageType { + constructor() { + super("api.GenericObject", [ + { no: 1, name: "LastEventHeader", kind: "message", jsonName: "LastEventHeader", T: () => EventHeader }, + { no: 2, name: "Payload", kind: "message", jsonName: "Payload", T: () => GenericObjectPayload } + ]); + } + create(value?: PartialMessage): GenericObject { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GenericObject): GenericObject { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"];*/ 1: + message.lastEventHeader = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.lastEventHeader); + break; + case /* api.GenericObjectPayload Payload = 2 [json_name = "Payload"];*/ 2: + message.payload = GenericObjectPayload.internalBinaryRead(reader, reader.uint32(), options, message.payload); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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: GenericObject, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"]; */ + if (message.lastEventHeader) + EventHeader.internalBinaryWrite(message.lastEventHeader, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* api.GenericObjectPayload Payload = 2 [json_name = "Payload"]; */ + if (message.payload) + GenericObjectPayload.internalBinaryWrite(message.payload, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.GenericObject + */ +export const GenericObject = new GenericObject$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class GenericObjectPayload$Type extends MessageType { + constructor() { + super("api.GenericObjectPayload", [ + { no: 1, name: "ID", kind: "message", jsonName: "ID", T: () => EntityID } + ]); + } + create(value?: PartialMessage): GenericObjectPayload { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GenericObjectPayload): GenericObjectPayload { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* api.EntityID ID = 1 [json_name = "ID"];*/ 1: + message.iD = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.iD); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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: GenericObjectPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* api.EntityID ID = 1 [json_name = "ID"]; */ + if (message.iD) + EntityID.internalBinaryWrite(message.iD, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.GenericObjectPayload + */ +export const GenericObjectPayload = new GenericObjectPayload$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DateTime$Type extends MessageType { + constructor() { + super("api.DateTime", [ + { no: 1, name: "DateTime", kind: "scalar", jsonName: "DateTime", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "UTC date/time in ISO 8601 format with time zone (accepted tzd formats: [+01:00, -01:00, Z])", example: "2020-11-26T21:32:52+02:00" }, "validate.rules": { string: { dateIso8601: true } }, "api.kpi": true } }, + { no: 2, name: "AuthorTimeZone", kind: "scalar", jsonName: "AuthorTimeZone", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Time zone from where the author emits the event", example: "Europe/Paris" }, "validate.rules": { string: { tzData: true } } } } + ]); + } + create(value?: PartialMessage): DateTime { + const message = globalThis.Object.create((this.messagePrototype!)); + message.dateTime = ""; + message.authorTimeZone = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DateTime): DateTime { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string DateTime = 1 [json_name = "DateTime"];*/ 1: + message.dateTime = reader.string(); + break; + case /* string AuthorTimeZone = 2 [json_name = "AuthorTimeZone"];*/ 2: + message.authorTimeZone = 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: DateTime, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string DateTime = 1 [json_name = "DateTime"]; */ + if (message.dateTime !== "") + writer.tag(1, WireType.LengthDelimited).string(message.dateTime); + /* string AuthorTimeZone = 2 [json_name = "AuthorTimeZone"]; */ + if (message.authorTimeZone !== "") + writer.tag(2, WireType.LengthDelimited).string(message.authorTimeZone); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.DateTime + */ +export const DateTime = new DateTime$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ValueType$Type extends MessageType { + constructor() { + super("api.ValueType", [ + { no: 1, name: "String", kind: "scalar", jsonName: "String", oneof: "valueType", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "Int", kind: "scalar", jsonName: "Int", oneof: "valueType", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { no: 3, name: "Float", kind: "scalar", jsonName: "Float", oneof: "valueType", T: 2 /*ScalarType.FLOAT*/ }, + { no: 4, name: "Bool", kind: "scalar", jsonName: "Bool", oneof: "valueType", T: 8 /*ScalarType.BOOL*/ }, + { no: 5, name: "Timestamp", kind: "message", jsonName: "Timestamp", oneof: "valueType", T: () => DateTime } + ]); + } + create(value?: PartialMessage): ValueType { + const message = globalThis.Object.create((this.messagePrototype!)); + message.valueType = { oneofKind: undefined }; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ValueType): ValueType { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string String = 1 [json_name = "String"];*/ 1: + message.valueType = { + oneofKind: "string", + string: reader.string() + }; + break; + case /* int64 Int = 2 [json_name = "Int"];*/ 2: + message.valueType = { + oneofKind: "int", + int: reader.int64().toBigInt() + }; + break; + case /* float Float = 3 [json_name = "Float"];*/ 3: + message.valueType = { + oneofKind: "float", + float: reader.float() + }; + break; + case /* bool Bool = 4 [json_name = "Bool"];*/ 4: + message.valueType = { + oneofKind: "bool", + bool: reader.bool() + }; + break; + case /* api.DateTime Timestamp = 5 [json_name = "Timestamp"];*/ 5: + message.valueType = { + oneofKind: "timestamp", + timestamp: DateTime.internalBinaryRead(reader, reader.uint32(), options, (message.valueType 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); + } + } + return message; + } + internalBinaryWrite(message: ValueType, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string String = 1 [json_name = "String"]; */ + if (message.valueType.oneofKind === "string") + writer.tag(1, WireType.LengthDelimited).string(message.valueType.string); + /* int64 Int = 2 [json_name = "Int"]; */ + if (message.valueType.oneofKind === "int") + writer.tag(2, WireType.Varint).int64(message.valueType.int); + /* float Float = 3 [json_name = "Float"]; */ + if (message.valueType.oneofKind === "float") + writer.tag(3, WireType.Bit32).float(message.valueType.float); + /* bool Bool = 4 [json_name = "Bool"]; */ + if (message.valueType.oneofKind === "bool") + writer.tag(4, WireType.Varint).bool(message.valueType.bool); + /* api.DateTime Timestamp = 5 [json_name = "Timestamp"]; */ + if (message.valueType.oneofKind === "timestamp") + DateTime.internalBinaryWrite(message.valueType.timestamp, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ValueType + */ +export const ValueType = new ValueType$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QuantityLength$Type extends MessageType { + constructor() { + super("api.QuantityLength", [ + { no: 1, name: "Value", kind: "scalar", jsonName: "Value", T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: "Unit", kind: "enum", jsonName: "Unit", T: () => ["api.Length", Length] } + ]); + } + create(value?: PartialMessage): QuantityLength { + const message = globalThis.Object.create((this.messagePrototype!)); + message.value = 0; + message.unit = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QuantityLength): QuantityLength { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* float Value = 1 [json_name = "Value"];*/ 1: + message.value = reader.float(); + break; + case /* api.Length Unit = 2 [json_name = "Unit"];*/ 2: + message.unit = 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: QuantityLength, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* float Value = 1 [json_name = "Value"]; */ + if (message.value !== 0) + writer.tag(1, WireType.Bit32).float(message.value); + /* api.Length Unit = 2 [json_name = "Unit"]; */ + if (message.unit !== 0) + writer.tag(2, WireType.Varint).int32(message.unit); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.QuantityLength + */ +export const QuantityLength = new QuantityLength$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QuantityVolume$Type extends MessageType { + constructor() { + super("api.QuantityVolume", [ + { no: 1, name: "Value", kind: "scalar", jsonName: "Value", T: 2 /*ScalarType.FLOAT*/, options: { "api.kpi": true } }, + { no: 2, name: "Unit", kind: "enum", jsonName: "Unit", T: () => ["api.Volume", Volume], options: { "api.kpi": true } } + ]); + } + create(value?: PartialMessage): QuantityVolume { + const message = globalThis.Object.create((this.messagePrototype!)); + message.value = 0; + message.unit = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QuantityVolume): QuantityVolume { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* float Value = 1 [json_name = "Value"];*/ 1: + message.value = reader.float(); + break; + case /* api.Volume Unit = 2 [json_name = "Unit"];*/ 2: + message.unit = 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: QuantityVolume, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* float Value = 1 [json_name = "Value"]; */ + if (message.value !== 0) + writer.tag(1, WireType.Bit32).float(message.value); + /* api.Volume Unit = 2 [json_name = "Unit"]; */ + if (message.unit !== 0) + writer.tag(2, WireType.Varint).int32(message.unit); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.QuantityVolume + */ +export const QuantityVolume = new QuantityVolume$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QuantityWeight$Type extends MessageType { + constructor() { + super("api.QuantityWeight", [ + { no: 1, name: "Value", kind: "scalar", jsonName: "Value", T: 2 /*ScalarType.FLOAT*/, options: { "api.kpi": true } }, + { no: 2, name: "Unit", kind: "enum", jsonName: "Unit", T: () => ["api.Weight", Weight], options: { "api.kpi": true } } + ]); + } + create(value?: PartialMessage): QuantityWeight { + const message = globalThis.Object.create((this.messagePrototype!)); + message.value = 0; + message.unit = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QuantityWeight): QuantityWeight { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* float Value = 1 [json_name = "Value"];*/ 1: + message.value = reader.float(); + break; + case /* api.Weight Unit = 2 [json_name = "Unit"];*/ 2: + message.unit = 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: QuantityWeight, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* float Value = 1 [json_name = "Value"]; */ + if (message.value !== 0) + writer.tag(1, WireType.Bit32).float(message.value); + /* api.Weight Unit = 2 [json_name = "Unit"]; */ + if (message.unit !== 0) + writer.tag(2, WireType.Varint).int32(message.unit); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.QuantityWeight + */ +export const QuantityWeight = new QuantityWeight$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QuantityArea$Type extends MessageType { + constructor() { + super("api.QuantityArea", [ + { no: 1, name: "Value", kind: "scalar", jsonName: "Value", T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: "Unit", kind: "enum", jsonName: "Unit", T: () => ["api.Area", Area] } + ]); + } + create(value?: PartialMessage): QuantityArea { + const message = globalThis.Object.create((this.messagePrototype!)); + message.value = 0; + message.unit = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QuantityArea): QuantityArea { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* float Value = 1 [json_name = "Value"];*/ 1: + message.value = reader.float(); + break; + case /* api.Area Unit = 2 [json_name = "Unit"];*/ 2: + message.unit = 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: QuantityArea, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* float Value = 1 [json_name = "Value"]; */ + if (message.value !== 0) + writer.tag(1, WireType.Bit32).float(message.value); + /* api.Area Unit = 2 [json_name = "Unit"]; */ + if (message.unit !== 0) + writer.tag(2, WireType.Varint).int32(message.unit); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.QuantityArea + */ +export const QuantityArea = new QuantityArea$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class QuantityUnit$Type extends MessageType { + constructor() { + super("api.QuantityUnit", [ + { no: 1, name: "Value", kind: "scalar", jsonName: "Value", T: 2 /*ScalarType.FLOAT*/ }, + { no: 2, name: "Unit", kind: "enum", jsonName: "Unit", T: () => ["api.DimensionLess", DimensionLess] } + ]); + } + create(value?: PartialMessage): QuantityUnit { + const message = globalThis.Object.create((this.messagePrototype!)); + message.value = 0; + message.unit = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: QuantityUnit): QuantityUnit { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* float Value = 1 [json_name = "Value"];*/ 1: + message.value = reader.float(); + break; + case /* api.DimensionLess Unit = 2 [json_name = "Unit"];*/ 2: + message.unit = 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: QuantityUnit, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* float Value = 1 [json_name = "Value"]; */ + if (message.value !== 0) + writer.tag(1, WireType.Bit32).float(message.value); + /* api.DimensionLess Unit = 2 [json_name = "Unit"]; */ + if (message.unit !== 0) + writer.tag(2, WireType.Varint).int32(message.unit); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.QuantityUnit + */ +export const QuantityUnit = new QuantityUnit$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DomainDescriptionRequest$Type extends MessageType { + constructor() { + super("api.DomainDescriptionRequest", []); + } + create(value?: PartialMessage): DomainDescriptionRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DomainDescriptionRequest): DomainDescriptionRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: DomainDescriptionRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.DomainDescriptionRequest + */ +export const DomainDescriptionRequest = new DomainDescriptionRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DomainDescriptionResponse$Type extends MessageType { + constructor() { + super("api.DomainDescriptionResponse", [ + { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => ResponseHeader }, + { no: 2, name: "Payload", kind: "message", jsonName: "Payload", T: () => DomainDescription } + ]); + } + create(value?: PartialMessage): DomainDescriptionResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DomainDescriptionResponse): DomainDescriptionResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* api.ResponseHeader Header = 1 [json_name = "Header"];*/ 1: + message.header = ResponseHeader.internalBinaryRead(reader, reader.uint32(), options, message.header); + break; + case /* api.DomainDescription Payload = 2 [json_name = "Payload"];*/ 2: + message.payload = DomainDescription.internalBinaryRead(reader, reader.uint32(), options, message.payload); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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: DomainDescriptionResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* api.ResponseHeader Header = 1 [json_name = "Header"]; */ + if (message.header) + ResponseHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* api.DomainDescription Payload = 2 [json_name = "Payload"]; */ + if (message.payload) + DomainDescription.internalBinaryWrite(message.payload, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.DomainDescriptionResponse + */ +export const DomainDescriptionResponse = new DomainDescriptionResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class DomainDescription$Type extends MessageType { + constructor() { + super("api.DomainDescription", [ + { no: 1, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "ObjectDescription", kind: "message", jsonName: "ObjectDescription", repeat: 1 /*RepeatType.PACKED*/, T: () => ObjectDescription } + ]); + } + create(value?: PartialMessage): DomainDescription { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.objectDescription = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DomainDescription): DomainDescription { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Name = 1 [json_name = "Name"];*/ 1: + message.name = reader.string(); + break; + case /* repeated api.ObjectDescription ObjectDescription = 2 [json_name = "ObjectDescription"];*/ 2: + message.objectDescription.push(ObjectDescription.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: DomainDescription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Name = 1 [json_name = "Name"]; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated api.ObjectDescription ObjectDescription = 2 [json_name = "ObjectDescription"]; */ + for (let i = 0; i < message.objectDescription.length; i++) + ObjectDescription.internalBinaryWrite(message.objectDescription[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 api.DomainDescription + */ +export const DomainDescription = new DomainDescription$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ObjectDescription$Type extends MessageType { + constructor() { + super("api.ObjectDescription", [ + { no: 1, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "ApiAction", kind: "message", jsonName: "ApiAction", repeat: 1 /*RepeatType.PACKED*/, T: () => ObjectAction }, + { no: 3, name: "PayloadJSON", kind: "scalar", jsonName: "PayloadJSON", T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "ApiInput", kind: "message", jsonName: "ApiInput", repeat: 1 /*RepeatType.PACKED*/, T: () => ObjectAction }, + { no: 5, name: "ApiQuery", kind: "message", jsonName: "ApiQuery", repeat: 1 /*RepeatType.PACKED*/, T: () => ObjectAction } + ]); + } + create(value?: PartialMessage): ObjectDescription { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.apiAction = []; + message.payloadJSON = ""; + message.apiInput = []; + message.apiQuery = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ObjectDescription): ObjectDescription { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Name = 1 [json_name = "Name"];*/ 1: + message.name = reader.string(); + break; + case /* repeated api.ObjectAction ApiAction = 2 [json_name = "ApiAction"];*/ 2: + message.apiAction.push(ObjectAction.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string PayloadJSON = 3 [json_name = "PayloadJSON"];*/ 3: + message.payloadJSON = reader.string(); + break; + case /* repeated api.ObjectAction ApiInput = 4 [json_name = "ApiInput"];*/ 4: + message.apiInput.push(ObjectAction.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated api.ObjectAction ApiQuery = 5 [json_name = "ApiQuery"];*/ 5: + message.apiQuery.push(ObjectAction.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: ObjectDescription, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Name = 1 [json_name = "Name"]; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated api.ObjectAction ApiAction = 2 [json_name = "ApiAction"]; */ + for (let i = 0; i < message.apiAction.length; i++) + ObjectAction.internalBinaryWrite(message.apiAction[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* string PayloadJSON = 3 [json_name = "PayloadJSON"]; */ + if (message.payloadJSON !== "") + writer.tag(3, WireType.LengthDelimited).string(message.payloadJSON); + /* repeated api.ObjectAction ApiInput = 4 [json_name = "ApiInput"]; */ + for (let i = 0; i < message.apiInput.length; i++) + ObjectAction.internalBinaryWrite(message.apiInput[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* repeated api.ObjectAction ApiQuery = 5 [json_name = "ApiQuery"]; */ + for (let i = 0; i < message.apiQuery.length; i++) + ObjectAction.internalBinaryWrite(message.apiQuery[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ObjectDescription + */ +export const ObjectDescription = new ObjectDescription$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ObjectAction$Type extends MessageType { + constructor() { + super("api.ObjectAction", [ + { no: 1, name: "Name", kind: "scalar", jsonName: "Name", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "JsonTemplate", kind: "scalar", jsonName: "JsonTemplate", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ObjectAction { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.jsonTemplate = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ObjectAction): ObjectAction { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Name = 1 [json_name = "Name"];*/ 1: + message.name = reader.string(); + break; + case /* string JsonTemplate = 2 [json_name = "JsonTemplate"];*/ 2: + message.jsonTemplate = 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: ObjectAction, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Name = 1 [json_name = "Name"]; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string JsonTemplate = 2 [json_name = "JsonTemplate"]; */ + if (message.jsonTemplate !== "") + writer.tag(2, WireType.LengthDelimited).string(message.jsonTemplate); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ObjectAction + */ +export const ObjectAction = new ObjectAction$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MetadataElement$Type extends MessageType { + constructor() { + super("api.MetadataElement", [ + { no: 1, name: "Key", kind: "scalar", jsonName: "Key", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "Value", kind: "message", jsonName: "Value", T: () => ValueType } + ]); + } + create(value?: PartialMessage): MetadataElement { + const message = globalThis.Object.create((this.messagePrototype!)); + message.key = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MetadataElement): MetadataElement { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Key = 1 [json_name = "Key"];*/ 1: + message.key = reader.string(); + break; + case /* api.ValueType Value = 2 [json_name = "Value"];*/ 2: + message.value = ValueType.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); + } + } + return message; + } + internalBinaryWrite(message: MetadataElement, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Key = 1 [json_name = "Key"]; */ + if (message.key !== "") + writer.tag(1, WireType.LengthDelimited).string(message.key); + /* api.ValueType Value = 2 [json_name = "Value"]; */ + if (message.value) + ValueType.internalBinaryWrite(message.value, writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.MetadataElement + */ +export const MetadataElement = new MetadataElement$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SimpleFilter$Type extends MessageType { + constructor() { + super("api.SimpleFilter", [ + { no: 1, name: "Attribute", kind: "scalar", jsonName: "Attribute", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Filter path", example: "\"ID.refID\"" } } }, + { no: 2, name: "Value", kind: "scalar", jsonName: "Value", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Use this parameter if only one value" } } }, + { no: 3, name: "Values", kind: "scalar", jsonName: "Values", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Use this parameter if more than one value" } } }, + { no: 4, name: "Operator", kind: "scalar", jsonName: "Operator", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "\" EQUAL: 'EQUAL',\u00A0 DIFF: 'DIFF',\u00A0 START_BY: 'START_BY',\u00A0 NOT_START_BY: 'NOT_START_BY',\u00A0 FINISH_BY: 'FINISH_BY',\u00A0 NOT_FINISH_BY: 'NOT_FINISH_BY',\u00A0 CONTAINS: 'CONTAINS',\u00A0 NOT_CONTAINS: 'NOT_CONTAINS'\"" } } }, + { no: 5, name: "CombinedID", kind: "scalar", jsonName: "CombinedID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "metadata's key" } } } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Filter on a simple value" } } }); + } + create(value?: PartialMessage): SimpleFilter { + const message = globalThis.Object.create((this.messagePrototype!)); + message.attribute = ""; + message.value = ""; + message.values = []; + message.operator = ""; + message.combinedID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SimpleFilter): SimpleFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Attribute = 1 [json_name = "Attribute"];*/ 1: + message.attribute = reader.string(); + break; + case /* string Value = 2 [json_name = "Value"];*/ 2: + message.value = reader.string(); + break; + case /* repeated string Values = 3 [json_name = "Values"];*/ 3: + message.values.push(reader.string()); + break; + case /* string Operator = 4 [json_name = "Operator"];*/ 4: + message.operator = reader.string(); + break; + case /* string CombinedID = 5 [json_name = "CombinedID"];*/ 5: + message.combinedID = 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: SimpleFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Attribute = 1 [json_name = "Attribute"]; */ + if (message.attribute !== "") + writer.tag(1, WireType.LengthDelimited).string(message.attribute); + /* string Value = 2 [json_name = "Value"]; */ + if (message.value !== "") + writer.tag(2, WireType.LengthDelimited).string(message.value); + /* repeated string Values = 3 [json_name = "Values"]; */ + for (let i = 0; i < message.values.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.values[i]); + /* string Operator = 4 [json_name = "Operator"]; */ + if (message.operator !== "") + writer.tag(4, WireType.LengthDelimited).string(message.operator); + /* string CombinedID = 5 [json_name = "CombinedID"]; */ + if (message.combinedID !== "") + writer.tag(5, WireType.LengthDelimited).string(message.combinedID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.SimpleFilter + */ +export const SimpleFilter = new SimpleFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CombinedFilter$Type extends MessageType { + constructor() { + super("api.CombinedFilter", [ + { no: 1, name: "Path", kind: "scalar", jsonName: "Path", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "simpleFilters", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SimpleFilter, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Simple filter structure for Find query" } } }, + { no: 3, name: "rangeFilters", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RangeFilter, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Range filter structure for Find query" } } }, + { no: 4, name: "CombinedID", kind: "scalar", jsonName: "CombinedID", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): CombinedFilter { + const message = globalThis.Object.create((this.messagePrototype!)); + message.path = ""; + message.simpleFilters = []; + message.rangeFilters = []; + message.combinedID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CombinedFilter): CombinedFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Path = 1 [json_name = "Path"];*/ 1: + message.path = reader.string(); + break; + case /* repeated api.SimpleFilter simpleFilters */ 2: + message.simpleFilters.push(SimpleFilter.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated api.RangeFilter rangeFilters */ 3: + message.rangeFilters.push(RangeFilter.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string CombinedID = 4 [json_name = "CombinedID"];*/ 4: + message.combinedID = 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: CombinedFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Path = 1 [json_name = "Path"]; */ + if (message.path !== "") + writer.tag(1, WireType.LengthDelimited).string(message.path); + /* repeated api.SimpleFilter simpleFilters = 2; */ + for (let i = 0; i < message.simpleFilters.length; i++) + SimpleFilter.internalBinaryWrite(message.simpleFilters[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated api.RangeFilter rangeFilters = 3; */ + for (let i = 0; i < message.rangeFilters.length; i++) + RangeFilter.internalBinaryWrite(message.rangeFilters[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string CombinedID = 4 [json_name = "CombinedID"]; */ + if (message.combinedID !== "") + writer.tag(4, WireType.LengthDelimited).string(message.combinedID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.CombinedFilter + */ +export const CombinedFilter = new CombinedFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class RangeFilter$Type extends MessageType { + constructor() { + super("api.RangeFilter", [ + { no: 1, name: "Attribute", kind: "scalar", jsonName: "Attribute", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Filter path", example: "\"ID.refID\"" } } }, + { no: 2, name: "valueLt", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Maximum value" }, "validate.rules": { string: { maxLen: "300" } } } }, + { no: 3, name: "valueGt", kind: "scalar", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Minimum value" }, "validate.rules": { string: { maxLen: "300" } } } }, + { no: 4, name: "CombinedID", kind: "scalar", jsonName: "CombinedID", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Metadata's key" }, "validate.rules": { string: { maxLen: "300" } } } } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Filter between two values" } } }); + } + create(value?: PartialMessage): RangeFilter { + const message = globalThis.Object.create((this.messagePrototype!)); + message.attribute = ""; + message.valueLt = ""; + message.valueGt = ""; + message.combinedID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RangeFilter): RangeFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Attribute = 1 [json_name = "Attribute"];*/ 1: + message.attribute = reader.string(); + break; + case /* string valueLt */ 2: + message.valueLt = reader.string(); + break; + case /* string valueGt */ 3: + message.valueGt = reader.string(); + break; + case /* string CombinedID = 4 [json_name = "CombinedID"];*/ 4: + message.combinedID = 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: RangeFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Attribute = 1 [json_name = "Attribute"]; */ + if (message.attribute !== "") + writer.tag(1, WireType.LengthDelimited).string(message.attribute); + /* string valueLt = 2; */ + if (message.valueLt !== "") + writer.tag(2, WireType.LengthDelimited).string(message.valueLt); + /* string valueGt = 3; */ + if (message.valueGt !== "") + writer.tag(3, WireType.LengthDelimited).string(message.valueGt); + /* string CombinedID = 4 [json_name = "CombinedID"]; */ + if (message.combinedID !== "") + writer.tag(4, WireType.LengthDelimited).string(message.combinedID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.RangeFilter + */ +export const RangeFilter = new RangeFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BlockFilter$Type extends MessageType { + constructor() { + super("api.BlockFilter", [ + { no: 1, name: "simpleFilters", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => SimpleFilter, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Simple filter structure for Find query" } } }, + { no: 2, name: "rangeFilters", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => RangeFilter, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Range filter structure for Find query" } } }, + { no: 3, name: "BlockFilters", kind: "message", jsonName: "BlockFilters", repeat: 1 /*RepeatType.PACKED*/, T: () => BlockFilter, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Block filter structure for Find query" } } } + ]); + } + create(value?: PartialMessage): BlockFilter { + const message = globalThis.Object.create((this.messagePrototype!)); + message.simpleFilters = []; + message.rangeFilters = []; + message.blockFilters = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BlockFilter): BlockFilter { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated api.SimpleFilter simpleFilters */ 1: + message.simpleFilters.push(SimpleFilter.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated api.RangeFilter rangeFilters */ 2: + message.rangeFilters.push(RangeFilter.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated api.BlockFilter BlockFilters = 3 [json_name = "BlockFilters"];*/ 3: + message.blockFilters.push(BlockFilter.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: BlockFilter, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated api.SimpleFilter simpleFilters = 1; */ + for (let i = 0; i < message.simpleFilters.length; i++) + SimpleFilter.internalBinaryWrite(message.simpleFilters[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* repeated api.RangeFilter rangeFilters = 2; */ + for (let i = 0; i < message.rangeFilters.length; i++) + RangeFilter.internalBinaryWrite(message.rangeFilters[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated api.BlockFilter BlockFilters = 3 [json_name = "BlockFilters"]; */ + for (let i = 0; i < message.blockFilters.length; i++) + BlockFilter.internalBinaryWrite(message.blockFilters[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; + } +} +/** + * @generated MessageType for protobuf message api.BlockFilter + */ +export const BlockFilter = new BlockFilter$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class MatchField$Type extends MessageType { + constructor() { + super("api.MatchField", [ + { no: 1, name: "Attribute", kind: "scalar", jsonName: "Attribute", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 2, name: "AttributeCombined", kind: "scalar", jsonName: "AttributeCombined", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "CombinedID", kind: "scalar", jsonName: "CombinedID", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): MatchField { + const message = globalThis.Object.create((this.messagePrototype!)); + message.attribute = ""; + message.attributeCombined = ""; + message.combinedID = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: MatchField): MatchField { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Attribute = 1 [json_name = "Attribute"];*/ 1: + message.attribute = reader.string(); + break; + case /* string AttributeCombined = 2 [json_name = "AttributeCombined"];*/ 2: + message.attributeCombined = reader.string(); + break; + case /* string CombinedID = 3 [json_name = "CombinedID"];*/ 3: + message.combinedID = 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: MatchField, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Attribute = 1 [json_name = "Attribute"]; */ + if (message.attribute !== "") + writer.tag(1, WireType.LengthDelimited).string(message.attribute); + /* string AttributeCombined = 2 [json_name = "AttributeCombined"]; */ + if (message.attributeCombined !== "") + writer.tag(2, WireType.LengthDelimited).string(message.attributeCombined); + /* string CombinedID = 3 [json_name = "CombinedID"]; */ + if (message.combinedID !== "") + writer.tag(3, WireType.LengthDelimited).string(message.combinedID); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.MatchField + */ +export const MatchField = new MatchField$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ErrorDetail$Type extends MessageType { + constructor() { + super("api.ErrorDetail", [ + { no: 1, name: "Key", kind: "scalar", jsonName: "Key", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "Value", kind: "scalar", jsonName: "Value", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): ErrorDetail { + const message = globalThis.Object.create((this.messagePrototype!)); + message.key = ""; + message.value = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ErrorDetail): ErrorDetail { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Key = 1 [json_name = "Key"];*/ 1: + message.key = reader.string(); + break; + case /* string Value = 2 [json_name = "Value"];*/ 2: + message.value = reader.string(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: ErrorDetail, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Key = 1 [json_name = "Key"]; */ + if (message.key !== "") + writer.tag(1, WireType.LengthDelimited).string(message.key); + /* string Value = 2 [json_name = "Value"]; */ + if (message.value !== "") + writer.tag(2, WireType.LengthDelimited).string(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.ErrorDetail + */ +export const ErrorDetail = new ErrorDetail$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Errors$Type extends MessageType { + constructor() { + super("api.Errors", [ + { no: 1, name: "ErrorCode", kind: "scalar", jsonName: "ErrorCode", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "ErrorTrace", kind: "scalar", jsonName: "ErrorTrace", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "ErrorDetails", kind: "message", jsonName: "ErrorDetails", repeat: 1 /*RepeatType.PACKED*/, T: () => ErrorDetail }, + { no: 4, name: "ContextType", kind: "scalar", jsonName: "ContextType", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "ContextProcess", kind: "scalar", jsonName: "ContextProcess", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "ContextPayload", kind: "scalar", jsonName: "ContextPayload", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Errors { + const message = globalThis.Object.create((this.messagePrototype!)); + message.errorCode = ""; + message.errorTrace = ""; + message.errorDetails = []; + message.contextType = ""; + message.contextProcess = ""; + message.contextPayload = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Errors): Errors { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string ErrorCode = 1 [json_name = "ErrorCode"];*/ 1: + message.errorCode = reader.string(); + break; + case /* string ErrorTrace = 2 [json_name = "ErrorTrace"];*/ 2: + message.errorTrace = reader.string(); + break; + case /* repeated api.ErrorDetail ErrorDetails = 3 [json_name = "ErrorDetails"];*/ 3: + message.errorDetails.push(ErrorDetail.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string ContextType = 4 [json_name = "ContextType"];*/ 4: + message.contextType = reader.string(); + break; + case /* string ContextProcess = 5 [json_name = "ContextProcess"];*/ 5: + message.contextProcess = reader.string(); + break; + case /* string ContextPayload = 6 [json_name = "ContextPayload"];*/ 6: + message.contextPayload = 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: Errors, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string ErrorCode = 1 [json_name = "ErrorCode"]; */ + if (message.errorCode !== "") + writer.tag(1, WireType.LengthDelimited).string(message.errorCode); + /* string ErrorTrace = 2 [json_name = "ErrorTrace"]; */ + if (message.errorTrace !== "") + writer.tag(2, WireType.LengthDelimited).string(message.errorTrace); + /* repeated api.ErrorDetail ErrorDetails = 3 [json_name = "ErrorDetails"]; */ + for (let i = 0; i < message.errorDetails.length; i++) + ErrorDetail.internalBinaryWrite(message.errorDetails[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string ContextType = 4 [json_name = "ContextType"]; */ + if (message.contextType !== "") + writer.tag(4, WireType.LengthDelimited).string(message.contextType); + /* string ContextProcess = 5 [json_name = "ContextProcess"]; */ + if (message.contextProcess !== "") + writer.tag(5, WireType.LengthDelimited).string(message.contextProcess); + /* string ContextPayload = 6 [json_name = "ContextPayload"]; */ + if (message.contextPayload !== "") + writer.tag(6, WireType.LengthDelimited).string(message.contextPayload); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.Errors + */ +export const Errors = new Errors$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class ParamElement$Type extends MessageType { + constructor() { + super("api.ParamElement", [ + { no: 1, name: "Key", kind: "scalar", jsonName: "Key", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "Value", kind: "message", jsonName: "Value", T: () => ValueType } + ]); + } + create(value?: PartialMessage): ParamElement { + const message = globalThis.Object.create((this.messagePrototype!)); + message.key = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ParamElement): ParamElement { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Key = 1 [json_name = "Key"];*/ 1: + message.key = reader.string(); + break; + case /* api.ValueType Value = 3 [json_name = "Value"];*/ 3: + message.value = ValueType.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); + } + } + return message; + } + internalBinaryWrite(message: ParamElement, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Key = 1 [json_name = "Key"]; */ + if (message.key !== "") + writer.tag(1, WireType.LengthDelimited).string(message.key); + /* api.ValueType Value = 3 [json_name = "Value"]; */ + if (message.value) + ValueType.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; + } +} +/** + * @generated MessageType for protobuf message api.ParamElement + */ +export const ParamElement = new ParamElement$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class LabelStructure$Type extends MessageType { + constructor() { + super("api.LabelStructure", [ + { no: 1, name: "Code", kind: "scalar", jsonName: "Code", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Code of the message" }, "validate.rules": { string: { minLen: "1" } } } }, + { no: 2, name: "Label", kind: "scalar", jsonName: "Label", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Label of the message" }, "validate.rules": { string: { minLen: "1" } } } }, + { no: 3, name: "Params", kind: "message", jsonName: "Params", repeat: 1 /*RepeatType.PACKED*/, T: () => ParamElement, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Parameters for label" }, "api.aggKey": "Key" } } + ]); + } + create(value?: PartialMessage): LabelStructure { + const message = globalThis.Object.create((this.messagePrototype!)); + message.code = ""; + message.label = ""; + message.params = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: LabelStructure): LabelStructure { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Code = 1 [json_name = "Code"];*/ 1: + message.code = reader.string(); + break; + case /* string Label = 2 [json_name = "Label"];*/ 2: + message.label = reader.string(); + break; + case /* repeated api.ParamElement Params = 3 [json_name = "Params"];*/ 3: + message.params.push(ParamElement.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: LabelStructure, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Code = 1 [json_name = "Code"]; */ + if (message.code !== "") + writer.tag(1, WireType.LengthDelimited).string(message.code); + /* string Label = 2 [json_name = "Label"]; */ + if (message.label !== "") + writer.tag(2, WireType.LengthDelimited).string(message.label); + /* repeated api.ParamElement Params = 3 [json_name = "Params"]; */ + for (let i = 0; i < message.params.length; i++) + ParamElement.internalBinaryWrite(message.params[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; + } +} +/** + * @generated MessageType for protobuf message api.LabelStructure + */ +export const LabelStructure = new LabelStructure$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Credentials$Type extends MessageType { + constructor() { + super("api.Credentials", [ + { no: 1, name: "Jwt", kind: "scalar", jsonName: "Jwt", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "Seed", kind: "scalar", jsonName: "Seed", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Credentials { + const message = globalThis.Object.create((this.messagePrototype!)); + message.jwt = ""; + message.seed = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Credentials): Credentials { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string Jwt = 1 [json_name = "Jwt"];*/ 1: + message.jwt = reader.string(); + break; + case /* string Seed = 2 [json_name = "Seed"];*/ 2: + message.seed = 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: Credentials, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string Jwt = 1 [json_name = "Jwt"]; */ + if (message.jwt !== "") + writer.tag(1, WireType.LengthDelimited).string(message.jwt); + /* string Seed = 2 [json_name = "Seed"]; */ + if (message.seed !== "") + writer.tag(2, WireType.LengthDelimited).string(message.seed); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.Credentials + */ +export const Credentials = new Credentials$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Int32Object$Type extends MessageType { + constructor() { + super("api.Int32Object", [ + { no: 1, name: "Int32", kind: "scalar", jsonName: "Int32", T: 5 /*ScalarType.INT32*/ } + ]); + } + create(value?: PartialMessage): Int32Object { + const message = globalThis.Object.create((this.messagePrototype!)); + message.int32 = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Int32Object): Int32Object { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int32 Int32 = 1 [json_name = "Int32"];*/ 1: + message.int32 = 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: Int32Object, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int32 Int32 = 1 [json_name = "Int32"]; */ + if (message.int32 !== 0) + writer.tag(1, WireType.Varint).int32(message.int32); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.Int32Object + */ +export const Int32Object = new Int32Object$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class BoolObject$Type extends MessageType { + constructor() { + super("api.BoolObject", [ + { no: 1, name: "Bool", kind: "scalar", jsonName: "Bool", T: 8 /*ScalarType.BOOL*/ } + ]); + } + create(value?: PartialMessage): BoolObject { + const message = globalThis.Object.create((this.messagePrototype!)); + message.bool = false; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: BoolObject): BoolObject { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* bool Bool = 1 [json_name = "Bool"];*/ 1: + message.bool = 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: BoolObject, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* bool Bool = 1 [json_name = "Bool"]; */ + if (message.bool !== false) + writer.tag(1, WireType.Varint).bool(message.bool); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.BoolObject + */ +export const BoolObject = new BoolObject$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StringObject$Type extends MessageType { + constructor() { + super("api.StringObject", [ + { no: 1, name: "String", kind: "scalar", jsonName: "String", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): StringObject { + const message = globalThis.Object.create((this.messagePrototype!)); + message.string = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringObject): StringObject { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string String = 1 [json_name = "String"];*/ 1: + message.string = 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: StringObject, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string String = 1 [json_name = "String"]; */ + if (message.string !== "") + writer.tag(1, WireType.LengthDelimited).string(message.string); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.StringObject + */ +export const StringObject = new StringObject$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class StringDateObject$Type extends MessageType { + constructor() { + super("api.StringDateObject", [ + { no: 10, name: "DateTime", kind: "scalar", jsonName: "DateTime", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "UTC date/time in ISO 8601 format with time zone (accepted tzd formats: [+01:00, -01:00, Z])", example: "2020-11-26T21:32:52+02:00" }, "validate.rules": { string: { dateIso8601: true } } } } + ]); + } + create(value?: PartialMessage): StringDateObject { + const message = globalThis.Object.create((this.messagePrototype!)); + message.dateTime = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: StringDateObject): StringDateObject { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string DateTime = 10 [json_name = "DateTime"];*/ 10: + message.dateTime = 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: StringDateObject, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string DateTime = 10 [json_name = "DateTime"]; */ + if (message.dateTime !== "") + writer.tag(10, WireType.LengthDelimited).string(message.dateTime); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.StringDateObject + */ +export const StringDateObject = new StringDateObject$Type(); diff --git a/core/unitOfMeasures.ts b/core/unitOfMeasures.ts new file mode 100644 index 0000000..80825ae --- /dev/null +++ b/core/unitOfMeasures.ts @@ -0,0 +1,322 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "core/unitOfMeasures.proto" (package "api", syntax proto3) +// tslint:disable +/** + * @generated from protobuf enum api.Length + */ +export enum Length { + /** + * @generated from protobuf enum value: LENGTH_UNKNOWN = 0; + */ + LENGTH_UNKNOWN = 0, + /** + * @generated from protobuf enum value: METER = 10; + */ + METER = 10, + /** + * @generated from protobuf enum value: MILLIMETER = 20; + */ + MILLIMETER = 20, + /** + * @generated from protobuf enum value: CENTIMETER = 30; + */ + CENTIMETER = 30, + /** + * @generated from protobuf enum value: DECIMETER = 40; + */ + DECIMETER = 40, + /** + * @generated from protobuf enum value: DECAMETER = 50; + */ + DECAMETER = 50, + /** + * @generated from protobuf enum value: HECTOMETER = 60; + */ + HECTOMETER = 60, + /** + * @generated from protobuf enum value: KILOMETER = 70; + */ + KILOMETER = 70, + /** + * @generated from protobuf enum value: INCH = 80; + */ + INCH = 80, + /** + * @generated from protobuf enum value: FOOT = 90; + */ + FOOT = 90, + /** + * @generated from protobuf enum value: YARD = 100; + */ + YARD = 100, + /** + * @generated from protobuf enum value: MILE = 110; + */ + MILE = 110 +} +/** + * @generated from protobuf enum api.Weight + */ +export enum Weight { + /** + * @generated from protobuf enum value: WEIGHT_UNKNOWN = 0; + */ + WEIGHT_UNKNOWN = 0, + /** + * @generated from protobuf enum value: GRAMME = 10; + */ + GRAMME = 10, + /** + * @generated from protobuf enum value: MILLIGRAM = 20; + */ + MILLIGRAM = 20, + /** + * @generated from protobuf enum value: CENTIGRAM = 30; + */ + CENTIGRAM = 30, + /** + * @generated from protobuf enum value: DECIGRAM = 40; + */ + DECIGRAM = 40, + /** + * @generated from protobuf enum value: DECAGRAM = 50; + */ + DECAGRAM = 50, + /** + * @generated from protobuf enum value: HECTOGRAM = 60; + */ + HECTOGRAM = 60, + /** + * @generated from protobuf enum value: KILOGRAM = 70; + */ + KILOGRAM = 70, + /** + * @generated from protobuf enum value: TONNE = 80; + */ + TONNE = 80, + /** + * @generated from protobuf enum value: GRAIN = 90; + */ + GRAIN = 90, + /** + * @generated from protobuf enum value: ONCE = 100; + */ + ONCE = 100, + /** + * @generated from protobuf enum value: POUND = 110; + */ + POUND = 110, + /** + * @generated from protobuf enum value: SHORT_TON = 120; + */ + SHORT_TON = 120, + /** + * @generated from protobuf enum value: LONG_TON = 130; + */ + LONG_TON = 130, + /** + * @generated from protobuf enum value: STONE = 140; + */ + STONE = 140 +} +/** + * @generated from protobuf enum api.Temperature + */ +export enum Temperature { + /** + * @generated from protobuf enum value: TEMPERATURE_UNKNOWN = 0; + */ + TEMPERATURE_UNKNOWN = 0, + /** + * @generated from protobuf enum value: CELSIUS = 1; + */ + CELSIUS = 1, + /** + * @generated from protobuf enum value: FAHRENHEIT = 2; + */ + FAHRENHEIT = 2 +} +/** + * @generated from protobuf enum api.Speed + */ +export enum Speed { + /** + * @generated from protobuf enum value: SPEED_UNKNOWN = 0; + */ + SPEED_UNKNOWN = 0, + /** + * @generated from protobuf enum value: KM_PER_HOUR = 10; + */ + KM_PER_HOUR = 10, + /** + * @generated from protobuf enum value: METER_PER_SECOND = 20; + */ + METER_PER_SECOND = 20, + /** + * @generated from protobuf enum value: YARD_PER_SECOND = 30; + */ + YARD_PER_SECOND = 30, + /** + * @generated from protobuf enum value: MILE_PER_HOUR = 40; + */ + MILE_PER_HOUR = 40 +} +/** + * @generated from protobuf enum api.Area + */ +export enum Area { + /** + * @generated from protobuf enum value: AREA_UNKNOWN = 0; + */ + AREA_UNKNOWN = 0, + /** + * @generated from protobuf enum value: SQUARE_METER = 10; + */ + SQUARE_METER = 10, + /** + * @generated from protobuf enum value: SQUARE_MILLIMETER = 20; + */ + SQUARE_MILLIMETER = 20, + /** + * @generated from protobuf enum value: SQUARE_CENTIMETER = 30; + */ + SQUARE_CENTIMETER = 30, + /** + * @generated from protobuf enum value: SQUARE_DECIMETER = 40; + */ + SQUARE_DECIMETER = 40, + /** + * @generated from protobuf enum value: SQUARE_DECAMETER = 50; + */ + SQUARE_DECAMETER = 50, + /** + * @generated from protobuf enum value: SQUARE_HECTOMETER = 60; + */ + SQUARE_HECTOMETER = 60, + /** + * @generated from protobuf enum value: SQUARE_INCH = 70; + */ + SQUARE_INCH = 70, + /** + * @generated from protobuf enum value: SQUARE_FEET = 80; + */ + SQUARE_FEET = 80, + /** + * @generated from protobuf enum value: SQUARE_YARD = 90; + */ + SQUARE_YARD = 90, + /** + * @generated from protobuf enum value: ACRE = 100; + */ + ACRE = 100 +} +/** + * @generated from protobuf enum api.Volume + */ +export enum Volume { + /** + * @generated from protobuf enum value: VOLUME_UNKNOWN = 0; + */ + VOLUME_UNKNOWN = 0, + /** + * @generated from protobuf enum value: CUBIC_METER = 10; + */ + CUBIC_METER = 10, + /** + * @generated from protobuf enum value: CUBIC_MILLIMETER = 20; + */ + CUBIC_MILLIMETER = 20, + /** + * @generated from protobuf enum value: CUBIC_CENTIMETER = 30; + */ + CUBIC_CENTIMETER = 30, + /** + * @generated from protobuf enum value: CUBIC_DECIMETER = 40; + */ + CUBIC_DECIMETER = 40, + /** + * @generated from protobuf enum value: LITER = 50; + */ + LITER = 50, + /** + * @generated from protobuf enum value: MILLI_LITER = 60; + */ + MILLI_LITER = 60, + /** + * @generated from protobuf enum value: CENTI_LITER = 70; + */ + CENTI_LITER = 70, + /** + * @generated from protobuf enum value: DECI_LITER = 80; + */ + DECI_LITER = 80, + /** + * @generated from protobuf enum value: DECA_LITER = 90; + */ + DECA_LITER = 90, + /** + * @generated from protobuf enum value: HECTO_LITER = 100; + */ + HECTO_LITER = 100, + /** + * @generated from protobuf enum value: CUBIC_INCH = 110; + */ + CUBIC_INCH = 110, + /** + * @generated from protobuf enum value: CUBIC_FEET = 120; + */ + CUBIC_FEET = 120, + /** + * @generated from protobuf enum value: CUBIC_YARD = 130; + */ + CUBIC_YARD = 130, + /** + * @generated from protobuf enum value: US_FLUID_OUNCE = 140; + */ + US_FLUID_OUNCE = 140, + /** + * @generated from protobuf enum value: US_PINT = 150; + */ + US_PINT = 150, + /** + * @generated from protobuf enum value: US_DRY_PINT = 160; + */ + US_DRY_PINT = 160, + /** + * @generated from protobuf enum value: US_DRY_QUART = 170; + */ + US_DRY_QUART = 170, + /** + * @generated from protobuf enum value: US_GAL = 180; + */ + US_GAL = 180, + /** + * @generated from protobuf enum value: IMPERIAL_OUNCE = 190; + */ + IMPERIAL_OUNCE = 190, + /** + * @generated from protobuf enum value: IMPERIAL_PINT = 200; + */ + IMPERIAL_PINT = 200, + /** + * @generated from protobuf enum value: IMPERIAL_QUART = 210; + */ + IMPERIAL_QUART = 210, + /** + * @generated from protobuf enum value: IMPERIAL_GAL = 220; + */ + IMPERIAL_GAL = 220 +} +/** + * @generated from protobuf enum api.DimensionLess + */ +export enum DimensionLess { + /** + * @generated from protobuf enum value: DIMENSIONLESS_UNKNOWN = 0; + */ + DIMENSIONLESS_UNKNOWN = 0, + /** + * @generated from protobuf enum value: UNIT = 1; + */ + UNIT = 1 +} diff --git a/counter.client.ts b/counter.client.ts new file mode 100644 index 0000000..74f9222 --- /dev/null +++ b/counter.client.ts @@ -0,0 +1,37 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "counter.proto" (package "vizapi", syntax proto3) +// tslint:disable +import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; +import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; +import { ProjectCountersService } from "./counter"; +import { stackIntercept } from "@protobuf-ts/runtime-rpc"; +import type { NextCounterResult } from "./counter"; +import type { NextProjectCounterRequest } from "./counter"; +import type { UnaryCall } from "@protobuf-ts/runtime-rpc"; +import type { RpcOptions } from "@protobuf-ts/runtime-rpc"; +/** + * @generated from protobuf service vizapi.ProjectCountersService + */ +export interface IProjectCountersServiceClient { + /** + * @generated from protobuf rpc: Next(vizapi.NextProjectCounterRequest) returns (vizapi.NextCounterResult); + */ + next(input: NextProjectCounterRequest, options?: RpcOptions): UnaryCall; +} +/** + * @generated from protobuf service vizapi.ProjectCountersService + */ +export class ProjectCountersServiceClient implements IProjectCountersServiceClient, ServiceInfo { + typeName = ProjectCountersService.typeName; + methods = ProjectCountersService.methods; + options = ProjectCountersService.options; + constructor(private readonly _transport: RpcTransport) { + } + /** + * @generated from protobuf rpc: Next(vizapi.NextProjectCounterRequest) returns (vizapi.NextCounterResult); + */ + next(input: NextProjectCounterRequest, options?: RpcOptions): UnaryCall { + const method = this.methods[0], opt = this._transport.mergeOptions(options); + return stackIntercept("unary", this._transport, method, opt, input); + } +} diff --git a/counter.ts b/counter.ts new file mode 100644 index 0000000..f901c10 --- /dev/null +++ b/counter.ts @@ -0,0 +1,143 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "counter.proto" (package "vizapi", syntax proto3) +// tslint:disable +import { ServiceType } from "@protobuf-ts/runtime-rpc"; +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { RequestProjectHeader } from "./core/shared"; +/** + * @generated from protobuf message vizapi.NextProjectCounterRequest + */ +export interface NextProjectCounterRequest { + /** + * @generated from protobuf field: api.RequestProjectHeader Header = 1 [json_name = "Header"]; + */ + header?: RequestProjectHeader; + /** + * @generated from protobuf field: string Key = 2 [json_name = "Key"]; + */ + key: string; +} +/** + * @generated from protobuf message vizapi.NextCounterResult + */ +export interface NextCounterResult { + /** + * @generated from protobuf field: int64 Value = 1 [json_name = "Value"]; + */ + value: bigint; +} +// @generated message type with reflection information, may provide speed optimized methods +class NextProjectCounterRequest$Type extends MessageType { + constructor() { + super("vizapi.NextProjectCounterRequest", [ + { no: 1, name: "Header", kind: "message", jsonName: "Header", T: () => RequestProjectHeader, options: { "validate.rules": { message: { required: true } } } }, + { no: 2, name: "Key", kind: "scalar", jsonName: "Key", T: 9 /*ScalarType.STRING*/, options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { example: "\"claims\"" }, "validate.rules": { string: { minLen: "1" } } } } + ], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Header", "Key"] } } }); + } + create(value?: PartialMessage): NextProjectCounterRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.key = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NextProjectCounterRequest): NextProjectCounterRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* api.RequestProjectHeader Header = 1 [json_name = "Header"];*/ 1: + message.header = RequestProjectHeader.internalBinaryRead(reader, reader.uint32(), options, message.header); + break; + case /* string Key = 2 [json_name = "Key"];*/ 2: + message.key = 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: NextProjectCounterRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* api.RequestProjectHeader Header = 1 [json_name = "Header"]; */ + if (message.header) + RequestProjectHeader.internalBinaryWrite(message.header, writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* string Key = 2 [json_name = "Key"]; */ + if (message.key !== "") + writer.tag(2, WireType.LengthDelimited).string(message.key); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message vizapi.NextProjectCounterRequest + */ +export const NextProjectCounterRequest = new NextProjectCounterRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class NextCounterResult$Type extends MessageType { + constructor() { + super("vizapi.NextCounterResult", [ + { no: 1, name: "Value", kind: "scalar", jsonName: "Value", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ } + ]); + } + create(value?: PartialMessage): NextCounterResult { + const message = globalThis.Object.create((this.messagePrototype!)); + message.value = 0n; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: NextCounterResult): NextCounterResult { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* int64 Value = 1 [json_name = "Value"];*/ 1: + message.value = reader.int64().toBigInt(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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: NextCounterResult, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* int64 Value = 1 [json_name = "Value"]; */ + if (message.value !== 0n) + writer.tag(1, WireType.Varint).int64(message.value); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message vizapi.NextCounterResult + */ +export const NextCounterResult = new NextCounterResult$Type(); +/** + * @generated ServiceType for protobuf service vizapi.ProjectCountersService + */ +export const ProjectCountersService = new ServiceType("vizapi.ProjectCountersService", [ + { name: "Next", options: { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation": { tags: ["Project Counters"], summary: "Get the next value for a project key", description: "Get the next value for a project key" }, "api.rscType": "Project", "api.roles": "", "google.api.method_visibility": { restriction: "PUBLIC" } }, I: NextProjectCounterRequest, O: NextCounterResult } +], { "api.k8sService": "settings-server" }); diff --git a/google/api/field_behavior.ts b/google/api/field_behavior.ts new file mode 100644 index 0000000..583e086 --- /dev/null +++ b/google/api/field_behavior.ts @@ -0,0 +1,77 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/api/field_behavior.proto" (package "google.api", syntax proto3) +// tslint:disable +// +// Copyright 2020 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. +// +/** + * An indicator of the behavior of a given field (for example, that a field + * is required in requests, or given as output but ignored as input). + * This **does not** change the behavior in protocol buffers itself; it only + * denotes the behavior and may affect how API tooling handles the field. + * + * Note: This enum **may** receive new values in the future. + * + * @generated from protobuf enum google.api.FieldBehavior + */ +export enum FieldBehavior { + /** + * Conventional default for enums. Do not use this. + * + * @generated from protobuf enum value: FIELD_BEHAVIOR_UNSPECIFIED = 0; + */ + FIELD_BEHAVIOR_UNSPECIFIED = 0, + /** + * Specifically denotes a field as optional. + * While all fields in protocol buffers are optional, this may be specified + * for emphasis if appropriate. + * + * @generated from protobuf enum value: OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * Denotes a field as required. + * This indicates that the field **must** be provided as part of the request, + * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + * + * @generated from protobuf enum value: REQUIRED = 2; + */ + REQUIRED = 2, + /** + * Denotes a field as output only. + * This indicates that the field is provided in responses, but including the + * field in a request does nothing (the server *must* ignore it and + * *must not* throw an error as a result of the field's presence). + * + * @generated from protobuf enum value: OUTPUT_ONLY = 3; + */ + OUTPUT_ONLY = 3, + /** + * Denotes a field as input only. + * This indicates that the field is provided in requests, and the + * corresponding field is not included in output. + * + * @generated from protobuf enum value: INPUT_ONLY = 4; + */ + INPUT_ONLY = 4, + /** + * Denotes a field as immutable. + * This indicates that the field may be set once in a request to create a + * resource, but may not be changed thereafter. + * + * @generated from protobuf enum value: IMMUTABLE = 5; + */ + IMMUTABLE = 5 +} diff --git a/google/api/http.ts b/google/api/http.ts new file mode 100644 index 0000000..9b1929b --- /dev/null +++ b/google/api/http.ts @@ -0,0 +1,687 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/api/http.proto" (package "google.api", syntax proto3) +// tslint:disable +// +// Copyright 2020 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 { 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. + * + * @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 + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + * + * @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. + * + * @generated from protobuf field: string selector = 1; + */ + selector: string; + /** + * @generated from protobuf oneof: pattern + */ + 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. + * + * @generated from protobuf message google.api.CustomHttpPattern + */ +export interface CustomHttpPattern { + /** + * 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; +} +// @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*/ } + ]); + } + create(value?: PartialMessage): Http { + const message = globalThis.Object.create((this.messagePrototype!)); + message.rules = []; + message.fullyDecodeReservedExpansion = false; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + 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); + } + } + return message; + } + 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; + } +} +/** + * @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 } + ]); + } + create(value?: PartialMessage): HttpRule { + const message = globalThis.Object.create((this.messagePrototype!)); + message.selector = ""; + message.pattern = { oneofKind: undefined }; + message.body = ""; + message.responseBody = ""; + message.additionalBindings = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + 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); + } + } + return message; + } + 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; + } +} +/** + * @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*/ } + ]); + } + create(value?: PartialMessage): CustomHttpPattern { + const message = globalThis.Object.create((this.messagePrototype!)); + message.kind = ""; + message.path = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + 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); + } + } + return message; + } + 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; + } +} +/** + * @generated MessageType for protobuf message google.api.CustomHttpPattern + */ +export const CustomHttpPattern = new CustomHttpPattern$Type(); diff --git a/google/api/httpbody.ts b/google/api/httpbody.ts new file mode 100644 index 0000000..88ce47b --- /dev/null +++ b/google/api/httpbody.ts @@ -0,0 +1,155 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/api/httpbody.proto" (package "google.api", syntax proto3) +// tslint:disable +// +// Copyright 2020 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 { MessageType } from "@protobuf-ts/runtime"; +import { Any } from "../protobuf/any"; +/** + * Message that represents an arbitrary HTTP body. It should only be used for + * payload formats that can't be represented as JSON, such as raw binary or + * an HTML page. + * + * + * This message can be used both in streaming and non-streaming API methods in + * the request as well as the response. + * + * It can be used as a top-level request field, which is convenient if one + * wants to extract parameters from either the URL or HTTP template into the + * request fields and also want access to the raw HTTP body. + * + * Example: + * + * message GetResourceRequest { + * // A unique request id. + * string request_id = 1; + * + * // The raw HTTP body is bound to this field. + * google.api.HttpBody http_body = 2; + * } + * + * service ResourceService { + * rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); + * rpc UpdateResource(google.api.HttpBody) returns + * (google.protobuf.Empty); + * } + * + * Example with streaming methods: + * + * service CaldavService { + * rpc GetCalendar(stream google.api.HttpBody) + * returns (stream google.api.HttpBody); + * rpc UpdateCalendar(stream google.api.HttpBody) + * returns (stream google.api.HttpBody); + * } + * + * Use of this type only changes how the request and response bodies are + * handled, all other features will continue to work unchanged. + * + * @generated from protobuf message google.api.HttpBody + */ +export interface HttpBody { + /** + * The HTTP Content-Type header value specifying the content type of the body. + * + * @generated from protobuf field: string content_type = 1; + */ + contentType: string; + /** + * The HTTP request/response body as raw binary. + * + * @generated from protobuf field: bytes data = 2; + */ + data: Uint8Array; + /** + * Application specific response metadata. Must be set in the first response + * for streaming APIs. + * + * @generated from protobuf field: repeated google.protobuf.Any extensions = 3; + */ + extensions: Any[]; +} +// @generated message type with reflection information, may provide speed optimized methods +class HttpBody$Type extends MessageType { + constructor() { + super("google.api.HttpBody", [ + { no: 1, name: "content_type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "data", kind: "scalar", T: 12 /*ScalarType.BYTES*/ }, + { no: 3, name: "extensions", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Any } + ]); + } + create(value?: PartialMessage): HttpBody { + const message = globalThis.Object.create((this.messagePrototype!)); + message.contentType = ""; + message.data = new Uint8Array(0); + message.extensions = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: HttpBody): HttpBody { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string content_type */ 1: + message.contentType = reader.string(); + break; + case /* bytes data */ 2: + message.data = reader.bytes(); + break; + case /* repeated google.protobuf.Any extensions */ 3: + message.extensions.push(Any.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: HttpBody, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string content_type = 1; */ + if (message.contentType !== "") + writer.tag(1, WireType.LengthDelimited).string(message.contentType); + /* bytes data = 2; */ + if (message.data.length) + writer.tag(2, WireType.LengthDelimited).bytes(message.data); + /* repeated google.protobuf.Any extensions = 3; */ + for (let i = 0; i < message.extensions.length; i++) + Any.internalBinaryWrite(message.extensions[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; + } +} +/** + * @generated MessageType for protobuf message google.api.HttpBody + */ +export const HttpBody = new HttpBody$Type(); diff --git a/google/protobuf/any.ts b/google/protobuf/any.ts new file mode 100644 index 0000000..8a7f73c --- /dev/null +++ b/google/protobuf/any.ts @@ -0,0 +1,319 @@ +// @generated by protobuf-ts 2.9.5 +// @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 { 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. + * + * Protobuf library provides support to pack/unpack Any values in the form + * of utility functions or additional generated methods of the Any type. + * + * Example 1: Pack and unpack a message in C++. + * + * Foo foo = ...; + * Any any; + * any.PackFrom(foo); + * ... + * if (any.UnpackTo(&foo)) { + * ... + * } + * + * Example 2: Pack and unpack a message in Java. + * + * Foo foo = ...; + * Any any = Any.pack(foo); + * ... + * if (any.is(Foo.class)) { + * foo = any.unpack(Foo.class); + * } + * + * Example 3: Pack and unpack a message in Python. + * + * foo = Foo(...) + * any = Any() + * any.Pack(foo) + * ... + * if any.Is(Foo.DESCRIPTOR): + * any.Unpack(foo) + * ... + * + * Example 4: Pack and unpack a message in Go + * + * foo := &pb.Foo{...} + * any, err := ptypes.MarshalAny(foo) + * ... + * foo := &pb.Foo{} + * if err := ptypes.UnmarshalAny(any, foo); err != nil { + * ... + * } + * + * The pack methods provided by protobuf library will by default use + * 'type.googleapis.com/full.type.name' as the type URL and the unpack + * methods only use the fully qualified type name after the last '/' + * in the type URL, for example "foo.bar.com/x/y.z" will yield type + * name "y.z". + * + * + * JSON + * ==== + * The JSON representation of an `Any` value uses the regular + * representation of the deserialized, embedded message, with an + * additional field `@type` which contains the type URL. Example: + * + * package google.profile; + * message Person { + * string first_name = 1; + * string last_name = 2; + * } + * + * { + * "@type": "type.googleapis.com/google.profile.Person", + * "firstName": , + * "lastName": + * } + * + * If the embedded message type is well-known and has a custom JSON + * representation, that representation will be embedded adding a field + * `value` which holds the custom JSON in addition to the `@type` + * field. Example (for message [google.protobuf.Duration][]): + * + * { + * "@type": "type.googleapis.com/google.protobuf.Duration", + * "value": "1.212s" + * } + * + * + * @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. + * + * 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; +} +// @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*/ } + ]); + } + /** + * 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), + }; + } + /** + * 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 (target === undefined) + target = this.create(); + target.typeUrl = json["@type"]; + target.value = type.toBinary(value); + return target; + } + typeNameToUrl(name: string): string { + if (!name.length) + throw new Error("invalid type name: " + name); + return "type.googleapis.com/" + name; + } + 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 = globalThis.Object.create((this.messagePrototype!)); + message.typeUrl = ""; + message.value = new Uint8Array(0); + 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; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.Any + */ +export const Any = new Any$Type(); diff --git a/google/protobuf/api.ts b/google/protobuf/api.ts new file mode 100644 index 0000000..5e1d659 --- /dev/null +++ b/google/protobuf/api.ts @@ -0,0 +1,515 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/protobuf/api.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 { MessageType } from "@protobuf-ts/runtime"; +import { Syntax } from "./type"; +import { SourceContext } from "./source_context"; +import { Option } from "./type"; +/** + * Api is a light-weight descriptor for an API Interface. + * + * Interfaces are also described as "protocol buffer services" in some contexts, + * such as by the "service" keyword in a .proto file, but they are different + * from API Services, which represent a concrete implementation of an interface + * as opposed to simply a description of methods and bindings. They are also + * sometimes simply referred to as "APIs" in other contexts, such as the name of + * this message itself. See https://cloud.google.com/apis/design/glossary for + * detailed terminology. + * + * @generated from protobuf message google.protobuf.Api + */ +export interface Api { + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * The methods of this interface, in unspecified order. + * + * @generated from protobuf field: repeated google.protobuf.Method methods = 2; + */ + methods: Method[]; + /** + * Any metadata attached to the interface. + * + * @generated from protobuf field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * + * + * @generated from protobuf field: string version = 4; + */ + version: string; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * @generated from protobuf field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext; + /** + * Included interfaces. See [Mixin][]. + * + * @generated from protobuf field: repeated google.protobuf.Mixin mixins = 6; + */ + mixins: Mixin[]; + /** + * The source syntax of the service. + * + * @generated from protobuf field: google.protobuf.Syntax syntax = 7; + */ + syntax: Syntax; +} +/** + * Method represents a method of an API interface. + * + * @generated from protobuf message google.protobuf.Method + */ +export interface Method { + /** + * The simple name of this method. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * A URL of the input message type. + * + * @generated from protobuf field: string request_type_url = 2; + */ + requestTypeUrl: string; + /** + * If true, the request is streamed. + * + * @generated from protobuf field: bool request_streaming = 3; + */ + requestStreaming: boolean; + /** + * The URL of the output message type. + * + * @generated from protobuf field: string response_type_url = 4; + */ + responseTypeUrl: string; + /** + * If true, the response is streamed. + * + * @generated from protobuf field: bool response_streaming = 5; + */ + responseStreaming: boolean; + /** + * Any metadata attached to the method. + * + * @generated from protobuf field: repeated google.protobuf.Option options = 6; + */ + options: Option[]; + /** + * The source syntax of this method. + * + * @generated from protobuf field: google.protobuf.Syntax syntax = 7; + */ + syntax: Syntax; +} +/** + * Declares an API Interface to be included in this interface. The including + * interface must redeclare all the methods from the included interface, but + * documentation and options are inherited as follows: + * + * - If after comment and whitespace stripping, the documentation + * string of the redeclared method is empty, it will be inherited + * from the original method. + * + * - Each annotation belonging to the service config (http, + * visibility) which is not set in the redeclared method will be + * inherited. + * + * - If an http annotation is inherited, the path pattern will be + * modified as follows. Any version prefix will be replaced by the + * version of the including interface plus the [root][] path if + * specified. + * + * Example of a simple mixin: + * + * package google.acl.v1; + * service AccessControl { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v1/{resource=**}:getAcl"; + * } + * } + * + * package google.storage.v2; + * service Storage { + * rpc GetAcl(GetAclRequest) returns (Acl); + * + * // Get a data record. + * rpc GetData(GetDataRequest) returns (Data) { + * option (google.api.http).get = "/v2/{resource=**}"; + * } + * } + * + * Example of a mixin configuration: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * + * The mixin construct implies that all methods in `AccessControl` are + * also declared with same name and request/response types in + * `Storage`. A documentation generator or annotation processor will + * see the effective `Storage.GetAcl` method after inherting + * documentation and annotations as follows: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/{resource=**}:getAcl"; + * } + * ... + * } + * + * Note how the version in the path pattern changed from `v1` to `v2`. + * + * If the `root` field in the mixin is specified, it should be a + * relative path under which inherited HTTP paths are placed. Example: + * + * apis: + * - name: google.storage.v2.Storage + * mixins: + * - name: google.acl.v1.AccessControl + * root: acls + * + * This implies the following inherited HTTP annotation: + * + * service Storage { + * // Get the underlying ACL object. + * rpc GetAcl(GetAclRequest) returns (Acl) { + * option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; + * } + * ... + * } + * + * @generated from protobuf message google.protobuf.Mixin + */ +export interface Mixin { + /** + * The fully qualified name of the interface which is included. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * @generated from protobuf field: string root = 2; + */ + root: string; +} +// @generated message type with reflection information, may provide speed optimized methods +class Api$Type extends MessageType { + constructor() { + super("google.protobuf.Api", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "methods", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Method }, + { no: 3, name: "options", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Option }, + { no: 4, name: "version", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "source_context", kind: "message", T: () => SourceContext }, + { no: 6, name: "mixins", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Mixin }, + { no: 7, name: "syntax", kind: "enum", T: () => ["google.protobuf.Syntax", Syntax, "SYNTAX_"] } + ]); + } + create(value?: PartialMessage): Api { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.methods = []; + message.options = []; + message.version = ""; + message.mixins = []; + message.syntax = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Api): Api { + 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.protobuf.Method methods */ 2: + message.methods.push(Method.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.Option options */ 3: + message.options.push(Option.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string version */ 4: + message.version = reader.string(); + break; + case /* google.protobuf.SourceContext source_context */ 5: + message.sourceContext = SourceContext.internalBinaryRead(reader, reader.uint32(), options, message.sourceContext); + break; + case /* repeated google.protobuf.Mixin mixins */ 6: + message.mixins.push(Mixin.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* google.protobuf.Syntax syntax */ 7: + message.syntax = 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: Api, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.Method methods = 2; */ + for (let i = 0; i < message.methods.length; i++) + Method.internalBinaryWrite(message.methods[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.Option options = 3; */ + for (let i = 0; i < message.options.length; i++) + Option.internalBinaryWrite(message.options[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* string version = 4; */ + if (message.version !== "") + writer.tag(4, WireType.LengthDelimited).string(message.version); + /* google.protobuf.SourceContext source_context = 5; */ + if (message.sourceContext) + SourceContext.internalBinaryWrite(message.sourceContext, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.Mixin mixins = 6; */ + for (let i = 0; i < message.mixins.length; i++) + Mixin.internalBinaryWrite(message.mixins[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Syntax syntax = 7; */ + if (message.syntax !== 0) + writer.tag(7, WireType.Varint).int32(message.syntax); + 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.Api + */ +export const Api = new Api$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Method$Type extends MessageType { + constructor() { + super("google.protobuf.Method", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "request_type_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "request_streaming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 4, name: "response_type_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 5, name: "response_streaming", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 6, name: "options", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Option }, + { no: 7, name: "syntax", kind: "enum", T: () => ["google.protobuf.Syntax", Syntax, "SYNTAX_"] } + ]); + } + create(value?: PartialMessage): Method { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.requestTypeUrl = ""; + message.requestStreaming = false; + message.responseTypeUrl = ""; + message.responseStreaming = false; + message.options = []; + message.syntax = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Method): Method { + 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 request_type_url */ 2: + message.requestTypeUrl = reader.string(); + break; + case /* bool request_streaming */ 3: + message.requestStreaming = reader.bool(); + break; + case /* string response_type_url */ 4: + message.responseTypeUrl = reader.string(); + break; + case /* bool response_streaming */ 5: + message.responseStreaming = reader.bool(); + break; + case /* repeated google.protobuf.Option options */ 6: + message.options.push(Option.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* google.protobuf.Syntax syntax */ 7: + message.syntax = 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: Method, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string request_type_url = 2; */ + if (message.requestTypeUrl !== "") + writer.tag(2, WireType.LengthDelimited).string(message.requestTypeUrl); + /* bool request_streaming = 3; */ + if (message.requestStreaming !== false) + writer.tag(3, WireType.Varint).bool(message.requestStreaming); + /* string response_type_url = 4; */ + if (message.responseTypeUrl !== "") + writer.tag(4, WireType.LengthDelimited).string(message.responseTypeUrl); + /* bool response_streaming = 5; */ + if (message.responseStreaming !== false) + writer.tag(5, WireType.Varint).bool(message.responseStreaming); + /* repeated google.protobuf.Option options = 6; */ + for (let i = 0; i < message.options.length; i++) + Option.internalBinaryWrite(message.options[i], writer.tag(6, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Syntax syntax = 7; */ + if (message.syntax !== 0) + writer.tag(7, WireType.Varint).int32(message.syntax); + 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.Method + */ +export const Method = new Method$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Mixin$Type extends MessageType { + constructor() { + super("google.protobuf.Mixin", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "root", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Mixin { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.root = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Mixin): Mixin { + 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 root */ 2: + message.root = 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: Mixin, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* string root = 2; */ + if (message.root !== "") + writer.tag(2, WireType.LengthDelimited).string(message.root); + 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.Mixin + */ +export const Mixin = new Mixin$Type(); diff --git a/google/protobuf/compiler/plugin.ts b/google/protobuf/compiler/plugin.ts new file mode 100644 index 0000000..b2b95a1 --- /dev/null +++ b/google/protobuf/compiler/plugin.ts @@ -0,0 +1,478 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/protobuf/compiler/plugin.proto" (package "google.protobuf.compiler", 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) +// +// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to +// change. +// +// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is +// just a program that reads a CodeGeneratorRequest from stdin and writes a +// CodeGeneratorResponse to stdout. +// +// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead +// of dealing with the raw protocol defined here. +// +// A plugin executable needs only to be placed somewhere in the path. The +// plugin should be named "protoc-gen-$NAME", and will then be used when the +// flag "--${NAME}_out" is passed to protoc. +// +import type { BinaryWriteOptions } from "@protobuf-ts/runtime"; +import type { IBinaryWriter } from "@protobuf-ts/runtime"; +import { WireType } from "@protobuf-ts/runtime"; +import type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +import { FileDescriptorProto } from "../descriptor"; +/** + * The version number of protocol compiler. + * + * @generated from protobuf message google.protobuf.compiler.Version + */ +export interface Version { + /** + * @generated from protobuf field: optional int32 major = 1; + */ + major?: number; + /** + * @generated from protobuf field: optional int32 minor = 2; + */ + minor?: number; + /** + * @generated from protobuf field: optional int32 patch = 3; + */ + patch?: number; + /** + * A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should + * be empty for mainline stable releases. + * + * @generated from protobuf field: optional string suffix = 4; + */ + suffix?: string; +} +/** + * An encoded CodeGeneratorRequest is written to the plugin's stdin. + * + * @generated from protobuf message google.protobuf.compiler.CodeGeneratorRequest + */ +export interface CodeGeneratorRequest { + /** + * The .proto files that were explicitly listed on the command-line. The + * code generator should generate code only for these files. Each file's + * descriptor will be included in proto_file, below. + * + * @generated from protobuf field: repeated string file_to_generate = 1; + */ + fileToGenerate: string[]; + /** + * The generator parameter passed on the command-line. + * + * @generated from protobuf field: optional string parameter = 2; + */ + parameter?: string; + /** + * FileDescriptorProtos for all files in files_to_generate and everything + * they import. The files will appear in topological order, so each file + * appears before any file that imports it. + * + * protoc guarantees that all proto_files will be written after + * the fields above, even though this is not technically guaranteed by the + * protobuf wire format. This theoretically could allow a plugin to stream + * in the FileDescriptorProtos and handle them one by one rather than read + * the entire set into memory at once. However, as of this writing, this + * is not similarly optimized on protoc's end -- it will store all fields in + * memory at once before sending them to the plugin. + * + * Type names of fields and extensions in the FileDescriptorProto are always + * fully qualified. + * + * @generated from protobuf field: repeated google.protobuf.FileDescriptorProto proto_file = 15; + */ + protoFile: FileDescriptorProto[]; + /** + * The version number of protocol compiler. + * + * @generated from protobuf field: optional google.protobuf.compiler.Version compiler_version = 3; + */ + compilerVersion?: Version; +} +/** + * The plugin writes an encoded CodeGeneratorResponse to stdout. + * + * @generated from protobuf message google.protobuf.compiler.CodeGeneratorResponse + */ +export interface CodeGeneratorResponse { + /** + * Error message. If non-empty, code generation failed. The plugin process + * should exit with status code zero even if it reports an error in this way. + * + * This should be used to indicate errors in .proto files which prevent the + * code generator from generating correct code. Errors which indicate a + * problem in protoc itself -- such as the input CodeGeneratorRequest being + * unparseable -- should be reported by writing a message to stderr and + * exiting with a non-zero status code. + * + * @generated from protobuf field: optional string error = 1; + */ + error?: string; + /** + * @generated from protobuf field: repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; + */ + file: CodeGeneratorResponse_File[]; +} +/** + * Represents a single generated file. + * + * @generated from protobuf message google.protobuf.compiler.CodeGeneratorResponse.File + */ +export interface CodeGeneratorResponse_File { + /** + * The file name, relative to the output directory. The name must not + * contain "." or ".." components and must be relative, not be absolute (so, + * the file cannot lie outside the output directory). "/" must be used as + * the path separator, not "\". + * + * If the name is omitted, the content will be appended to the previous + * file. This allows the generator to break large files into small chunks, + * and allows the generated text to be streamed back to protoc so that large + * files need not reside completely in memory at one time. Note that as of + * this writing protoc does not optimize for this -- it will read the entire + * CodeGeneratorResponse before writing files to disk. + * + * @generated from protobuf field: optional string name = 1; + */ + name?: string; + /** + * If non-empty, indicates that the named file should already exist, and the + * content here is to be inserted into that file at a defined insertion + * point. This feature allows a code generator to extend the output + * produced by another code generator. The original generator may provide + * insertion points by placing special annotations in the file that look + * like: + * @@protoc_insertion_point(NAME) + * The annotation can have arbitrary text before and after it on the line, + * which allows it to be placed in a comment. NAME should be replaced with + * an identifier naming the point -- this is what other generators will use + * as the insertion_point. Code inserted at this point will be placed + * immediately above the line containing the insertion point (thus multiple + * insertions to the same point will come out in the order they were added). + * The double-@ is intended to make it unlikely that the generated code + * could contain things that look like insertion points by accident. + * + * For example, the C++ code generator places the following line in the + * .pb.h files that it generates: + * // @@protoc_insertion_point(namespace_scope) + * This line appears within the scope of the file's package namespace, but + * outside of any particular class. Another plugin can then specify the + * insertion_point "namespace_scope" to generate additional classes or + * other declarations that should be placed in this scope. + * + * Note that if the line containing the insertion point begins with + * whitespace, the same whitespace will be added to every line of the + * inserted text. This is useful for languages like Python, where + * indentation matters. In these languages, the insertion point comment + * should be indented the same amount as any inserted code will need to be + * in order to work correctly in that context. + * + * The code generator that generates the initial file and the one which + * inserts into it must both run as part of a single invocation of protoc. + * Code generators are executed in the order in which they appear on the + * command line. + * + * If |insertion_point| is present, |name| must also be present. + * + * @generated from protobuf field: optional string insertion_point = 2; + */ + insertionPoint?: string; + /** + * The file contents. + * + * @generated from protobuf field: optional string content = 15; + */ + content?: string; +} +// @generated message type with reflection information, may provide speed optimized methods +class Version$Type extends MessageType { + constructor() { + super("google.protobuf.compiler.Version", [ + { no: 1, name: "major", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 2, name: "minor", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "patch", kind: "scalar", opt: true, T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "suffix", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Version { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Version): Version { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional int32 major */ 1: + message.major = reader.int32(); + break; + case /* optional int32 minor */ 2: + message.minor = reader.int32(); + break; + case /* optional int32 patch */ 3: + message.patch = reader.int32(); + break; + case /* optional string suffix */ 4: + message.suffix = 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: Version, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional int32 major = 1; */ + if (message.major !== undefined) + writer.tag(1, WireType.Varint).int32(message.major); + /* optional int32 minor = 2; */ + if (message.minor !== undefined) + writer.tag(2, WireType.Varint).int32(message.minor); + /* optional int32 patch = 3; */ + if (message.patch !== undefined) + writer.tag(3, WireType.Varint).int32(message.patch); + /* optional string suffix = 4; */ + if (message.suffix !== undefined) + writer.tag(4, WireType.LengthDelimited).string(message.suffix); + 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.compiler.Version + */ +export const Version = new Version$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CodeGeneratorRequest$Type extends MessageType { + constructor() { + super("google.protobuf.compiler.CodeGeneratorRequest", [ + { no: 1, name: "file_to_generate", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "parameter", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: "proto_file", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => FileDescriptorProto }, + { no: 3, name: "compiler_version", kind: "message", T: () => Version } + ]); + } + create(value?: PartialMessage): CodeGeneratorRequest { + const message = globalThis.Object.create((this.messagePrototype!)); + message.fileToGenerate = []; + message.protoFile = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CodeGeneratorRequest): CodeGeneratorRequest { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string file_to_generate */ 1: + message.fileToGenerate.push(reader.string()); + break; + case /* optional string parameter */ 2: + message.parameter = reader.string(); + break; + case /* repeated google.protobuf.FileDescriptorProto proto_file */ 15: + message.protoFile.push(FileDescriptorProto.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* optional google.protobuf.compiler.Version compiler_version */ 3: + message.compilerVersion = Version.internalBinaryRead(reader, reader.uint32(), options, message.compilerVersion); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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: CodeGeneratorRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string file_to_generate = 1; */ + for (let i = 0; i < message.fileToGenerate.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.fileToGenerate[i]); + /* optional string parameter = 2; */ + if (message.parameter !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.parameter); + /* repeated google.protobuf.FileDescriptorProto proto_file = 15; */ + for (let i = 0; i < message.protoFile.length; i++) + FileDescriptorProto.internalBinaryWrite(message.protoFile[i], writer.tag(15, WireType.LengthDelimited).fork(), options).join(); + /* optional google.protobuf.compiler.Version compiler_version = 3; */ + if (message.compilerVersion) + Version.internalBinaryWrite(message.compilerVersion, 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; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.compiler.CodeGeneratorRequest + */ +export const CodeGeneratorRequest = new CodeGeneratorRequest$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CodeGeneratorResponse$Type extends MessageType { + constructor() { + super("google.protobuf.compiler.CodeGeneratorResponse", [ + { no: 1, name: "error", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: "file", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => CodeGeneratorResponse_File } + ]); + } + create(value?: PartialMessage): CodeGeneratorResponse { + const message = globalThis.Object.create((this.messagePrototype!)); + message.file = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CodeGeneratorResponse): CodeGeneratorResponse { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* optional string error */ 1: + message.error = reader.string(); + break; + case /* repeated google.protobuf.compiler.CodeGeneratorResponse.File file */ 15: + message.file.push(CodeGeneratorResponse_File.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: CodeGeneratorResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string error = 1; */ + if (message.error !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.error); + /* repeated google.protobuf.compiler.CodeGeneratorResponse.File file = 15; */ + for (let i = 0; i < message.file.length; i++) + CodeGeneratorResponse_File.internalBinaryWrite(message.file[i], writer.tag(15, 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.protobuf.compiler.CodeGeneratorResponse + */ +export const CodeGeneratorResponse = new CodeGeneratorResponse$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class CodeGeneratorResponse_File$Type extends MessageType { + constructor() { + super("google.protobuf.compiler.CodeGeneratorResponse.File", [ + { no: 1, name: "name", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "insertion_point", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ }, + { no: 15, name: "content", kind: "scalar", opt: true, T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): CodeGeneratorResponse_File { + const message = globalThis.Object.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: CodeGeneratorResponse_File): CodeGeneratorResponse_File { + 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 insertion_point */ 2: + message.insertionPoint = reader.string(); + break; + case /* optional string content */ 15: + message.content = 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: CodeGeneratorResponse_File, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* optional string name = 1; */ + if (message.name !== undefined) + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* optional string insertion_point = 2; */ + if (message.insertionPoint !== undefined) + writer.tag(2, WireType.LengthDelimited).string(message.insertionPoint); + /* optional string content = 15; */ + if (message.content !== undefined) + writer.tag(15, WireType.LengthDelimited).string(message.content); + 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.compiler.CodeGeneratorResponse.File + */ +export const CodeGeneratorResponse_File = new CodeGeneratorResponse_File$Type(); diff --git a/google/protobuf/descriptor.ts b/google/protobuf/descriptor.ts new file mode 100644 index 0000000..4064828 --- /dev/null +++ b/google/protobuf/descriptor.ts @@ -0,0 +1,3422 @@ +// @generated by protobuf-ts 2.9.5 +// @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 { 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 { + /** + * @generated from protobuf field: repeated google.protobuf.FileDescriptorProto file = 1; + */ + file: FileDescriptorProto[]; +} +/** + * Describes a complete .proto file. + * + * @generated from protobuf message google.protobuf.FileDescriptorProto + */ +export interface FileDescriptorProto { + /** + * @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[]; + /** + * 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" and "proto3". + * + * @generated from protobuf field: optional string syntax = 12; + */ + syntax?: string; +} +/** + * Describes a message type. + * + * @generated from protobuf message google.protobuf.DescriptorProto + */ +export interface DescriptorProto { + /** + * @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[]; +} +/** + * @generated from protobuf message google.protobuf.DescriptorProto.ExtensionRange + */ +export interface DescriptorProto_ExtensionRange { + /** + * @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 { + /** + * @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. + * + * @generated from protobuf field: repeated google.protobuf.UninterpretedOption uninterpreted_option = 999; + */ + uninterpretedOption: UninterpretedOption[]; +} +/** + * Describes a field within a message. + * + * @generated from protobuf message google.protobuf.FieldDescriptorProto + */ +export interface FieldDescriptorProto { + /** + * @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. + * TODO(kenton): Base-64 encode? + * + * @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; +} +/** + * @generated from protobuf enum google.protobuf.FieldDescriptorProto.Type + */ +export enum FieldDescriptorProto_Type { + /** + * @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 in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + * + * @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 { + /** + * @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_REQUIRED = 2; + */ + REQUIRED = 2, + /** + * @generated from protobuf enum value: LABEL_REPEATED = 3; + */ + REPEATED = 3 +} +/** + * Describes a oneof. + * + * @generated from protobuf message google.protobuf.OneofDescriptorProto + */ +export interface OneofDescriptorProto { + /** + * @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. + * + * @generated from protobuf message google.protobuf.EnumDescriptorProto + */ +export interface EnumDescriptorProto { + /** + * @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[]; +} +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + * + * @generated from protobuf message google.protobuf.EnumDescriptorProto.EnumReservedRange + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** + * @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. + * + * @generated from protobuf message google.protobuf.EnumValueDescriptorProto + */ +export interface EnumValueDescriptorProto { + /** + * @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. + * + * @generated from protobuf message google.protobuf.ServiceDescriptorProto + */ +export interface ServiceDescriptorProto { + /** + * @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. + * + * @generated from protobuf message google.protobuf.MethodDescriptorProto + */ +export interface MethodDescriptorProto { + /** + * @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. + * + * @generated from protobuf field: optional string java_package = 1; + */ + javaPackage?: string; + /** + * If set, all the classes from the .proto file are wrapped in a single + * outer class with the given name. This applies to both Proto1 + * (equivalent to the old "--one_java_file" option) and Proto2 (where + * a .proto always translates to a single class, but you may want to + * explicitly choose the class name). + * + * @generated from protobuf field: optional string java_outer_classname = 8; + */ + javaOuterClassname?: string; + /** + * If set true, 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 outer class + * named by java_outer_classname. However, the outer 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; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + * + * @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; + /** + * @generated from protobuf field: optional bool php_generic_services = 42; + */ + phpGenericServices?: 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; + /** + * 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 from protobuf enum google.protobuf.FileOptions.OptimizeMode + */ +export enum FileOptions_OptimizeMode { + /** + * @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. + * + * @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; + /** + * 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 { + /** + * 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 not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + * + * @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. + * + * @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 implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * + * @generated from protobuf field: optional bool lazy = 5; + */ + lazy?: 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; + /** + * 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 enum google.protobuf.FieldOptions.CType + */ +export enum FieldOptions_CType { + /** + * Default mode. + * + * @generated from protobuf enum value: STRING = 0; + */ + STRING = 0, + /** + * @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 { + /** + * 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 +} +/** + * @generated from protobuf message google.protobuf.OneofOptions + */ +export interface OneofOptions { + /** + * 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. + * + * @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; + /** + * 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. + * + * @generated from protobuf field: optional bool deprecated = 1; + */ + 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.ServiceOptions + */ +export interface ServiceOptions { + // 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 { + // 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; + /** + * 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 { + /** + * @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. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + * + * @generated from protobuf message google.protobuf.UninterpretedOption + */ +export interface UninterpretedOption { + /** + * @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?: bigint; + /** + * @generated from protobuf field: optional int64 negative_int_value = 5; + */ + negativeIntValue?: bigint; + /** + * @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], ["qux", false] } represents + * "foo.(bar.baz).qux". + * + * @generated from protobuf message google.protobuf.UninterpretedOption.NamePart + */ +export interface UninterpretedOption_NamePart { + /** + * @generated from protobuf field: string name_part = 1; + */ + namePart: string; + /** + * @generated from protobuf field: bool is_extension = 2; + */ + isExtension: boolean; +} +// =================================================================== +// 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. + * + * @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. 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 qux. + * // + * // Another line attached to qux. + * optional double qux = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to qux 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. + * + * @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. + * + * @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 offset. 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 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 = globalThis.Object.create((this.messagePrototype!)); + message.file = []; + 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); + } + } + return message; + } + 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; + } +} +/** + * @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: 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*/ } + ]); + } + create(value?: PartialMessage): FileDescriptorProto { + const message = globalThis.Object.create((this.messagePrototype!)); + message.dependency = []; + message.publicDependency = []; + message.weakDependency = []; + message.messageType = []; + message.enumType = []; + message.service = []; + message.extension = []; + 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 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; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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 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); + 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.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*/ } + ]); + } + create(value?: PartialMessage): DescriptorProto { + const message = globalThis.Object.create((this.messagePrototype!)); + message.field = []; + message.extension = []; + message.nestedType = []; + message.enumType = []; + message.extensionRange = []; + message.oneofDecl = []; + message.reservedRange = []; + message.reservedName = []; + 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; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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]); + 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.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.create((this.messagePrototype!)); + 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; + } + 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; + } +} +/** + * @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.create((this.messagePrototype!)); + 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; + } + 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; + } +} +/** + * @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 } + ]); + } + create(value?: PartialMessage): ExtensionRangeOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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(); + 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.ExtensionRangeOptions + */ +export const ExtensionRangeOptions = new ExtensionRangeOptions$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 } + ]); + } + create(value?: PartialMessage): FieldDescriptorProto { + const message = globalThis.Object.create((this.messagePrototype!)); + 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; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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(); + 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.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.create((this.messagePrototype!)); + 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; + } + 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; + } +} +/** + * @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*/ } + ]); + } + create(value?: PartialMessage): EnumDescriptorProto { + const message = globalThis.Object.create((this.messagePrototype!)); + message.value = []; + message.reservedRange = []; + message.reservedName = []; + 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; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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: 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]); + 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.create((this.messagePrototype!)); + 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); + } + } + return message; + } + 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; + } +} +/** + * @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.create((this.messagePrototype!)); + 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; + } + 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; + } +} +/** + * @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 = globalThis.Object.create((this.messagePrototype!)); + message.method = []; + 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; + } + 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; + } +} +/** + * @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.create((this.messagePrototype!)); + 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; + } +} +/** + * @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: 42, name: "php_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: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): FileOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 php_generic_services */ 42: + message.phpGenericServices = 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 /* 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 php_generic_services = 42; */ + if (message.phpGenericServices !== undefined) + writer.tag(42, WireType.Varint).bool(message.phpGenericServices); + /* 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); + /* 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; + } +} +/** + * @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: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): MessageOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 /* 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); + /* 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; + } +} +/** + * @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: 3, name: "deprecated", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 10, name: "weak", kind: "scalar", opt: true, T: 8 /*ScalarType.BOOL*/ }, + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): FieldOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 deprecated */ 3: + message.deprecated = reader.bool(); + break; + case /* optional bool weak */ 10: + message.weak = 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; + } + 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 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); + /* 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; + } +} +/** + * @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 OneofOptions$Type extends MessageType { + constructor() { + super("google.protobuf.OneofOptions", [ + { no: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): OneofOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 /* 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: OneofOptions, 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(); + 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.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: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): EnumOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 /* 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); + /* 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; + } +} +/** + * @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: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): EnumValueOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 /* 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); + /* 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; + } +} +/** + * @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: 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 = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 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; + } + internalBinaryWrite(message: ServiceOptions, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* 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; + } +} +/** + * @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: 999, name: "uninterpreted_option", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => UninterpretedOption } + ]); + } + create(value?: PartialMessage): MethodOptions { + const message = globalThis.Object.create((this.messagePrototype!)); + message.uninterpretedOption = []; + 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 /* 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); + /* 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; + } +} +/** + * @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*/, L: 0 /*LongType.BIGINT*/ }, + { no: 5, name: "negative_int_value", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ }, + { 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 = globalThis.Object.create((this.messagePrototype!)); + message.name = []; + 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().toBigInt(); + break; + case /* optional int64 negative_int_value */ 5: + message.negativeIntValue = reader.int64().toBigInt(); + 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; + } +} +/** + * @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 = globalThis.Object.create((this.messagePrototype!)); + message.namePart = ""; + message.isExtension = false; + 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; + } + 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; + } +} +/** + * @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 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 = globalThis.Object.create((this.messagePrototype!)); + message.location = []; + 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; + } + 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; + } +} +/** + * @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 = globalThis.Object.create((this.messagePrototype!)); + message.path = []; + message.span = []; + message.leadingDetachedComments = []; + 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; + } +} +/** + * @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 = globalThis.Object.create((this.messagePrototype!)); + message.annotation = []; + 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; + } + 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; + } +} +/** + * @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*/ } + ]); + } + create(value?: PartialMessage): GeneratedCodeInfo_Annotation { + const message = globalThis.Object.create((this.messagePrototype!)); + message.path = []; + 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; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire 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: 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); + 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.GeneratedCodeInfo.Annotation + */ +export const GeneratedCodeInfo_Annotation = new GeneratedCodeInfo_Annotation$Type(); diff --git a/google/protobuf/duration.ts b/google/protobuf/duration.ts new file mode 100644 index 0000000..654eb8d --- /dev/null +++ b/google/protobuf/duration.ts @@ -0,0 +1,231 @@ +// @generated by protobuf-ts 2.9.5 +// @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 { 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 + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + * + * + * + * @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 + * + * @generated from protobuf field: int64 seconds = 1; + */ + seconds: bigint; + /** + * 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; +} +// @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*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); + } + /** + * 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; + } + 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.toBigInt(); + if (typeof nanos == "string") { + let nanosStr = sign + nanos + "0".repeat(9 - nanos.length); + target.nanos = parseInt(nanosStr); + } + return target; + } + create(value?: PartialMessage): Duration { + const message = globalThis.Object.create((this.messagePrototype!)); + message.seconds = 0n; + message.nanos = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + 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().toBigInt(); + 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 !== 0n) + 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; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.Duration + */ +export const Duration = new Duration$Type(); diff --git a/google/protobuf/empty.ts b/google/protobuf/empty.ts new file mode 100644 index 0000000..786d2a7 --- /dev/null +++ b/google/protobuf/empty.ts @@ -0,0 +1,95 @@ +// @generated by protobuf-ts 2.9.5 +// @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 type { BinaryReadOptions } from "@protobuf-ts/runtime"; +import type { IBinaryReader } from "@protobuf-ts/runtime"; +import { UnknownFieldHandler } from "@protobuf-ts/runtime"; +import type { PartialMessage } from "@protobuf-ts/runtime"; +import { reflectionMergePartial } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +/** + * A generic empty message that you can re-use to avoid defining duplicated + * empty messages in your APIs. A typical example is to use it as the request + * or the response type of an API method. For instance: + * + * service Foo { + * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + * } + * + * The JSON representation for `Empty` is empty JSON object `{}`. + * + * @generated from protobuf message google.protobuf.Empty + */ +export interface Empty { +} +// @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.create((this.messagePrototype!)); + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Empty): Empty { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Empty, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.Empty + */ +export const Empty = new Empty$Type(); diff --git a/google/protobuf/field_mask.ts b/google/protobuf/field_mask.ts new file mode 100644 index 0000000..cad6b9b --- /dev/null +++ b/google/protobuf/field_mask.ts @@ -0,0 +1,336 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/protobuf/field_mask.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 { typeofJsonValue } from "@protobuf-ts/runtime"; +import type { JsonValue } from "@protobuf-ts/runtime"; +import { lowerCamelCase } from "@protobuf-ts/runtime"; +import type { JsonReadOptions } from "@protobuf-ts/runtime"; +import type { JsonWriteOptions } from "@protobuf-ts/runtime"; +import { MessageType } from "@protobuf-ts/runtime"; +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + * + * @generated from protobuf message google.protobuf.FieldMask + */ +export interface FieldMask { + /** + * The set of field mask paths. + * + * @generated from protobuf field: repeated string paths = 1; + */ + paths: string[]; +} +// @generated message type with reflection information, may provide speed optimized methods +class FieldMask$Type extends MessageType { + constructor() { + super("google.protobuf.FieldMask", [ + { no: 1, name: "paths", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } + ]); + } + /** + * Encode `FieldMask` to JSON object. + */ + internalJsonWrite(message: FieldMask, options: JsonWriteOptions): JsonValue { + const invalidFieldMaskJsonRegex = /[A-Z]|(_([.0-9_]|$))/g; + return message.paths.map(p => { + if (invalidFieldMaskJsonRegex.test(p)) + throw new Error("Unable to encode FieldMask to JSON. lowerCamelCase of path name \"" + p + "\" is irreversible."); + return lowerCamelCase(p); + }).join(","); + } + /** + * Decode `FieldMask` from JSON object. + */ + internalJsonRead(json: JsonValue, options: JsonReadOptions, target?: FieldMask): FieldMask { + if (typeof json !== "string") + throw new Error("Unable to parse FieldMask from JSON " + typeofJsonValue(json) + ". Expected string."); + if (!target) + target = this.create(); + if (json === "") + return target; + let camelToSnake = (str: string) => { + if (str.includes("_")) + throw new Error("Unable to parse FieldMask from JSON. Path names must be lowerCamelCase."); + let sc = str.replace(/[A-Z]/g, letter => "_" + letter.toLowerCase()); + return sc; + }; + target.paths = json.split(",").map(camelToSnake); + return target; + } + create(value?: PartialMessage): FieldMask { + const message = globalThis.Object.create((this.messagePrototype!)); + message.paths = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: FieldMask): FieldMask { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated string paths */ 1: + message.paths.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: FieldMask, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated string paths = 1; */ + for (let i = 0; i < message.paths.length; i++) + writer.tag(1, WireType.LengthDelimited).string(message.paths[i]); + 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.FieldMask + */ +export const FieldMask = new FieldMask$Type(); diff --git a/google/protobuf/source_context.ts b/google/protobuf/source_context.ts new file mode 100644 index 0000000..c8f19fb --- /dev/null +++ b/google/protobuf/source_context.ts @@ -0,0 +1,105 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/protobuf/source_context.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 { MessageType } from "@protobuf-ts/runtime"; +/** + * `SourceContext` represents information about the source of a + * protobuf element, like the file in which it is defined. + * + * @generated from protobuf message google.protobuf.SourceContext + */ +export interface SourceContext { + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * @generated from protobuf field: string file_name = 1; + */ + fileName: string; +} +// @generated message type with reflection information, may provide speed optimized methods +class SourceContext$Type extends MessageType { + constructor() { + super("google.protobuf.SourceContext", [ + { no: 1, name: "file_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): SourceContext { + const message = globalThis.Object.create((this.messagePrototype!)); + message.fileName = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SourceContext): SourceContext { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string file_name */ 1: + message.fileName = 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: SourceContext, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string file_name = 1; */ + if (message.fileName !== "") + writer.tag(1, WireType.LengthDelimited).string(message.fileName); + 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.SourceContext + */ +export const SourceContext = new SourceContext$Type(); diff --git a/google/protobuf/struct.ts b/google/protobuf/struct.ts new file mode 100644 index 0000000..17e3a03 --- /dev/null +++ b/google/protobuf/struct.ts @@ -0,0 +1,482 @@ +// @generated by protobuf-ts 2.9.5 +// @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 { 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` + * might be supported by a native representation. For example, in + * scripting languages like JS a struct is represented as an + * object. The details of that representation are described together + * with the proto support for the language. + * + * The JSON representation for `Struct` is JSON object. + * + * @generated from protobuf message google.protobuf.Struct + */ +export interface Struct { + /** + * 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 + * list of values. A producer of value is expected to set one of that + * 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 { + /** + * @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. + * + * @generated from protobuf field: repeated google.protobuf.Value values = 1; + */ + values: Value[]; +} +/** + * `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 +} +// @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 } } + ]); + } + /** + * 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 json; + } + /** + * 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; + } + create(value?: PartialMessage): Struct { + const message = globalThis.Object.create((this.messagePrototype!)); + message.fields = {}; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + 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); + } + } + return message; + } + 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(); + } + internalBinaryWrite(message: Struct, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* map fields = 1; */ + for (let k of globalThis.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; + } +} +/** + * @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 } + ]); + } + /** + * 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); + } + } + /** + * 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)); + } + return target; + } + create(value?: PartialMessage): Value { + const message = globalThis.Object.create((this.messagePrototype!)); + message.kind = { oneofKind: undefined }; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + 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); + } + } + return message; + } + 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; + } +} +/** + * @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 } + ]); + } + /** + * Encode `ListValue` to JSON array. + */ + internalJsonWrite(message: ListValue, options: JsonWriteOptions): JsonValue { + return message.values.map(v => Value.toJson(v)); + } + /** + * 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; + } + create(value?: PartialMessage): ListValue { + const message = globalThis.Object.create((this.messagePrototype!)); + message.values = []; + 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; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.ListValue + */ +export const ListValue = new ListValue$Type(); diff --git a/google/protobuf/timestamp.ts b/google/protobuf/timestamp.ts new file mode 100644 index 0000000..2c5510b --- /dev/null +++ b/google/protobuf/timestamp.ts @@ -0,0 +1,281 @@ +// @generated by protobuf-ts 2.9.5 +// @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 { 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 + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * + * Example 5: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) 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. + * + * @generated from protobuf field: int64 seconds = 1; + */ + seconds: bigint; + /** + * 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; +} +// @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*/, L: 0 /*LongType.BIGINT*/ }, + { no: 2, name: "nanos", kind: "scalar", T: 5 /*ScalarType.INT32*/ } + ]); + } + /** + * 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)).toBigInt(); + msg.nanos = (ms % 1000) * 1000000; + return msg; + } + /** + * 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)).toBigInt(); + 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"; + } + return new Date(ms).toISOString().replace(".000Z", z); + } + /** + * 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).toBigInt(); + target.nanos = 0; + if (matches[7]) + target.nanos = (parseInt("1" + matches[7] + "0".repeat(9 - matches[7].length)) - 1000000000); + return target; + } + create(value?: PartialMessage): Timestamp { + const message = globalThis.Object.create((this.messagePrototype!)); + message.seconds = 0n; + message.nanos = 0; + 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().toBigInt(); + 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 !== 0n) + 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; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.Timestamp + */ +export const Timestamp = new Timestamp$Type(); diff --git a/google/protobuf/type.ts b/google/protobuf/type.ts new file mode 100644 index 0000000..395adfe --- /dev/null +++ b/google/protobuf/type.ts @@ -0,0 +1,816 @@ +// @generated by protobuf-ts 2.9.5 +// @generated from protobuf file "google/protobuf/type.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 { MessageType } from "@protobuf-ts/runtime"; +import { Any } from "./any"; +import { SourceContext } from "./source_context"; +/** + * A protocol buffer message type. + * + * @generated from protobuf message google.protobuf.Type + */ +export interface Type { + /** + * The fully qualified message name. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * The list of fields. + * + * @generated from protobuf field: repeated google.protobuf.Field fields = 2; + */ + fields: Field[]; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * @generated from protobuf field: repeated string oneofs = 3; + */ + oneofs: string[]; + /** + * The protocol buffer options. + * + * @generated from protobuf field: repeated google.protobuf.Option options = 4; + */ + options: Option[]; + /** + * The source context. + * + * @generated from protobuf field: google.protobuf.SourceContext source_context = 5; + */ + sourceContext?: SourceContext; + /** + * The source syntax. + * + * @generated from protobuf field: google.protobuf.Syntax syntax = 6; + */ + syntax: Syntax; +} +/** + * A single field of a message type. + * + * @generated from protobuf message google.protobuf.Field + */ +export interface Field { + /** + * The field type. + * + * @generated from protobuf field: google.protobuf.Field.Kind kind = 1; + */ + kind: Field_Kind; + /** + * The field cardinality. + * + * @generated from protobuf field: google.protobuf.Field.Cardinality cardinality = 2; + */ + cardinality: Field_Cardinality; + /** + * The field number. + * + * @generated from protobuf field: int32 number = 3; + */ + number: number; + /** + * The field name. + * + * @generated from protobuf field: string name = 4; + */ + name: string; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * @generated from protobuf field: string type_url = 6; + */ + typeUrl: string; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * @generated from protobuf field: int32 oneof_index = 7; + */ + oneofIndex: number; + /** + * Whether to use alternative packed wire representation. + * + * @generated from protobuf field: bool packed = 8; + */ + packed: boolean; + /** + * The protocol buffer options. + * + * @generated from protobuf field: repeated google.protobuf.Option options = 9; + */ + options: Option[]; + /** + * The field JSON name. + * + * @generated from protobuf field: string json_name = 10; + */ + jsonName: string; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * @generated from protobuf field: string default_value = 11; + */ + defaultValue: string; +} +/** + * Basic field types. + * + * @generated from protobuf enum google.protobuf.Field.Kind + */ +export enum Field_Kind { + /** + * Field type unknown. + * + * @generated from protobuf enum value: TYPE_UNKNOWN = 0; + */ + TYPE_UNKNOWN = 0, + /** + * Field type double. + * + * @generated from protobuf enum value: TYPE_DOUBLE = 1; + */ + TYPE_DOUBLE = 1, + /** + * Field type float. + * + * @generated from protobuf enum value: TYPE_FLOAT = 2; + */ + TYPE_FLOAT = 2, + /** + * Field type int64. + * + * @generated from protobuf enum value: TYPE_INT64 = 3; + */ + TYPE_INT64 = 3, + /** + * Field type uint64. + * + * @generated from protobuf enum value: TYPE_UINT64 = 4; + */ + TYPE_UINT64 = 4, + /** + * Field type int32. + * + * @generated from protobuf enum value: TYPE_INT32 = 5; + */ + TYPE_INT32 = 5, + /** + * Field type fixed64. + * + * @generated from protobuf enum value: TYPE_FIXED64 = 6; + */ + TYPE_FIXED64 = 6, + /** + * Field type fixed32. + * + * @generated from protobuf enum value: TYPE_FIXED32 = 7; + */ + TYPE_FIXED32 = 7, + /** + * Field type bool. + * + * @generated from protobuf enum value: TYPE_BOOL = 8; + */ + TYPE_BOOL = 8, + /** + * Field type string. + * + * @generated from protobuf enum value: TYPE_STRING = 9; + */ + TYPE_STRING = 9, + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * @generated from protobuf enum value: TYPE_GROUP = 10; + */ + TYPE_GROUP = 10, + /** + * Field type message. + * + * @generated from protobuf enum value: TYPE_MESSAGE = 11; + */ + TYPE_MESSAGE = 11, + /** + * Field type bytes. + * + * @generated from protobuf enum value: TYPE_BYTES = 12; + */ + TYPE_BYTES = 12, + /** + * Field type uint32. + * + * @generated from protobuf enum value: TYPE_UINT32 = 13; + */ + TYPE_UINT32 = 13, + /** + * Field type enum. + * + * @generated from protobuf enum value: TYPE_ENUM = 14; + */ + TYPE_ENUM = 14, + /** + * Field type sfixed32. + * + * @generated from protobuf enum value: TYPE_SFIXED32 = 15; + */ + TYPE_SFIXED32 = 15, + /** + * Field type sfixed64. + * + * @generated from protobuf enum value: TYPE_SFIXED64 = 16; + */ + TYPE_SFIXED64 = 16, + /** + * Field type sint32. + * + * @generated from protobuf enum value: TYPE_SINT32 = 17; + */ + TYPE_SINT32 = 17, + /** + * Field type sint64. + * + * @generated from protobuf enum value: TYPE_SINT64 = 18; + */ + TYPE_SINT64 = 18 +} +/** + * Whether a field is optional, required, or repeated. + * + * @generated from protobuf enum google.protobuf.Field.Cardinality + */ +export enum Field_Cardinality { + /** + * For fields with unknown cardinality. + * + * @generated from protobuf enum value: CARDINALITY_UNKNOWN = 0; + */ + UNKNOWN = 0, + /** + * For optional fields. + * + * @generated from protobuf enum value: CARDINALITY_OPTIONAL = 1; + */ + OPTIONAL = 1, + /** + * For required fields. Proto2 syntax only. + * + * @generated from protobuf enum value: CARDINALITY_REQUIRED = 2; + */ + REQUIRED = 2, + /** + * For repeated fields. + * + * @generated from protobuf enum value: CARDINALITY_REPEATED = 3; + */ + REPEATED = 3 +} +/** + * Enum type definition. + * + * @generated from protobuf message google.protobuf.Enum + */ +export interface Enum { + /** + * Enum type name. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * Enum value definitions. + * + * @generated from protobuf field: repeated google.protobuf.EnumValue enumvalue = 2; + */ + enumvalue: EnumValue[]; + /** + * Protocol buffer options. + * + * @generated from protobuf field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; + /** + * The source context. + * + * @generated from protobuf field: google.protobuf.SourceContext source_context = 4; + */ + sourceContext?: SourceContext; + /** + * The source syntax. + * + * @generated from protobuf field: google.protobuf.Syntax syntax = 5; + */ + syntax: Syntax; +} +/** + * Enum value definition. + * + * @generated from protobuf message google.protobuf.EnumValue + */ +export interface EnumValue { + /** + * Enum value name. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * Enum value number. + * + * @generated from protobuf field: int32 number = 2; + */ + number: number; + /** + * Protocol buffer options. + * + * @generated from protobuf field: repeated google.protobuf.Option options = 3; + */ + options: Option[]; +} +/** + * A protocol buffer option, which can be attached to a message, field, + * enumeration, etc. + * + * @generated from protobuf message google.protobuf.Option + */ +export interface Option { + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * @generated from protobuf field: string name = 1; + */ + name: string; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * @generated from protobuf field: google.protobuf.Any value = 2; + */ + value?: Any; +} +/** + * The syntax in which a protocol buffer element is defined. + * + * @generated from protobuf enum google.protobuf.Syntax + */ +export enum Syntax { + /** + * Syntax `proto2`. + * + * @generated from protobuf enum value: SYNTAX_PROTO2 = 0; + */ + PROTO2 = 0, + /** + * Syntax `proto3`. + * + * @generated from protobuf enum value: SYNTAX_PROTO3 = 1; + */ + PROTO3 = 1 +} +// @generated message type with reflection information, may provide speed optimized methods +class Type$Type extends MessageType { + constructor() { + super("google.protobuf.Type", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "fields", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Field }, + { no: 3, name: "oneofs", kind: "scalar", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ }, + { no: 4, name: "options", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Option }, + { no: 5, name: "source_context", kind: "message", T: () => SourceContext }, + { no: 6, name: "syntax", kind: "enum", T: () => ["google.protobuf.Syntax", Syntax, "SYNTAX_"] } + ]); + } + create(value?: PartialMessage): Type { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.fields = []; + message.oneofs = []; + message.options = []; + message.syntax = 0; + 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 /* string name */ 1: + message.name = reader.string(); + break; + case /* repeated google.protobuf.Field fields */ 2: + message.fields.push(Field.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated string oneofs */ 3: + message.oneofs.push(reader.string()); + break; + case /* repeated google.protobuf.Option options */ 4: + message.options.push(Option.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* google.protobuf.SourceContext source_context */ 5: + message.sourceContext = SourceContext.internalBinaryRead(reader, reader.uint32(), options, message.sourceContext); + break; + case /* google.protobuf.Syntax syntax */ 6: + message.syntax = 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: Type, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.Field fields = 2; */ + for (let i = 0; i < message.fields.length; i++) + Field.internalBinaryWrite(message.fields[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated string oneofs = 3; */ + for (let i = 0; i < message.oneofs.length; i++) + writer.tag(3, WireType.LengthDelimited).string(message.oneofs[i]); + /* repeated google.protobuf.Option options = 4; */ + for (let i = 0; i < message.options.length; i++) + Option.internalBinaryWrite(message.options[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.SourceContext source_context = 5; */ + if (message.sourceContext) + SourceContext.internalBinaryWrite(message.sourceContext, writer.tag(5, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Syntax syntax = 6; */ + if (message.syntax !== 0) + writer.tag(6, WireType.Varint).int32(message.syntax); + 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.Type + */ +export const Type = new Type$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Field$Type extends MessageType { + constructor() { + super("google.protobuf.Field", [ + { no: 1, name: "kind", kind: "enum", T: () => ["google.protobuf.Field.Kind", Field_Kind] }, + { no: 2, name: "cardinality", kind: "enum", T: () => ["google.protobuf.Field.Cardinality", Field_Cardinality, "CARDINALITY_"] }, + { no: 3, name: "number", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 4, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 6, name: "type_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 7, name: "oneof_index", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 8, name: "packed", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, + { no: 9, name: "options", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Option }, + { no: 10, name: "json_name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 11, name: "default_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } + create(value?: PartialMessage): Field { + const message = globalThis.Object.create((this.messagePrototype!)); + message.kind = 0; + message.cardinality = 0; + message.number = 0; + message.name = ""; + message.typeUrl = ""; + message.oneofIndex = 0; + message.packed = false; + message.options = []; + message.jsonName = ""; + message.defaultValue = ""; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Field): Field { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* google.protobuf.Field.Kind kind */ 1: + message.kind = reader.int32(); + break; + case /* google.protobuf.Field.Cardinality cardinality */ 2: + message.cardinality = reader.int32(); + break; + case /* int32 number */ 3: + message.number = reader.int32(); + break; + case /* string name */ 4: + message.name = reader.string(); + break; + case /* string type_url */ 6: + message.typeUrl = reader.string(); + break; + case /* int32 oneof_index */ 7: + message.oneofIndex = reader.int32(); + break; + case /* bool packed */ 8: + message.packed = reader.bool(); + break; + case /* repeated google.protobuf.Option options */ 9: + message.options.push(Option.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* string json_name */ 10: + message.jsonName = reader.string(); + break; + case /* string default_value */ 11: + message.defaultValue = 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: Field, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* google.protobuf.Field.Kind kind = 1; */ + if (message.kind !== 0) + writer.tag(1, WireType.Varint).int32(message.kind); + /* google.protobuf.Field.Cardinality cardinality = 2; */ + if (message.cardinality !== 0) + writer.tag(2, WireType.Varint).int32(message.cardinality); + /* int32 number = 3; */ + if (message.number !== 0) + writer.tag(3, WireType.Varint).int32(message.number); + /* string name = 4; */ + if (message.name !== "") + writer.tag(4, WireType.LengthDelimited).string(message.name); + /* string type_url = 6; */ + if (message.typeUrl !== "") + writer.tag(6, WireType.LengthDelimited).string(message.typeUrl); + /* int32 oneof_index = 7; */ + if (message.oneofIndex !== 0) + writer.tag(7, WireType.Varint).int32(message.oneofIndex); + /* bool packed = 8; */ + if (message.packed !== false) + writer.tag(8, WireType.Varint).bool(message.packed); + /* repeated google.protobuf.Option options = 9; */ + for (let i = 0; i < message.options.length; i++) + Option.internalBinaryWrite(message.options[i], writer.tag(9, WireType.LengthDelimited).fork(), options).join(); + /* string json_name = 10; */ + if (message.jsonName !== "") + writer.tag(10, WireType.LengthDelimited).string(message.jsonName); + /* string default_value = 11; */ + if (message.defaultValue !== "") + writer.tag(11, WireType.LengthDelimited).string(message.defaultValue); + 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.Field + */ +export const Field = new Field$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Enum$Type extends MessageType { + constructor() { + super("google.protobuf.Enum", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "enumvalue", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => EnumValue }, + { no: 3, name: "options", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Option }, + { no: 4, name: "source_context", kind: "message", T: () => SourceContext }, + { no: 5, name: "syntax", kind: "enum", T: () => ["google.protobuf.Syntax", Syntax, "SYNTAX_"] } + ]); + } + create(value?: PartialMessage): Enum { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.enumvalue = []; + message.options = []; + message.syntax = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Enum): Enum { + 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.protobuf.EnumValue enumvalue */ 2: + message.enumvalue.push(EnumValue.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated google.protobuf.Option options */ 3: + message.options.push(Option.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* google.protobuf.SourceContext source_context */ 4: + message.sourceContext = SourceContext.internalBinaryRead(reader, reader.uint32(), options, message.sourceContext); + break; + case /* google.protobuf.Syntax syntax */ 5: + message.syntax = 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: Enum, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* repeated google.protobuf.EnumValue enumvalue = 2; */ + for (let i = 0; i < message.enumvalue.length; i++) + EnumValue.internalBinaryWrite(message.enumvalue[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated google.protobuf.Option options = 3; */ + for (let i = 0; i < message.options.length; i++) + Option.internalBinaryWrite(message.options[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.SourceContext source_context = 4; */ + if (message.sourceContext) + SourceContext.internalBinaryWrite(message.sourceContext, writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + /* google.protobuf.Syntax syntax = 5; */ + if (message.syntax !== 0) + writer.tag(5, WireType.Varint).int32(message.syntax); + 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.Enum + */ +export const Enum = new Enum$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class EnumValue$Type extends MessageType { + constructor() { + super("google.protobuf.EnumValue", [ + { no: 1, name: "name", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 2, name: "number", kind: "scalar", T: 5 /*ScalarType.INT32*/ }, + { no: 3, name: "options", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => Option } + ]); + } + create(value?: PartialMessage): EnumValue { + const message = globalThis.Object.create((this.messagePrototype!)); + message.name = ""; + message.number = 0; + message.options = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: EnumValue): EnumValue { + 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 /* int32 number */ 2: + message.number = reader.int32(); + break; + case /* repeated google.protobuf.Option options */ 3: + message.options.push(Option.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: EnumValue, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string name = 1; */ + if (message.name !== "") + writer.tag(1, WireType.LengthDelimited).string(message.name); + /* int32 number = 2; */ + if (message.number !== 0) + writer.tag(2, WireType.Varint).int32(message.number); + /* repeated google.protobuf.Option options = 3; */ + for (let i = 0; i < message.options.length; i++) + Option.internalBinaryWrite(message.options[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; + } +} +/** + * @generated MessageType for protobuf message google.protobuf.EnumValue + */ +export const EnumValue = new EnumValue$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Option$Type extends MessageType