// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: sequences.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { Guid } from "./protobuf-net/bcl"; export const protobufPackage = "Cratis.Chronicle.Contracts.Sequences"; export enum CompleteStreamError { COMPLETE_STREAM_ERROR_None = 0, AlreadyCompleted = 1, DefaultStreamCannotBeCompleted = 2, UNRECOGNIZED = -1, } export function completeStreamErrorFromJSON(object: any): CompleteStreamError { switch (object) { case 0: case "COMPLETE_STREAM_ERROR_None": return CompleteStreamError.COMPLETE_STREAM_ERROR_None; case 1: case "AlreadyCompleted": return CompleteStreamError.AlreadyCompleted; case 2: case "DefaultStreamCannotBeCompleted": return CompleteStreamError.DefaultStreamCannotBeCompleted; case -1: case "UNRECOGNIZED": default: return CompleteStreamError.UNRECOGNIZED; } } export function completeStreamErrorToJSON(object: CompleteStreamError): string { switch (object) { case CompleteStreamError.COMPLETE_STREAM_ERROR_None: return "COMPLETE_STREAM_ERROR_None"; case CompleteStreamError.AlreadyCompleted: return "AlreadyCompleted"; case CompleteStreamError.DefaultStreamCannotBeCompleted: return "DefaultStreamCannotBeCompleted"; case CompleteStreamError.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ConstraintType { CONSTRAINT_TYPE_Unknown = 0, Unique = 1, UniqueEventType = 2, Schema = 3, StreamClosed = 4, UNRECOGNIZED = -1, } export function constraintTypeFromJSON(object: any): ConstraintType { switch (object) { case 0: case "CONSTRAINT_TYPE_Unknown": return ConstraintType.CONSTRAINT_TYPE_Unknown; case 1: case "Unique": return ConstraintType.Unique; case 2: case "UniqueEventType": return ConstraintType.UniqueEventType; case 3: case "Schema": return ConstraintType.Schema; case 4: case "StreamClosed": return ConstraintType.StreamClosed; case -1: case "UNRECOGNIZED": default: return ConstraintType.UNRECOGNIZED; } } export function constraintTypeToJSON(object: ConstraintType): string { switch (object) { case ConstraintType.CONSTRAINT_TYPE_Unknown: return "CONSTRAINT_TYPE_Unknown"; case ConstraintType.Unique: return "Unique"; case ConstraintType.UniqueEventType: return "UniqueEventType"; case ConstraintType.Schema: return "Schema"; case ConstraintType.StreamClosed: return "StreamClosed"; case ConstraintType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum EventObservationState { EVENT_OBSERVATION_STATE_None = 0, Initial = 1, Replay = 2, UNRECOGNIZED = -1, } export function eventObservationStateFromJSON(object: any): EventObservationState { switch (object) { case 0: case "EVENT_OBSERVATION_STATE_None": return EventObservationState.EVENT_OBSERVATION_STATE_None; case 1: case "Initial": return EventObservationState.Initial; case 2: case "Replay": return EventObservationState.Replay; case -1: case "UNRECOGNIZED": default: return EventObservationState.UNRECOGNIZED; } } export function eventObservationStateToJSON(object: EventObservationState): string { switch (object) { case EventObservationState.EVENT_OBSERVATION_STATE_None: return "EVENT_OBSERVATION_STATE_None"; case EventObservationState.Initial: return "Initial"; case EventObservationState.Replay: return "Replay"; case EventObservationState.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum HistogramResolution { Minute = 0, Hour = 1, Day = 2, Week = 3, Month = 4, UNRECOGNIZED = -1, } export function histogramResolutionFromJSON(object: any): HistogramResolution { switch (object) { case 0: case "Minute": return HistogramResolution.Minute; case 1: case "Hour": return HistogramResolution.Hour; case 2: case "Day": return HistogramResolution.Day; case 3: case "Week": return HistogramResolution.Week; case 4: case "Month": return HistogramResolution.Month; case -1: case "UNRECOGNIZED": default: return HistogramResolution.UNRECOGNIZED; } } export function histogramResolutionToJSON(object: HistogramResolution): string { switch (object) { case HistogramResolution.Minute: return "Minute"; case HistogramResolution.Hour: return "Hour"; case HistogramResolution.Day: return "Day"; case HistogramResolution.Week: return "Week"; case HistogramResolution.Month: return "Month"; case HistogramResolution.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ValidationResultSeverity { VALIDATION_RESULT_SEVERITY_Unknown = 0, Information = 1, Warning = 2, Error = 3, UNRECOGNIZED = -1, } export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity { switch (object) { case 0: case "VALIDATION_RESULT_SEVERITY_Unknown": return ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown; case 1: case "Information": return ValidationResultSeverity.Information; case 2: case "Warning": return ValidationResultSeverity.Warning; case 3: case "Error": return ValidationResultSeverity.Error; case -1: case "UNRECOGNIZED": default: return ValidationResultSeverity.UNRECOGNIZED; } } export function validationResultSeverityToJSON(object: ValidationResultSeverity): string { switch (object) { case ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown: return "VALIDATION_RESULT_SEVERITY_Unknown"; case ValidationResultSeverity.Information: return "Information"; case ValidationResultSeverity.Warning: return "Warning"; case ValidationResultSeverity.Error: return "Error"; case ValidationResultSeverity.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface AllEventSequencesRequest { EventStore: string; Namespace: string; } export interface AppendManyForEventSourcesRequest { EventStore: string; Namespace: string; EventSequenceId: string; Events: EventForEventSourceId[]; CorrelationId: Guid | undefined; Tags: string[]; Causation: Causation[]; CausedBy: Identity | undefined; ConcurrencyScopes: EventSourceConcurrencyScope[]; } export interface AppendManyRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; Events: EventToAppend[]; CorrelationId: Guid | undefined; Tags: string[]; Causation: Causation[]; CausedBy: Identity | undefined; ConcurrencyScope: ConcurrencyScope | undefined; Occurred: SerializableDateTimeOffset | undefined; } export interface AppendManyResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; SequenceNumbers: bigint[]; IsSuccess: boolean; HasConstraintViolations: boolean; HasConcurrencyViolations: boolean; HasErrors: boolean; ConcurrencyCheckPerformed: boolean; ConstraintViolations: ConstraintViolation[]; Errors: string[]; ConcurrencyViolations: ConcurrencyViolation[]; } export interface AppendRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; EventType: EventType | undefined; Content: string; CorrelationId: Guid | undefined; Tags: string[]; Occurred: SerializableDateTimeOffset | undefined; Subject: string; Causation: Causation[]; CausedBy: Identity | undefined; ConcurrencyScope: ConcurrencyScope | undefined; } export interface AppendResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; SequenceNumber: bigint; IsSuccess: boolean; HasConstraintViolations: boolean; HasConcurrencyViolations: boolean; HasErrors: boolean; ConcurrencyCheckPerformed: boolean; ConstraintViolations: ConstraintViolation[]; Errors: string[]; ConcurrencyViolation: ConcurrencyViolation | undefined; } export interface AppendedEventResponse { Id: string; Context: EventContext | undefined; Content: string; OriginalContent: string; Revisions: EventRevision[]; GenerationalContent: KeyValuePairInt32String[]; } export interface AppendedEventsRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; } export interface Causation { Occurred: SerializableDateTimeOffset | undefined; Type: string; Properties: { [key: string]: string }; } export interface Causation_PropertiesEntry { key: string; value: string; } export interface CommandResult { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; } export interface CommandResultAppendManyResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: AppendManyResponse | undefined; } export interface CommandResultAppendResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: AppendResponse | undefined; } export interface CommandResultCompleteStreamResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; Response: CompleteStreamResponse | undefined; } export interface CompleteStreamRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventStreamType: string; EventStreamId: string; } export interface CompleteStreamResponse { IsSuccess: boolean; SequenceNumber: bigint; Error: CompleteStreamError; } export interface ConcurrencyScope { SequenceNumber: bigint; EventSourceId: boolean; EventStreamType: string; EventStreamId: string; EventSourceType: string; EventTypes: EventType[]; ExpectsNoMatchingEvent: boolean; } export interface ConcurrencyViolation { EventSourceId: string; ExpectedSequenceNumber: bigint; ActualSequenceNumber: bigint; } export interface ConstraintViolation { EventTypeId: string; SequenceNumber: bigint; ConstraintType: ConstraintType; ConstraintName: string; Message: string; Details: { [key: string]: string }; } export interface ConstraintViolation_DetailsEntry { key: string; value: string; } export interface EndOfRequest { Start: SerializableDateTimeOffset | undefined; Resolution: HistogramResolution; } export interface EventContext { EventType: EventType | undefined; EventSourceType: string; EventSourceId: string; SequenceNumber: bigint; EventStreamType: string; EventStreamId: string; Occurred: | SerializableDateTimeOffset | undefined; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; Causation: Causation[]; CausedBy: Identity | undefined; Tags: string[]; Hash: string; ObservationState: EventObservationState; Subject: string; } export interface EventForEventSourceId { EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; EventType: EventType | undefined; Content: string; Tags: string[]; Occurred: SerializableDateTimeOffset | undefined; Subject: string; } export interface EventRevision { Generation: number; CorrelationId: string; CausedBy: Identity | undefined; Occurred: SerializableDateTimeOffset | undefined; Content: string; } export interface EventSequenceNamesResponse { Id: string; Name: string; } export interface EventSequenceTailResponse { SequenceNumber: bigint; } export interface EventSourceConcurrencyScope { EventSourceId: string; Scope: ConcurrencyScope | undefined; } export interface EventSourceEventsResponse { HasEvents: boolean; } export interface EventToAppend { EventType: EventType | undefined; Content: string; Subject: string; } export interface EventType { Id: string; Generation: number; Tombstone: boolean; } export interface ExportEventsRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; CorrelationId: string; EventTypeIds: string; Tags: string; OccurredFrom: SerializableDateTimeOffset | undefined; OccurredTo: SerializableDateTimeOffset | undefined; } export interface ExportedEventResponse { SequenceNumber: bigint; EventType: string; EventSourceType: string; EventSourceId: string; EventStreamType: string; CorrelationId: string; Occurred: SerializableDateTimeOffset | undefined; Tags: string[]; Content: string; } export interface ForEventSourceIdAndEventTypesRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventTypeIds: string; EventStreamType: string; EventStreamId: string; EventSourceType: string; } export interface FromSequenceNumberRequest { EventStore: string; Namespace: string; EventSequenceId: string; FromEventSequenceNumber: bigint; EventSourceId: string; EventTypeIds: string; } export interface HasEventsForEventSourceIdRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; } export interface Identity { Subject: string; Name: string; UserName: string; OnBehalfOf: Identity | undefined; } export interface KeyValuePairInt32String { Key: number; Value: string; } export interface ParseResolutionRequest { Resolution: string; } export interface QueryEventsRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; CorrelationId: string; EventTypeIds: string; Tags: string; OccurredFrom: SerializableDateTimeOffset | undefined; OccurredTo: SerializableDateTimeOffset | undefined; } export interface QueryResultEventSequenceTailResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: EventSequenceTailResponse | undefined; } export interface QueryResultEventSourceEventsResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: EventSourceEventsResponse | undefined; } export interface QueryResultHistogramResolution { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: HistogramResolution; } export interface QueryResultIEnumerableAppendedEventResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: AppendedEventResponse[]; } export interface QueryResultIEnumerableEventSequenceNamesResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: EventSequenceNamesResponse[]; } export interface QueryResultIEnumerableExportedEventResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: ExportedEventResponse[]; } export interface QueryResultIEnumerableSequenceHistogramBucketResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: SequenceHistogramBucketResponse[]; } export interface QueryResultSerializableDateTimeOffset { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: SerializableDateTimeOffset | undefined; } export interface RedactForEventSourceRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; Reason: string; EventTypes: string[]; Causation: Causation[]; CausedBy: Identity | undefined; } export interface RedactRequest { EventStore: string; Namespace: string; EventSequenceId: string; SequenceNumber: bigint; Reason: string; Causation: Causation[]; CausedBy: Identity | undefined; } export interface ReviseRequest { EventStore: string; Namespace: string; EventSequenceId: string; SequenceNumber: bigint; EventType: EventType | undefined; Content: string; Causation: Causation[]; CausedBy: Identity | undefined; } export interface SequenceHistogramBucketResponse { From: SerializableDateTimeOffset | undefined; To: SerializableDateTimeOffset | undefined; Count: bigint; } export interface SequenceHistogramRequest { EventStore: string; Namespace: string; EventSequenceId: string; Resolution: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; CorrelationId: string; EventTypeIds: string; Tags: string; OccurredFrom: SerializableDateTimeOffset | undefined; OccurredTo: SerializableDateTimeOffset | undefined; } /** Represents a DateTimeOffset value as an ISO 8601 string (e.g., "2024-01-15T12:30:00.0000000+02:00"). */ export interface SerializableDateTimeOffset { Value: string; } export interface TailSequenceNumberRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventTypeIds: string; EventSourceId: string; EventSourceType: string; EventStreamId: string; EventStreamType: string; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseAllEventSequencesRequest(): AllEventSequencesRequest { return { EventStore: "", Namespace: "" }; } export const AllEventSequencesRequest: MessageFns = { encode(message: AllEventSequencesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AllEventSequencesRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAllEventSequencesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AllEventSequencesRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: AllEventSequencesRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): AllEventSequencesRequest { return AllEventSequencesRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AllEventSequencesRequest { const message = createBaseAllEventSequencesRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; return message; }, }; function createBaseAppendManyForEventSourcesRequest(): AppendManyForEventSourcesRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", Events: [], CorrelationId: undefined, Tags: [], Causation: [], CausedBy: undefined, ConcurrencyScopes: [], }; } export const AppendManyForEventSourcesRequest: MessageFns = { encode(message: AppendManyForEventSourcesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } for (const v of message.Events) { EventForEventSourceId.encode(v!, writer.uint32(34).fork()).join(); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(42).fork()).join(); } for (const v of message.Tags) { writer.uint32(50).string(v!); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(58).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(66).fork()).join(); } for (const v of message.ConcurrencyScopes) { EventSourceConcurrencyScope.encode(v!, writer.uint32(74).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendManyForEventSourcesRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppendManyForEventSourcesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.Events.push(EventForEventSourceId.decode(reader, reader.uint32())); continue; } case 5: { if (tag !== 42) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 6: { if (tag !== 50) { break; } message.Tags.push(reader.string()); continue; } case 7: { if (tag !== 58) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 8: { if (tag !== 66) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 9: { if (tag !== 74) { break; } message.ConcurrencyScopes.push(EventSourceConcurrencyScope.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AppendManyForEventSourcesRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", Events: globalThis.Array.isArray(object?.Events) ? object.Events.map((e: any) => EventForEventSourceId.fromJSON(e)) : [], CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, ConcurrencyScopes: globalThis.Array.isArray(object?.ConcurrencyScopes) ? object.ConcurrencyScopes.map((e: any) => EventSourceConcurrencyScope.fromJSON(e)) : [], }; }, toJSON(message: AppendManyForEventSourcesRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.Events?.length) { obj.Events = message.Events.map((e) => EventForEventSourceId.toJSON(e)); } if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } if (message.ConcurrencyScopes?.length) { obj.ConcurrencyScopes = message.ConcurrencyScopes.map((e) => EventSourceConcurrencyScope.toJSON(e)); } return obj; }, create(base?: DeepPartial): AppendManyForEventSourcesRequest { return AppendManyForEventSourcesRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendManyForEventSourcesRequest { const message = createBaseAppendManyForEventSourcesRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.Events = object.Events?.map((e) => EventForEventSourceId.fromPartial(e)) || []; message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.Tags = object.Tags?.map((e) => e) || []; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; message.ConcurrencyScopes = object.ConcurrencyScopes?.map((e) => EventSourceConcurrencyScope.fromPartial(e)) || []; return message; }, }; function createBaseAppendManyRequest(): AppendManyRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", Events: [], CorrelationId: undefined, Tags: [], Causation: [], CausedBy: undefined, ConcurrencyScope: undefined, Occurred: undefined, }; } export const AppendManyRequest: MessageFns = { encode(message: AppendManyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(34).string(message.EventSourceId); } for (const v of message.Events) { EventToAppend.encode(v!, writer.uint32(42).fork()).join(); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(50).fork()).join(); } for (const v of message.Tags) { writer.uint32(58).string(v!); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(66).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(74).fork()).join(); } if (message.ConcurrencyScope !== undefined) { ConcurrencyScope.encode(message.ConcurrencyScope, writer.uint32(82).fork()).join(); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(90).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendManyRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppendManyRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSourceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Events.push(EventToAppend.decode(reader, reader.uint32())); continue; } case 6: { if (tag !== 50) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 7: { if (tag !== 58) { break; } message.Tags.push(reader.string()); continue; } case 8: { if (tag !== 66) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 9: { if (tag !== 74) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 10: { if (tag !== 82) { break; } message.ConcurrencyScope = ConcurrencyScope.decode(reader, reader.uint32()); continue; } case 11: { if (tag !== 90) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AppendManyRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", Events: globalThis.Array.isArray(object?.Events) ? object.Events.map((e: any) => EventToAppend.fromJSON(e)) : [], CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, ConcurrencyScope: isSet(object.ConcurrencyScope) ? ConcurrencyScope.fromJSON(object.ConcurrencyScope) : undefined, Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, }; }, toJSON(message: AppendManyRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.Events?.length) { obj.Events = message.Events.map((e) => EventToAppend.toJSON(e)); } if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } if (message.ConcurrencyScope !== undefined) { obj.ConcurrencyScope = ConcurrencyScope.toJSON(message.ConcurrencyScope); } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } return obj; }, create(base?: DeepPartial): AppendManyRequest { return AppendManyRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendManyRequest { const message = createBaseAppendManyRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.Events = object.Events?.map((e) => EventToAppend.fromPartial(e)) || []; message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.Tags = object.Tags?.map((e) => e) || []; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; message.ConcurrencyScope = (object.ConcurrencyScope !== undefined && object.ConcurrencyScope !== null) ? ConcurrencyScope.fromPartial(object.ConcurrencyScope) : undefined; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; return message; }, }; function createBaseAppendManyResponse(): AppendManyResponse { return { CorrelationId: undefined, SequenceNumbers: [], IsSuccess: false, HasConstraintViolations: false, HasConcurrencyViolations: false, HasErrors: false, ConcurrencyCheckPerformed: false, ConstraintViolations: [], Errors: [], ConcurrencyViolations: [], }; } export const AppendManyResponse: MessageFns = { encode(message: AppendManyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } for (const v of message.SequenceNumbers) { if (BigInt.asUintN(64, v!) !== v!) { throw new globalThis.Error("value provided for field v! of type uint64 too large"); } writer.uint32(16).uint64(v!); } if (message.IsSuccess !== false) { writer.uint32(24).bool(message.IsSuccess); } if (message.HasConstraintViolations !== false) { writer.uint32(32).bool(message.HasConstraintViolations); } if (message.HasConcurrencyViolations !== false) { writer.uint32(40).bool(message.HasConcurrencyViolations); } if (message.HasErrors !== false) { writer.uint32(48).bool(message.HasErrors); } if (message.ConcurrencyCheckPerformed !== false) { writer.uint32(56).bool(message.ConcurrencyCheckPerformed); } for (const v of message.ConstraintViolations) { ConstraintViolation.encode(v!, writer.uint32(66).fork()).join(); } for (const v of message.Errors) { writer.uint32(74).string(v!); } for (const v of message.ConcurrencyViolations) { ConcurrencyViolation.encode(v!, writer.uint32(82).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendManyResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppendManyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag === 16) { message.SequenceNumbers.push(reader.uint64() as bigint); continue; } if (tag === 18) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.SequenceNumbers.push(reader.uint64() as bigint); } continue; } break; } case 3: { if (tag !== 24) { break; } message.IsSuccess = reader.bool(); continue; } case 4: { if (tag !== 32) { break; } message.HasConstraintViolations = reader.bool(); continue; } case 5: { if (tag !== 40) { break; } message.HasConcurrencyViolations = reader.bool(); continue; } case 6: { if (tag !== 48) { break; } message.HasErrors = reader.bool(); continue; } case 7: { if (tag !== 56) { break; } message.ConcurrencyCheckPerformed = reader.bool(); continue; } case 8: { if (tag !== 66) { break; } message.ConstraintViolations.push(ConstraintViolation.decode(reader, reader.uint32())); continue; } case 9: { if (tag !== 74) { break; } message.Errors.push(reader.string()); continue; } case 10: { if (tag !== 82) { break; } message.ConcurrencyViolations.push(ConcurrencyViolation.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AppendManyResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, SequenceNumbers: globalThis.Array.isArray(object?.SequenceNumbers) ? object.SequenceNumbers.map((e: any) => BigInt(e)) : [], IsSuccess: isSet(object.IsSuccess) ? globalThis.Boolean(object.IsSuccess) : false, HasConstraintViolations: isSet(object.HasConstraintViolations) ? globalThis.Boolean(object.HasConstraintViolations) : false, HasConcurrencyViolations: isSet(object.HasConcurrencyViolations) ? globalThis.Boolean(object.HasConcurrencyViolations) : false, HasErrors: isSet(object.HasErrors) ? globalThis.Boolean(object.HasErrors) : false, ConcurrencyCheckPerformed: isSet(object.ConcurrencyCheckPerformed) ? globalThis.Boolean(object.ConcurrencyCheckPerformed) : false, ConstraintViolations: globalThis.Array.isArray(object?.ConstraintViolations) ? object.ConstraintViolations.map((e: any) => ConstraintViolation.fromJSON(e)) : [], Errors: globalThis.Array.isArray(object?.Errors) ? object.Errors.map((e: any) => globalThis.String(e)) : [], ConcurrencyViolations: globalThis.Array.isArray(object?.ConcurrencyViolations) ? object.ConcurrencyViolations.map((e: any) => ConcurrencyViolation.fromJSON(e)) : [], }; }, toJSON(message: AppendManyResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.SequenceNumbers?.length) { obj.SequenceNumbers = message.SequenceNumbers.map((e) => e.toString()); } if (message.IsSuccess !== false) { obj.IsSuccess = message.IsSuccess; } if (message.HasConstraintViolations !== false) { obj.HasConstraintViolations = message.HasConstraintViolations; } if (message.HasConcurrencyViolations !== false) { obj.HasConcurrencyViolations = message.HasConcurrencyViolations; } if (message.HasErrors !== false) { obj.HasErrors = message.HasErrors; } if (message.ConcurrencyCheckPerformed !== false) { obj.ConcurrencyCheckPerformed = message.ConcurrencyCheckPerformed; } if (message.ConstraintViolations?.length) { obj.ConstraintViolations = message.ConstraintViolations.map((e) => ConstraintViolation.toJSON(e)); } if (message.Errors?.length) { obj.Errors = message.Errors; } if (message.ConcurrencyViolations?.length) { obj.ConcurrencyViolations = message.ConcurrencyViolations.map((e) => ConcurrencyViolation.toJSON(e)); } return obj; }, create(base?: DeepPartial): AppendManyResponse { return AppendManyResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendManyResponse { const message = createBaseAppendManyResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.SequenceNumbers = object.SequenceNumbers?.map((e) => BigInt(e)) || []; message.IsSuccess = object.IsSuccess ?? false; message.HasConstraintViolations = object.HasConstraintViolations ?? false; message.HasConcurrencyViolations = object.HasConcurrencyViolations ?? false; message.HasErrors = object.HasErrors ?? false; message.ConcurrencyCheckPerformed = object.ConcurrencyCheckPerformed ?? false; message.ConstraintViolations = object.ConstraintViolations?.map((e) => ConstraintViolation.fromPartial(e)) || []; message.Errors = object.Errors?.map((e) => e) || []; message.ConcurrencyViolations = object.ConcurrencyViolations?.map((e) => ConcurrencyViolation.fromPartial(e)) || []; return message; }, }; function createBaseAppendRequest(): AppendRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", EventType: undefined, Content: "", CorrelationId: undefined, Tags: [], Occurred: undefined, Subject: "", Causation: [], CausedBy: undefined, ConcurrencyScope: undefined, }; } export const AppendRequest: MessageFns = { encode(message: AppendRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(34).string(message.EventSourceId); } if (message.EventSourceType !== "") { writer.uint32(42).string(message.EventSourceType); } if (message.EventStreamType !== "") { writer.uint32(50).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(58).string(message.EventStreamId); } if (message.EventType !== undefined) { EventType.encode(message.EventType, writer.uint32(66).fork()).join(); } if (message.Content !== "") { writer.uint32(74).string(message.Content); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(82).fork()).join(); } for (const v of message.Tags) { writer.uint32(90).string(v!); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(98).fork()).join(); } if (message.Subject !== "") { writer.uint32(106).string(message.Subject); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(114).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(122).fork()).join(); } if (message.ConcurrencyScope !== undefined) { ConcurrencyScope.encode(message.ConcurrencyScope, writer.uint32(130).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppendRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSourceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceType = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventStreamType = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventStreamId = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.EventType = EventType.decode(reader, reader.uint32()); continue; } case 9: { if (tag !== 74) { break; } message.Content = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 11: { if (tag !== 90) { break; } message.Tags.push(reader.string()); continue; } case 12: { if (tag !== 98) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 13: { if (tag !== 106) { break; } message.Subject = reader.string(); continue; } case 14: { if (tag !== 114) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 15: { if (tag !== 122) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 16: { if (tag !== 130) { break; } message.ConcurrencyScope = ConcurrencyScope.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AppendRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, ConcurrencyScope: isSet(object.ConcurrencyScope) ? ConcurrencyScope.fromJSON(object.ConcurrencyScope) : undefined, }; }, toJSON(message: AppendRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.Content !== "") { obj.Content = message.Content; } if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.Subject !== "") { obj.Subject = message.Subject; } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } if (message.ConcurrencyScope !== undefined) { obj.ConcurrencyScope = ConcurrencyScope.toJSON(message.ConcurrencyScope); } return obj; }, create(base?: DeepPartial): AppendRequest { return AppendRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendRequest { const message = createBaseAppendRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.Content = object.Content ?? ""; message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.Tags = object.Tags?.map((e) => e) || []; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.Subject = object.Subject ?? ""; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; message.ConcurrencyScope = (object.ConcurrencyScope !== undefined && object.ConcurrencyScope !== null) ? ConcurrencyScope.fromPartial(object.ConcurrencyScope) : undefined; return message; }, }; function createBaseAppendResponse(): AppendResponse { return { CorrelationId: undefined, SequenceNumber: 0n, IsSuccess: false, HasConstraintViolations: false, HasConcurrencyViolations: false, HasErrors: false, ConcurrencyCheckPerformed: false, ConstraintViolations: [], Errors: [], ConcurrencyViolation: undefined, }; } export const AppendResponse: MessageFns = { encode(message: AppendResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(16).uint64(message.SequenceNumber); } if (message.IsSuccess !== false) { writer.uint32(24).bool(message.IsSuccess); } if (message.HasConstraintViolations !== false) { writer.uint32(32).bool(message.HasConstraintViolations); } if (message.HasConcurrencyViolations !== false) { writer.uint32(40).bool(message.HasConcurrencyViolations); } if (message.HasErrors !== false) { writer.uint32(48).bool(message.HasErrors); } if (message.ConcurrencyCheckPerformed !== false) { writer.uint32(56).bool(message.ConcurrencyCheckPerformed); } for (const v of message.ConstraintViolations) { ConstraintViolation.encode(v!, writer.uint32(66).fork()).join(); } for (const v of message.Errors) { writer.uint32(74).string(v!); } if (message.ConcurrencyViolation !== undefined) { ConcurrencyViolation.encode(message.ConcurrencyViolation, writer.uint32(82).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppendResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 3: { if (tag !== 24) { break; } message.IsSuccess = reader.bool(); continue; } case 4: { if (tag !== 32) { break; } message.HasConstraintViolations = reader.bool(); continue; } case 5: { if (tag !== 40) { break; } message.HasConcurrencyViolations = reader.bool(); continue; } case 6: { if (tag !== 48) { break; } message.HasErrors = reader.bool(); continue; } case 7: { if (tag !== 56) { break; } message.ConcurrencyCheckPerformed = reader.bool(); continue; } case 8: { if (tag !== 66) { break; } message.ConstraintViolations.push(ConstraintViolation.decode(reader, reader.uint32())); continue; } case 9: { if (tag !== 74) { break; } message.Errors.push(reader.string()); continue; } case 10: { if (tag !== 82) { break; } message.ConcurrencyViolation = ConcurrencyViolation.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AppendResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, IsSuccess: isSet(object.IsSuccess) ? globalThis.Boolean(object.IsSuccess) : false, HasConstraintViolations: isSet(object.HasConstraintViolations) ? globalThis.Boolean(object.HasConstraintViolations) : false, HasConcurrencyViolations: isSet(object.HasConcurrencyViolations) ? globalThis.Boolean(object.HasConcurrencyViolations) : false, HasErrors: isSet(object.HasErrors) ? globalThis.Boolean(object.HasErrors) : false, ConcurrencyCheckPerformed: isSet(object.ConcurrencyCheckPerformed) ? globalThis.Boolean(object.ConcurrencyCheckPerformed) : false, ConstraintViolations: globalThis.Array.isArray(object?.ConstraintViolations) ? object.ConstraintViolations.map((e: any) => ConstraintViolation.fromJSON(e)) : [], Errors: globalThis.Array.isArray(object?.Errors) ? object.Errors.map((e: any) => globalThis.String(e)) : [], ConcurrencyViolation: isSet(object.ConcurrencyViolation) ? ConcurrencyViolation.fromJSON(object.ConcurrencyViolation) : undefined, }; }, toJSON(message: AppendResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.IsSuccess !== false) { obj.IsSuccess = message.IsSuccess; } if (message.HasConstraintViolations !== false) { obj.HasConstraintViolations = message.HasConstraintViolations; } if (message.HasConcurrencyViolations !== false) { obj.HasConcurrencyViolations = message.HasConcurrencyViolations; } if (message.HasErrors !== false) { obj.HasErrors = message.HasErrors; } if (message.ConcurrencyCheckPerformed !== false) { obj.ConcurrencyCheckPerformed = message.ConcurrencyCheckPerformed; } if (message.ConstraintViolations?.length) { obj.ConstraintViolations = message.ConstraintViolations.map((e) => ConstraintViolation.toJSON(e)); } if (message.Errors?.length) { obj.Errors = message.Errors; } if (message.ConcurrencyViolation !== undefined) { obj.ConcurrencyViolation = ConcurrencyViolation.toJSON(message.ConcurrencyViolation); } return obj; }, create(base?: DeepPartial): AppendResponse { return AppendResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendResponse { const message = createBaseAppendResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.IsSuccess = object.IsSuccess ?? false; message.HasConstraintViolations = object.HasConstraintViolations ?? false; message.HasConcurrencyViolations = object.HasConcurrencyViolations ?? false; message.HasErrors = object.HasErrors ?? false; message.ConcurrencyCheckPerformed = object.ConcurrencyCheckPerformed ?? false; message.ConstraintViolations = object.ConstraintViolations?.map((e) => ConstraintViolation.fromPartial(e)) || []; message.Errors = object.Errors?.map((e) => e) || []; message.ConcurrencyViolation = (object.ConcurrencyViolation !== undefined && object.ConcurrencyViolation !== null) ? ConcurrencyViolation.fromPartial(object.ConcurrencyViolation) : undefined; return message; }, }; function createBaseAppendedEventResponse(): AppendedEventResponse { return { Id: "", Context: undefined, Content: "", OriginalContent: "", Revisions: [], GenerationalContent: [] }; } export const AppendedEventResponse: MessageFns = { encode(message: AppendedEventResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Context !== undefined) { EventContext.encode(message.Context, writer.uint32(18).fork()).join(); } if (message.Content !== "") { writer.uint32(26).string(message.Content); } if (message.OriginalContent !== "") { writer.uint32(34).string(message.OriginalContent); } for (const v of message.Revisions) { EventRevision.encode(v!, writer.uint32(42).fork()).join(); } for (const v of message.GenerationalContent) { KeyValuePairInt32String.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendedEventResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppendedEventResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Context = EventContext.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.Content = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.OriginalContent = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Revisions.push(EventRevision.decode(reader, reader.uint32())); continue; } case 6: { if (tag !== 50) { break; } message.GenerationalContent.push(KeyValuePairInt32String.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AppendedEventResponse { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Context: isSet(object.Context) ? EventContext.fromJSON(object.Context) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", OriginalContent: isSet(object.OriginalContent) ? globalThis.String(object.OriginalContent) : "", Revisions: globalThis.Array.isArray(object?.Revisions) ? object.Revisions.map((e: any) => EventRevision.fromJSON(e)) : [], GenerationalContent: globalThis.Array.isArray(object?.GenerationalContent) ? object.GenerationalContent.map((e: any) => KeyValuePairInt32String.fromJSON(e)) : [], }; }, toJSON(message: AppendedEventResponse): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Context !== undefined) { obj.Context = EventContext.toJSON(message.Context); } if (message.Content !== "") { obj.Content = message.Content; } if (message.OriginalContent !== "") { obj.OriginalContent = message.OriginalContent; } if (message.Revisions?.length) { obj.Revisions = message.Revisions.map((e) => EventRevision.toJSON(e)); } if (message.GenerationalContent?.length) { obj.GenerationalContent = message.GenerationalContent.map((e) => KeyValuePairInt32String.toJSON(e)); } return obj; }, create(base?: DeepPartial): AppendedEventResponse { return AppendedEventResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendedEventResponse { const message = createBaseAppendedEventResponse(); message.Id = object.Id ?? ""; message.Context = (object.Context !== undefined && object.Context !== null) ? EventContext.fromPartial(object.Context) : undefined; message.Content = object.Content ?? ""; message.OriginalContent = object.OriginalContent ?? ""; message.Revisions = object.Revisions?.map((e) => EventRevision.fromPartial(e)) || []; message.GenerationalContent = object.GenerationalContent?.map((e) => KeyValuePairInt32String.fromPartial(e)) || []; return message; }, }; function createBaseAppendedEventsRequest(): AppendedEventsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "" }; } export const AppendedEventsRequest: MessageFns = { encode(message: AppendedEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(18).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(26).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(34).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(42).string(message.EventSourceId); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendedEventsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseAppendedEventsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: { if (tag !== 18) { break; } message.EventStore = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Namespace = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSequenceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceId = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AppendedEventsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", }; }, toJSON(message: AppendedEventsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } return obj; }, create(base?: DeepPartial): AppendedEventsRequest { return AppendedEventsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendedEventsRequest { const message = createBaseAppendedEventsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; return message; }, }; function createBaseCausation(): Causation { return { Occurred: undefined, Type: "", Properties: {} }; } export const Causation: MessageFns = { encode(message: Causation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(10).fork()).join(); } if (message.Type !== "") { writer.uint32(18).string(message.Type); } globalThis.Object.entries(message.Properties).forEach(([key, value]: [string, string]) => { Causation_PropertiesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); }); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Causation { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCausation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Type = reader.string(); continue; } case 3: { if (tag !== 26) { break; } const entry3 = Causation_PropertiesEntry.decode(reader, reader.uint32()); if (entry3.value !== undefined) { message.Properties[entry3.key] = entry3.value; } continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Causation { return { Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, Type: isSet(object.Type) ? globalThis.String(object.Type) : "", Properties: isObject(object.Properties) ? (globalThis.Object.entries(object.Properties) as [string, any][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, any]) => { globalThis.Object.defineProperty(acc, key, { value: globalThis.String(value), enumerable: true, configurable: true, writable: true, }); return acc; }, {}, ) : {}, }; }, toJSON(message: Causation): unknown { const obj: any = {}; if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.Type !== "") { obj.Type = message.Type; } if (message.Properties) { const entries = globalThis.Object.entries(message.Properties) as [string, string][]; if (entries.length > 0) { obj.Properties = {}; entries.forEach(([k, v]) => { obj.Properties[k] = v; }); } } return obj; }, create(base?: DeepPartial): Causation { return Causation.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Causation { const message = createBaseCausation(); message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.Type = object.Type ?? ""; message.Properties = (globalThis.Object.entries(object.Properties ?? {}) as [string, string][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, string]) => { if (value !== undefined) { acc[key] = globalThis.String(value); } return acc; }, {}, ); return message; }, }; function createBaseCausation_PropertiesEntry(): Causation_PropertiesEntry { return { key: "", value: "" }; } export const Causation_PropertiesEntry: MessageFns = { encode(message: Causation_PropertiesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== "") { writer.uint32(18).string(message.value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Causation_PropertiesEntry { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCausation_PropertiesEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.key = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Causation_PropertiesEntry { return { key: isSet(object.key) ? globalThis.String(object.key) : "", value: isSet(object.value) ? globalThis.String(object.value) : "", }; }, toJSON(message: Causation_PropertiesEntry): unknown { const obj: any = {}; if (message.key !== "") { obj.key = message.key; } if (message.value !== "") { obj.value = message.value; } return obj; }, create(base?: DeepPartial): Causation_PropertiesEntry { return Causation_PropertiesEntry.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Causation_PropertiesEntry { const message = createBaseCausation_PropertiesEntry(); message.key = object.key ?? ""; message.value = object.value ?? ""; return message; }, }; function createBaseCommandResult(): CommandResult { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", }; } export const CommandResult: MessageFns = { encode(message: CommandResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.AuthorizationFailureReason !== "") { writer.uint32(50).string(message.AuthorizationFailureReason); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommandResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.AuthorizationFailureReason = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CommandResult { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", AuthorizationFailureReason: isSet(object.AuthorizationFailureReason) ? globalThis.String(object.AuthorizationFailureReason) : "", }; }, toJSON(message: CommandResult): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.AuthorizationFailureReason !== "") { obj.AuthorizationFailureReason = message.AuthorizationFailureReason; } return obj; }, create(base?: DeepPartial): CommandResult { return CommandResult.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResult { const message = createBaseCommandResult(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? ""; return message; }, }; function createBaseCommandResultAppendManyResponse(): CommandResultAppendManyResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultAppendManyResponse: MessageFns = { encode(message: CommandResultAppendManyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.AuthorizationFailureReason !== "") { writer.uint32(50).string(message.AuthorizationFailureReason); } if (message.Response !== undefined) { AppendManyResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultAppendManyResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommandResultAppendManyResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.AuthorizationFailureReason = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Response = AppendManyResponse.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CommandResultAppendManyResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", AuthorizationFailureReason: isSet(object.AuthorizationFailureReason) ? globalThis.String(object.AuthorizationFailureReason) : "", Response: isSet(object.Response) ? AppendManyResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultAppendManyResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.AuthorizationFailureReason !== "") { obj.AuthorizationFailureReason = message.AuthorizationFailureReason; } if (message.Response !== undefined) { obj.Response = AppendManyResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultAppendManyResponse { return CommandResultAppendManyResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultAppendManyResponse { const message = createBaseCommandResultAppendManyResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? ""; message.Response = (object.Response !== undefined && object.Response !== null) ? AppendManyResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultAppendResponse(): CommandResultAppendResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultAppendResponse: MessageFns = { encode(message: CommandResultAppendResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.AuthorizationFailureReason !== "") { writer.uint32(50).string(message.AuthorizationFailureReason); } if (message.Response !== undefined) { AppendResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultAppendResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommandResultAppendResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.AuthorizationFailureReason = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Response = AppendResponse.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CommandResultAppendResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", AuthorizationFailureReason: isSet(object.AuthorizationFailureReason) ? globalThis.String(object.AuthorizationFailureReason) : "", Response: isSet(object.Response) ? AppendResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultAppendResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.AuthorizationFailureReason !== "") { obj.AuthorizationFailureReason = message.AuthorizationFailureReason; } if (message.Response !== undefined) { obj.Response = AppendResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultAppendResponse { return CommandResultAppendResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultAppendResponse { const message = createBaseCommandResultAppendResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? ""; message.Response = (object.Response !== undefined && object.Response !== null) ? AppendResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultCompleteStreamResponse(): CommandResultCompleteStreamResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultCompleteStreamResponse: MessageFns = { encode(message: CommandResultCompleteStreamResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.AuthorizationFailureReason !== "") { writer.uint32(50).string(message.AuthorizationFailureReason); } if (message.Response !== undefined) { CompleteStreamResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultCompleteStreamResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommandResultCompleteStreamResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.AuthorizationFailureReason = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Response = CompleteStreamResponse.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CommandResultCompleteStreamResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", AuthorizationFailureReason: isSet(object.AuthorizationFailureReason) ? globalThis.String(object.AuthorizationFailureReason) : "", Response: isSet(object.Response) ? CompleteStreamResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultCompleteStreamResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.AuthorizationFailureReason !== "") { obj.AuthorizationFailureReason = message.AuthorizationFailureReason; } if (message.Response !== undefined) { obj.Response = CompleteStreamResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultCompleteStreamResponse { return CommandResultCompleteStreamResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultCompleteStreamResponse { const message = createBaseCommandResultCompleteStreamResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? ""; message.Response = (object.Response !== undefined && object.Response !== null) ? CompleteStreamResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCompleteStreamRequest(): CompleteStreamRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventStreamType: "", EventStreamId: "" }; } export const CompleteStreamRequest: MessageFns = { encode(message: CompleteStreamRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.EventStreamType !== "") { writer.uint32(34).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(42).string(message.EventStreamId); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CompleteStreamRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompleteStreamRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventStreamType = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventStreamId = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CompleteStreamRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", }; }, toJSON(message: CompleteStreamRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } return obj; }, create(base?: DeepPartial): CompleteStreamRequest { return CompleteStreamRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CompleteStreamRequest { const message = createBaseCompleteStreamRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; return message; }, }; function createBaseCompleteStreamResponse(): CompleteStreamResponse { return { IsSuccess: false, SequenceNumber: 0n, Error: 0 }; } export const CompleteStreamResponse: MessageFns = { encode(message: CompleteStreamResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.IsSuccess !== false) { writer.uint32(8).bool(message.IsSuccess); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(16).uint64(message.SequenceNumber); } if (message.Error !== 0) { writer.uint32(24).int32(message.Error); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CompleteStreamResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCompleteStreamResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.IsSuccess = reader.bool(); continue; } case 2: { if (tag !== 16) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 3: { if (tag !== 24) { break; } message.Error = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CompleteStreamResponse { return { IsSuccess: isSet(object.IsSuccess) ? globalThis.Boolean(object.IsSuccess) : false, SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, Error: isSet(object.Error) ? completeStreamErrorFromJSON(object.Error) : 0, }; }, toJSON(message: CompleteStreamResponse): unknown { const obj: any = {}; if (message.IsSuccess !== false) { obj.IsSuccess = message.IsSuccess; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.Error !== 0) { obj.Error = completeStreamErrorToJSON(message.Error); } return obj; }, create(base?: DeepPartial): CompleteStreamResponse { return CompleteStreamResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CompleteStreamResponse { const message = createBaseCompleteStreamResponse(); message.IsSuccess = object.IsSuccess ?? false; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.Error = object.Error ?? 0; return message; }, }; function createBaseConcurrencyScope(): ConcurrencyScope { return { SequenceNumber: 0n, EventSourceId: false, EventStreamType: "", EventStreamId: "", EventSourceType: "", EventTypes: [], ExpectsNoMatchingEvent: false, }; } export const ConcurrencyScope: MessageFns = { encode(message: ConcurrencyScope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(8).uint64(message.SequenceNumber); } if (message.EventSourceId !== false) { writer.uint32(16).bool(message.EventSourceId); } if (message.EventStreamType !== "") { writer.uint32(26).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(34).string(message.EventStreamId); } if (message.EventSourceType !== "") { writer.uint32(42).string(message.EventSourceType); } for (const v of message.EventTypes) { EventType.encode(v!, writer.uint32(50).fork()).join(); } if (message.ExpectsNoMatchingEvent !== false) { writer.uint32(56).bool(message.ExpectsNoMatchingEvent); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConcurrencyScope { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConcurrencyScope(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 2: { if (tag !== 16) { break; } message.EventSourceId = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.EventStreamType = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventStreamId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceType = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventTypes.push(EventType.decode(reader, reader.uint32())); continue; } case 7: { if (tag !== 56) { break; } message.ExpectsNoMatchingEvent = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ConcurrencyScope { return { SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, EventSourceId: isSet(object.EventSourceId) ? globalThis.Boolean(object.EventSourceId) : false, EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventTypes: globalThis.Array.isArray(object?.EventTypes) ? object.EventTypes.map((e: any) => EventType.fromJSON(e)) : [], ExpectsNoMatchingEvent: isSet(object.ExpectsNoMatchingEvent) ? globalThis.Boolean(object.ExpectsNoMatchingEvent) : false, }; }, toJSON(message: ConcurrencyScope): unknown { const obj: any = {}; if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.EventSourceId !== false) { obj.EventSourceId = message.EventSourceId; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventTypes?.length) { obj.EventTypes = message.EventTypes.map((e) => EventType.toJSON(e)); } if (message.ExpectsNoMatchingEvent !== false) { obj.ExpectsNoMatchingEvent = message.ExpectsNoMatchingEvent; } return obj; }, create(base?: DeepPartial): ConcurrencyScope { return ConcurrencyScope.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ConcurrencyScope { const message = createBaseConcurrencyScope(); message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.EventSourceId = object.EventSourceId ?? false; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventTypes = object.EventTypes?.map((e) => EventType.fromPartial(e)) || []; message.ExpectsNoMatchingEvent = object.ExpectsNoMatchingEvent ?? false; return message; }, }; function createBaseConcurrencyViolation(): ConcurrencyViolation { return { EventSourceId: "", ExpectedSequenceNumber: 0n, ActualSequenceNumber: 0n }; } export const ConcurrencyViolation: MessageFns = { encode(message: ConcurrencyViolation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventSourceId !== "") { writer.uint32(10).string(message.EventSourceId); } if (message.ExpectedSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.ExpectedSequenceNumber) !== message.ExpectedSequenceNumber) { throw new globalThis.Error("value provided for field message.ExpectedSequenceNumber of type uint64 too large"); } writer.uint32(16).uint64(message.ExpectedSequenceNumber); } if (message.ActualSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.ActualSequenceNumber) !== message.ActualSequenceNumber) { throw new globalThis.Error("value provided for field message.ActualSequenceNumber of type uint64 too large"); } writer.uint32(24).uint64(message.ActualSequenceNumber); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConcurrencyViolation { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConcurrencyViolation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventSourceId = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.ExpectedSequenceNumber = reader.uint64() as bigint; continue; } case 3: { if (tag !== 24) { break; } message.ActualSequenceNumber = reader.uint64() as bigint; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ConcurrencyViolation { return { EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", ExpectedSequenceNumber: isSet(object.ExpectedSequenceNumber) ? BigInt(object.ExpectedSequenceNumber) : 0n, ActualSequenceNumber: isSet(object.ActualSequenceNumber) ? BigInt(object.ActualSequenceNumber) : 0n, }; }, toJSON(message: ConcurrencyViolation): unknown { const obj: any = {}; if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.ExpectedSequenceNumber !== 0n) { obj.ExpectedSequenceNumber = message.ExpectedSequenceNumber.toString(); } if (message.ActualSequenceNumber !== 0n) { obj.ActualSequenceNumber = message.ActualSequenceNumber.toString(); } return obj; }, create(base?: DeepPartial): ConcurrencyViolation { return ConcurrencyViolation.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ConcurrencyViolation { const message = createBaseConcurrencyViolation(); message.EventSourceId = object.EventSourceId ?? ""; message.ExpectedSequenceNumber = (object.ExpectedSequenceNumber !== undefined && object.ExpectedSequenceNumber !== null) ? BigInt(object.ExpectedSequenceNumber) : 0n; message.ActualSequenceNumber = (object.ActualSequenceNumber !== undefined && object.ActualSequenceNumber !== null) ? BigInt(object.ActualSequenceNumber) : 0n; return message; }, }; function createBaseConstraintViolation(): ConstraintViolation { return { EventTypeId: "", SequenceNumber: 0n, ConstraintType: 0, ConstraintName: "", Message: "", Details: {} }; } export const ConstraintViolation: MessageFns = { encode(message: ConstraintViolation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventTypeId !== "") { writer.uint32(10).string(message.EventTypeId); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(16).uint64(message.SequenceNumber); } if (message.ConstraintType !== 0) { writer.uint32(24).int32(message.ConstraintType); } if (message.ConstraintName !== "") { writer.uint32(34).string(message.ConstraintName); } if (message.Message !== "") { writer.uint32(42).string(message.Message); } globalThis.Object.entries(message.Details).forEach(([key, value]: [string, string]) => { ConstraintViolation_DetailsEntry.encode({ key: key as any, value }, writer.uint32(50).fork()).join(); }); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConstraintViolation { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConstraintViolation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventTypeId = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 3: { if (tag !== 24) { break; } message.ConstraintType = reader.int32() as any; continue; } case 4: { if (tag !== 34) { break; } message.ConstraintName = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Message = reader.string(); continue; } case 6: { if (tag !== 50) { break; } const entry6 = ConstraintViolation_DetailsEntry.decode(reader, reader.uint32()); if (entry6.value !== undefined) { message.Details[entry6.key] = entry6.value; } continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ConstraintViolation { return { EventTypeId: isSet(object.EventTypeId) ? globalThis.String(object.EventTypeId) : "", SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, ConstraintType: isSet(object.ConstraintType) ? constraintTypeFromJSON(object.ConstraintType) : 0, ConstraintName: isSet(object.ConstraintName) ? globalThis.String(object.ConstraintName) : "", Message: isSet(object.Message) ? globalThis.String(object.Message) : "", Details: isObject(object.Details) ? (globalThis.Object.entries(object.Details) as [string, any][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, any]) => { globalThis.Object.defineProperty(acc, key, { value: globalThis.String(value), enumerable: true, configurable: true, writable: true, }); return acc; }, {}, ) : {}, }; }, toJSON(message: ConstraintViolation): unknown { const obj: any = {}; if (message.EventTypeId !== "") { obj.EventTypeId = message.EventTypeId; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.ConstraintType !== 0) { obj.ConstraintType = constraintTypeToJSON(message.ConstraintType); } if (message.ConstraintName !== "") { obj.ConstraintName = message.ConstraintName; } if (message.Message !== "") { obj.Message = message.Message; } if (message.Details) { const entries = globalThis.Object.entries(message.Details) as [string, string][]; if (entries.length > 0) { obj.Details = {}; entries.forEach(([k, v]) => { obj.Details[k] = v; }); } } return obj; }, create(base?: DeepPartial): ConstraintViolation { return ConstraintViolation.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ConstraintViolation { const message = createBaseConstraintViolation(); message.EventTypeId = object.EventTypeId ?? ""; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.ConstraintType = object.ConstraintType ?? 0; message.ConstraintName = object.ConstraintName ?? ""; message.Message = object.Message ?? ""; message.Details = (globalThis.Object.entries(object.Details ?? {}) as [string, string][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, string]) => { if (value !== undefined) { acc[key] = globalThis.String(value); } return acc; }, {}, ); return message; }, }; function createBaseConstraintViolation_DetailsEntry(): ConstraintViolation_DetailsEntry { return { key: "", value: "" }; } export const ConstraintViolation_DetailsEntry: MessageFns = { encode(message: ConstraintViolation_DetailsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== "") { writer.uint32(18).string(message.value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ConstraintViolation_DetailsEntry { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseConstraintViolation_DetailsEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.key = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ConstraintViolation_DetailsEntry { return { key: isSet(object.key) ? globalThis.String(object.key) : "", value: isSet(object.value) ? globalThis.String(object.value) : "", }; }, toJSON(message: ConstraintViolation_DetailsEntry): unknown { const obj: any = {}; if (message.key !== "") { obj.key = message.key; } if (message.value !== "") { obj.value = message.value; } return obj; }, create(base?: DeepPartial): ConstraintViolation_DetailsEntry { return ConstraintViolation_DetailsEntry.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ConstraintViolation_DetailsEntry { const message = createBaseConstraintViolation_DetailsEntry(); message.key = object.key ?? ""; message.value = object.value ?? ""; return message; }, }; function createBaseEndOfRequest(): EndOfRequest { return { Start: undefined, Resolution: 0 }; } export const EndOfRequest: MessageFns = { encode(message: EndOfRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Start !== undefined) { SerializableDateTimeOffset.encode(message.Start, writer.uint32(10).fork()).join(); } if (message.Resolution !== 0) { writer.uint32(16).int32(message.Resolution); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EndOfRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEndOfRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Start = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.Resolution = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EndOfRequest { return { Start: isSet(object.Start) ? SerializableDateTimeOffset.fromJSON(object.Start) : undefined, Resolution: isSet(object.Resolution) ? histogramResolutionFromJSON(object.Resolution) : 0, }; }, toJSON(message: EndOfRequest): unknown { const obj: any = {}; if (message.Start !== undefined) { obj.Start = SerializableDateTimeOffset.toJSON(message.Start); } if (message.Resolution !== 0) { obj.Resolution = histogramResolutionToJSON(message.Resolution); } return obj; }, create(base?: DeepPartial): EndOfRequest { return EndOfRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EndOfRequest { const message = createBaseEndOfRequest(); message.Start = (object.Start !== undefined && object.Start !== null) ? SerializableDateTimeOffset.fromPartial(object.Start) : undefined; message.Resolution = object.Resolution ?? 0; return message; }, }; function createBaseEventContext(): EventContext { return { EventType: undefined, EventSourceType: "", EventSourceId: "", SequenceNumber: 0n, EventStreamType: "", EventStreamId: "", Occurred: undefined, CorrelationId: undefined, Causation: [], CausedBy: undefined, Tags: [], Hash: "", ObservationState: 0, Subject: "", }; } export const EventContext: MessageFns = { encode(message: EventContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventType !== undefined) { EventType.encode(message.EventType, writer.uint32(10).fork()).join(); } if (message.EventSourceType !== "") { writer.uint32(18).string(message.EventSourceType); } if (message.EventSourceId !== "") { writer.uint32(26).string(message.EventSourceId); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(32).uint64(message.SequenceNumber); } if (message.EventStreamType !== "") { writer.uint32(42).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(50).string(message.EventStreamId); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(58).fork()).join(); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(66).fork()).join(); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(74).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(82).fork()).join(); } for (const v of message.Tags) { writer.uint32(90).string(v!); } if (message.Hash !== "") { writer.uint32(98).string(message.Hash); } if (message.ObservationState !== 0) { writer.uint32(104).int32(message.ObservationState); } if (message.Subject !== "") { writer.uint32(114).string(message.Subject); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventContext { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventContext(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventType = EventType.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.EventSourceType = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSourceId = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 5: { if (tag !== 42) { break; } message.EventStreamType = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventStreamId = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 8: { if (tag !== 66) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 9: { if (tag !== 74) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 10: { if (tag !== 82) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 11: { if (tag !== 90) { break; } message.Tags.push(reader.string()); continue; } case 12: { if (tag !== 98) { break; } message.Hash = reader.string(); continue; } case 13: { if (tag !== 104) { break; } message.ObservationState = reader.int32() as any; continue; } case 14: { if (tag !== 114) { break; } message.Subject = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventContext { return { EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Hash: isSet(object.Hash) ? globalThis.String(object.Hash) : "", ObservationState: isSet(object.ObservationState) ? eventObservationStateFromJSON(object.ObservationState) : 0, Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", }; }, toJSON(message: EventContext): unknown { const obj: any = {}; if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Hash !== "") { obj.Hash = message.Hash; } if (message.ObservationState !== 0) { obj.ObservationState = eventObservationStateToJSON(message.ObservationState); } if (message.Subject !== "") { obj.Subject = message.Subject; } return obj; }, create(base?: DeepPartial): EventContext { return EventContext.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventContext { const message = createBaseEventContext(); message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.EventSourceType = object.EventSourceType ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; message.Tags = object.Tags?.map((e) => e) || []; message.Hash = object.Hash ?? ""; message.ObservationState = object.ObservationState ?? 0; message.Subject = object.Subject ?? ""; return message; }, }; function createBaseEventForEventSourceId(): EventForEventSourceId { return { EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", EventType: undefined, Content: "", Tags: [], Occurred: undefined, Subject: "", }; } export const EventForEventSourceId: MessageFns = { encode(message: EventForEventSourceId, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventSourceId !== "") { writer.uint32(10).string(message.EventSourceId); } if (message.EventSourceType !== "") { writer.uint32(18).string(message.EventSourceType); } if (message.EventStreamType !== "") { writer.uint32(26).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(34).string(message.EventStreamId); } if (message.EventType !== undefined) { EventType.encode(message.EventType, writer.uint32(42).fork()).join(); } if (message.Content !== "") { writer.uint32(50).string(message.Content); } for (const v of message.Tags) { writer.uint32(58).string(v!); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(66).fork()).join(); } if (message.Subject !== "") { writer.uint32(74).string(message.Subject); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventForEventSourceId { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventForEventSourceId(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventSourceId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.EventSourceType = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventStreamType = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventStreamId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventType = EventType.decode(reader, reader.uint32()); continue; } case 6: { if (tag !== 50) { break; } message.Content = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Tags.push(reader.string()); continue; } case 8: { if (tag !== 66) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 9: { if (tag !== 74) { break; } message.Subject = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventForEventSourceId { return { EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", }; }, toJSON(message: EventForEventSourceId): unknown { const obj: any = {}; if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.Content !== "") { obj.Content = message.Content; } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.Subject !== "") { obj.Subject = message.Subject; } return obj; }, create(base?: DeepPartial): EventForEventSourceId { return EventForEventSourceId.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventForEventSourceId { const message = createBaseEventForEventSourceId(); message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.Content = object.Content ?? ""; message.Tags = object.Tags?.map((e) => e) || []; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.Subject = object.Subject ?? ""; return message; }, }; function createBaseEventRevision(): EventRevision { return { Generation: 0, CorrelationId: "", CausedBy: undefined, Occurred: undefined, Content: "" }; } export const EventRevision: MessageFns = { encode(message: EventRevision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Generation !== 0) { writer.uint32(8).uint32(message.Generation); } if (message.CorrelationId !== "") { writer.uint32(18).string(message.CorrelationId); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(26).fork()).join(); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(34).fork()).join(); } if (message.Content !== "") { writer.uint32(42).string(message.Content); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventRevision { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventRevision(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Generation = reader.uint32(); continue; } case 2: { if (tag !== 18) { break; } message.CorrelationId = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 4: { if (tag !== 34) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 5: { if (tag !== 42) { break; } message.Content = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventRevision { return { Generation: isSet(object.Generation) ? globalThis.Number(object.Generation) : 0, CorrelationId: isSet(object.CorrelationId) ? globalThis.String(object.CorrelationId) : "", CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", }; }, toJSON(message: EventRevision): unknown { const obj: any = {}; if (message.Generation !== 0) { obj.Generation = Math.round(message.Generation); } if (message.CorrelationId !== "") { obj.CorrelationId = message.CorrelationId; } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.Content !== "") { obj.Content = message.Content; } return obj; }, create(base?: DeepPartial): EventRevision { return EventRevision.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventRevision { const message = createBaseEventRevision(); message.Generation = object.Generation ?? 0; message.CorrelationId = object.CorrelationId ?? ""; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.Content = object.Content ?? ""; return message; }, }; function createBaseEventSequenceNamesResponse(): EventSequenceNamesResponse { return { Id: "", Name: "" }; } export const EventSequenceNamesResponse: MessageFns = { encode(message: EventSequenceNamesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Name !== "") { writer.uint32(18).string(message.Name); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventSequenceNamesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSequenceNamesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Name = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventSequenceNamesResponse { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Name: isSet(object.Name) ? globalThis.String(object.Name) : "", }; }, toJSON(message: EventSequenceNamesResponse): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Name !== "") { obj.Name = message.Name; } return obj; }, create(base?: DeepPartial): EventSequenceNamesResponse { return EventSequenceNamesResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventSequenceNamesResponse { const message = createBaseEventSequenceNamesResponse(); message.Id = object.Id ?? ""; message.Name = object.Name ?? ""; return message; }, }; function createBaseEventSequenceTailResponse(): EventSequenceTailResponse { return { SequenceNumber: 0n }; } export const EventSequenceTailResponse: MessageFns = { encode(message: EventSequenceTailResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(8).uint64(message.SequenceNumber); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventSequenceTailResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSequenceTailResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventSequenceTailResponse { return { SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n }; }, toJSON(message: EventSequenceTailResponse): unknown { const obj: any = {}; if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } return obj; }, create(base?: DeepPartial): EventSequenceTailResponse { return EventSequenceTailResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventSequenceTailResponse { const message = createBaseEventSequenceTailResponse(); message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; return message; }, }; function createBaseEventSourceConcurrencyScope(): EventSourceConcurrencyScope { return { EventSourceId: "", Scope: undefined }; } export const EventSourceConcurrencyScope: MessageFns = { encode(message: EventSourceConcurrencyScope, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventSourceId !== "") { writer.uint32(10).string(message.EventSourceId); } if (message.Scope !== undefined) { ConcurrencyScope.encode(message.Scope, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventSourceConcurrencyScope { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSourceConcurrencyScope(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventSourceId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Scope = ConcurrencyScope.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventSourceConcurrencyScope { return { EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", Scope: isSet(object.Scope) ? ConcurrencyScope.fromJSON(object.Scope) : undefined, }; }, toJSON(message: EventSourceConcurrencyScope): unknown { const obj: any = {}; if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.Scope !== undefined) { obj.Scope = ConcurrencyScope.toJSON(message.Scope); } return obj; }, create(base?: DeepPartial): EventSourceConcurrencyScope { return EventSourceConcurrencyScope.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventSourceConcurrencyScope { const message = createBaseEventSourceConcurrencyScope(); message.EventSourceId = object.EventSourceId ?? ""; message.Scope = (object.Scope !== undefined && object.Scope !== null) ? ConcurrencyScope.fromPartial(object.Scope) : undefined; return message; }, }; function createBaseEventSourceEventsResponse(): EventSourceEventsResponse { return { HasEvents: false }; } export const EventSourceEventsResponse: MessageFns = { encode(message: EventSourceEventsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.HasEvents !== false) { writer.uint32(8).bool(message.HasEvents); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventSourceEventsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventSourceEventsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.HasEvents = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventSourceEventsResponse { return { HasEvents: isSet(object.HasEvents) ? globalThis.Boolean(object.HasEvents) : false }; }, toJSON(message: EventSourceEventsResponse): unknown { const obj: any = {}; if (message.HasEvents !== false) { obj.HasEvents = message.HasEvents; } return obj; }, create(base?: DeepPartial): EventSourceEventsResponse { return EventSourceEventsResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventSourceEventsResponse { const message = createBaseEventSourceEventsResponse(); message.HasEvents = object.HasEvents ?? false; return message; }, }; function createBaseEventToAppend(): EventToAppend { return { EventType: undefined, Content: "", Subject: "" }; } export const EventToAppend: MessageFns = { encode(message: EventToAppend, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventType !== undefined) { EventType.encode(message.EventType, writer.uint32(10).fork()).join(); } if (message.Content !== "") { writer.uint32(18).string(message.Content); } if (message.Subject !== "") { writer.uint32(26).string(message.Subject); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventToAppend { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventToAppend(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventType = EventType.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Content = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Subject = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventToAppend { return { EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", }; }, toJSON(message: EventToAppend): unknown { const obj: any = {}; if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.Content !== "") { obj.Content = message.Content; } if (message.Subject !== "") { obj.Subject = message.Subject; } return obj; }, create(base?: DeepPartial): EventToAppend { return EventToAppend.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventToAppend { const message = createBaseEventToAppend(); message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.Content = object.Content ?? ""; message.Subject = object.Subject ?? ""; return message; }, }; function createBaseEventType(): EventType { return { Id: "", Generation: 0, Tombstone: false }; } export const EventType: MessageFns = { encode(message: EventType, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Generation !== 0) { writer.uint32(16).uint32(message.Generation); } if (message.Tombstone !== false) { writer.uint32(24).bool(message.Tombstone); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventType { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventType(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.Generation = reader.uint32(); continue; } case 3: { if (tag !== 24) { break; } message.Tombstone = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventType { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Generation: isSet(object.Generation) ? globalThis.Number(object.Generation) : 0, Tombstone: isSet(object.Tombstone) ? globalThis.Boolean(object.Tombstone) : false, }; }, toJSON(message: EventType): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Generation !== 0) { obj.Generation = Math.round(message.Generation); } if (message.Tombstone !== false) { obj.Tombstone = message.Tombstone; } return obj; }, create(base?: DeepPartial): EventType { return EventType.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventType { const message = createBaseEventType(); message.Id = object.Id ?? ""; message.Generation = object.Generation ?? 0; message.Tombstone = object.Tombstone ?? false; return message; }, }; function createBaseExportEventsRequest(): ExportEventsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", CorrelationId: "", EventTypeIds: "", Tags: "", OccurredFrom: undefined, OccurredTo: undefined, }; } export const ExportEventsRequest: MessageFns = { encode(message: ExportEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(18).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(26).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(34).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(42).string(message.EventSourceId); } if (message.EventSourceType !== "") { writer.uint32(50).string(message.EventSourceType); } if (message.EventStreamType !== "") { writer.uint32(58).string(message.EventStreamType); } if (message.CorrelationId !== "") { writer.uint32(66).string(message.CorrelationId); } if (message.EventTypeIds !== "") { writer.uint32(74).string(message.EventTypeIds); } if (message.Tags !== "") { writer.uint32(82).string(message.Tags); } if (message.OccurredFrom !== undefined) { SerializableDateTimeOffset.encode(message.OccurredFrom, writer.uint32(90).fork()).join(); } if (message.OccurredTo !== undefined) { SerializableDateTimeOffset.encode(message.OccurredTo, writer.uint32(98).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ExportEventsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExportEventsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: { if (tag !== 18) { break; } message.EventStore = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Namespace = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSequenceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceId = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventSourceType = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventStreamType = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.CorrelationId = reader.string(); continue; } case 9: { if (tag !== 74) { break; } message.EventTypeIds = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.Tags = reader.string(); continue; } case 11: { if (tag !== 90) { break; } message.OccurredFrom = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 12: { if (tag !== 98) { break; } message.OccurredTo = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ExportEventsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", CorrelationId: isSet(object.CorrelationId) ? globalThis.String(object.CorrelationId) : "", EventTypeIds: isSet(object.EventTypeIds) ? globalThis.String(object.EventTypeIds) : "", Tags: isSet(object.Tags) ? globalThis.String(object.Tags) : "", OccurredFrom: isSet(object.OccurredFrom) ? SerializableDateTimeOffset.fromJSON(object.OccurredFrom) : undefined, OccurredTo: isSet(object.OccurredTo) ? SerializableDateTimeOffset.fromJSON(object.OccurredTo) : undefined, }; }, toJSON(message: ExportEventsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.CorrelationId !== "") { obj.CorrelationId = message.CorrelationId; } if (message.EventTypeIds !== "") { obj.EventTypeIds = message.EventTypeIds; } if (message.Tags !== "") { obj.Tags = message.Tags; } if (message.OccurredFrom !== undefined) { obj.OccurredFrom = SerializableDateTimeOffset.toJSON(message.OccurredFrom); } if (message.OccurredTo !== undefined) { obj.OccurredTo = SerializableDateTimeOffset.toJSON(message.OccurredTo); } return obj; }, create(base?: DeepPartial): ExportEventsRequest { return ExportEventsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ExportEventsRequest { const message = createBaseExportEventsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.CorrelationId = object.CorrelationId ?? ""; message.EventTypeIds = object.EventTypeIds ?? ""; message.Tags = object.Tags ?? ""; message.OccurredFrom = (object.OccurredFrom !== undefined && object.OccurredFrom !== null) ? SerializableDateTimeOffset.fromPartial(object.OccurredFrom) : undefined; message.OccurredTo = (object.OccurredTo !== undefined && object.OccurredTo !== null) ? SerializableDateTimeOffset.fromPartial(object.OccurredTo) : undefined; return message; }, }; function createBaseExportedEventResponse(): ExportedEventResponse { return { SequenceNumber: 0n, EventType: "", EventSourceType: "", EventSourceId: "", EventStreamType: "", CorrelationId: "", Occurred: undefined, Tags: [], Content: "", }; } export const ExportedEventResponse: MessageFns = { encode(message: ExportedEventResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(8).uint64(message.SequenceNumber); } if (message.EventType !== "") { writer.uint32(18).string(message.EventType); } if (message.EventSourceType !== "") { writer.uint32(26).string(message.EventSourceType); } if (message.EventSourceId !== "") { writer.uint32(34).string(message.EventSourceId); } if (message.EventStreamType !== "") { writer.uint32(42).string(message.EventStreamType); } if (message.CorrelationId !== "") { writer.uint32(50).string(message.CorrelationId); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(58).fork()).join(); } for (const v of message.Tags) { writer.uint32(66).string(v!); } if (message.Content !== "") { writer.uint32(74).string(message.Content); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ExportedEventResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseExportedEventResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 2: { if (tag !== 18) { break; } message.EventType = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSourceType = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSourceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventStreamType = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.CorrelationId = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 8: { if (tag !== 66) { break; } message.Tags.push(reader.string()); continue; } case 9: { if (tag !== 74) { break; } message.Content = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ExportedEventResponse { return { SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, EventType: isSet(object.EventType) ? globalThis.String(object.EventType) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", CorrelationId: isSet(object.CorrelationId) ? globalThis.String(object.CorrelationId) : "", Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Content: isSet(object.Content) ? globalThis.String(object.Content) : "", }; }, toJSON(message: ExportedEventResponse): unknown { const obj: any = {}; if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.EventType !== "") { obj.EventType = message.EventType; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.CorrelationId !== "") { obj.CorrelationId = message.CorrelationId; } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Content !== "") { obj.Content = message.Content; } return obj; }, create(base?: DeepPartial): ExportedEventResponse { return ExportedEventResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ExportedEventResponse { const message = createBaseExportedEventResponse(); message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.EventType = object.EventType ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.CorrelationId = object.CorrelationId ?? ""; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.Tags = object.Tags?.map((e) => e) || []; message.Content = object.Content ?? ""; return message; }, }; function createBaseForEventSourceIdAndEventTypesRequest(): ForEventSourceIdAndEventTypesRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventTypeIds: "", EventStreamType: "", EventStreamId: "", EventSourceType: "", }; } export const ForEventSourceIdAndEventTypesRequest: MessageFns = { encode(message: ForEventSourceIdAndEventTypesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(18).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(26).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(34).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(42).string(message.EventSourceId); } if (message.EventTypeIds !== "") { writer.uint32(50).string(message.EventTypeIds); } if (message.EventStreamType !== "") { writer.uint32(58).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(66).string(message.EventStreamId); } if (message.EventSourceType !== "") { writer.uint32(74).string(message.EventSourceType); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ForEventSourceIdAndEventTypesRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseForEventSourceIdAndEventTypesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: { if (tag !== 18) { break; } message.EventStore = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Namespace = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSequenceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceId = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventTypeIds = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventStreamType = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.EventStreamId = reader.string(); continue; } case 9: { if (tag !== 74) { break; } message.EventSourceType = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ForEventSourceIdAndEventTypesRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventTypeIds: isSet(object.EventTypeIds) ? globalThis.String(object.EventTypeIds) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", }; }, toJSON(message: ForEventSourceIdAndEventTypesRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventTypeIds !== "") { obj.EventTypeIds = message.EventTypeIds; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } return obj; }, create(base?: DeepPartial): ForEventSourceIdAndEventTypesRequest { return ForEventSourceIdAndEventTypesRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ForEventSourceIdAndEventTypesRequest { const message = createBaseForEventSourceIdAndEventTypesRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventTypeIds = object.EventTypeIds ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; return message; }, }; function createBaseFromSequenceNumberRequest(): FromSequenceNumberRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", FromEventSequenceNumber: 0n, EventSourceId: "", EventTypeIds: "", }; } export const FromSequenceNumberRequest: MessageFns = { encode(message: FromSequenceNumberRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(18).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(26).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(34).string(message.EventSequenceId); } if (message.FromEventSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.FromEventSequenceNumber) !== message.FromEventSequenceNumber) { throw new globalThis.Error("value provided for field message.FromEventSequenceNumber of type uint64 too large"); } writer.uint32(40).uint64(message.FromEventSequenceNumber); } if (message.EventSourceId !== "") { writer.uint32(50).string(message.EventSourceId); } if (message.EventTypeIds !== "") { writer.uint32(58).string(message.EventTypeIds); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): FromSequenceNumberRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseFromSequenceNumberRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: { if (tag !== 18) { break; } message.EventStore = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Namespace = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSequenceId = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.FromEventSequenceNumber = reader.uint64() as bigint; continue; } case 6: { if (tag !== 50) { break; } message.EventSourceId = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventTypeIds = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): FromSequenceNumberRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", FromEventSequenceNumber: isSet(object.FromEventSequenceNumber) ? BigInt(object.FromEventSequenceNumber) : 0n, EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventTypeIds: isSet(object.EventTypeIds) ? globalThis.String(object.EventTypeIds) : "", }; }, toJSON(message: FromSequenceNumberRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.FromEventSequenceNumber !== 0n) { obj.FromEventSequenceNumber = message.FromEventSequenceNumber.toString(); } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventTypeIds !== "") { obj.EventTypeIds = message.EventTypeIds; } return obj; }, create(base?: DeepPartial): FromSequenceNumberRequest { return FromSequenceNumberRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): FromSequenceNumberRequest { const message = createBaseFromSequenceNumberRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.FromEventSequenceNumber = (object.FromEventSequenceNumber !== undefined && object.FromEventSequenceNumber !== null) ? BigInt(object.FromEventSequenceNumber) : 0n; message.EventSourceId = object.EventSourceId ?? ""; message.EventTypeIds = object.EventTypeIds ?? ""; return message; }, }; function createBaseHasEventsForEventSourceIdRequest(): HasEventsForEventSourceIdRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "" }; } export const HasEventsForEventSourceIdRequest: MessageFns = { encode(message: HasEventsForEventSourceIdRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(34).string(message.EventSourceId); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): HasEventsForEventSourceIdRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseHasEventsForEventSourceIdRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSourceId = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): HasEventsForEventSourceIdRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", }; }, toJSON(message: HasEventsForEventSourceIdRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } return obj; }, create(base?: DeepPartial): HasEventsForEventSourceIdRequest { return HasEventsForEventSourceIdRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): HasEventsForEventSourceIdRequest { const message = createBaseHasEventsForEventSourceIdRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; return message; }, }; function createBaseIdentity(): Identity { return { Subject: "", Name: "", UserName: "", OnBehalfOf: undefined }; } export const Identity: MessageFns = { encode(message: Identity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Subject !== "") { writer.uint32(10).string(message.Subject); } if (message.Name !== "") { writer.uint32(18).string(message.Name); } if (message.UserName !== "") { writer.uint32(26).string(message.UserName); } if (message.OnBehalfOf !== undefined) { Identity.encode(message.OnBehalfOf, writer.uint32(34).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Identity { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseIdentity(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Subject = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Name = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.UserName = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.OnBehalfOf = Identity.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Identity { return { Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", Name: isSet(object.Name) ? globalThis.String(object.Name) : "", UserName: isSet(object.UserName) ? globalThis.String(object.UserName) : "", OnBehalfOf: isSet(object.OnBehalfOf) ? Identity.fromJSON(object.OnBehalfOf) : undefined, }; }, toJSON(message: Identity): unknown { const obj: any = {}; if (message.Subject !== "") { obj.Subject = message.Subject; } if (message.Name !== "") { obj.Name = message.Name; } if (message.UserName !== "") { obj.UserName = message.UserName; } if (message.OnBehalfOf !== undefined) { obj.OnBehalfOf = Identity.toJSON(message.OnBehalfOf); } return obj; }, create(base?: DeepPartial): Identity { return Identity.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Identity { const message = createBaseIdentity(); message.Subject = object.Subject ?? ""; message.Name = object.Name ?? ""; message.UserName = object.UserName ?? ""; message.OnBehalfOf = (object.OnBehalfOf !== undefined && object.OnBehalfOf !== null) ? Identity.fromPartial(object.OnBehalfOf) : undefined; return message; }, }; function createBaseKeyValuePairInt32String(): KeyValuePairInt32String { return { Key: 0, Value: "" }; } export const KeyValuePairInt32String: MessageFns = { encode(message: KeyValuePairInt32String, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Key !== 0) { writer.uint32(8).int32(message.Key); } if (message.Value !== "") { writer.uint32(18).string(message.Value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): KeyValuePairInt32String { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseKeyValuePairInt32String(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Key = reader.int32(); continue; } case 2: { if (tag !== 18) { break; } message.Value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): KeyValuePairInt32String { return { Key: isSet(object.Key) ? globalThis.Number(object.Key) : 0, Value: isSet(object.Value) ? globalThis.String(object.Value) : "", }; }, toJSON(message: KeyValuePairInt32String): unknown { const obj: any = {}; if (message.Key !== 0) { obj.Key = Math.round(message.Key); } if (message.Value !== "") { obj.Value = message.Value; } return obj; }, create(base?: DeepPartial): KeyValuePairInt32String { return KeyValuePairInt32String.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): KeyValuePairInt32String { const message = createBaseKeyValuePairInt32String(); message.Key = object.Key ?? 0; message.Value = object.Value ?? ""; return message; }, }; function createBaseParseResolutionRequest(): ParseResolutionRequest { return { Resolution: "" }; } export const ParseResolutionRequest: MessageFns = { encode(message: ParseResolutionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Resolution !== "") { writer.uint32(10).string(message.Resolution); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ParseResolutionRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseParseResolutionRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Resolution = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ParseResolutionRequest { return { Resolution: isSet(object.Resolution) ? globalThis.String(object.Resolution) : "" }; }, toJSON(message: ParseResolutionRequest): unknown { const obj: any = {}; if (message.Resolution !== "") { obj.Resolution = message.Resolution; } return obj; }, create(base?: DeepPartial): ParseResolutionRequest { return ParseResolutionRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ParseResolutionRequest { const message = createBaseParseResolutionRequest(); message.Resolution = object.Resolution ?? ""; return message; }, }; function createBaseQueryEventsRequest(): QueryEventsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", CorrelationId: "", EventTypeIds: "", Tags: "", OccurredFrom: undefined, OccurredTo: undefined, }; } export const QueryEventsRequest: MessageFns = { encode(message: QueryEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(18).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(26).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(34).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(42).string(message.EventSourceId); } if (message.EventSourceType !== "") { writer.uint32(50).string(message.EventSourceType); } if (message.EventStreamType !== "") { writer.uint32(58).string(message.EventStreamType); } if (message.CorrelationId !== "") { writer.uint32(66).string(message.CorrelationId); } if (message.EventTypeIds !== "") { writer.uint32(74).string(message.EventTypeIds); } if (message.Tags !== "") { writer.uint32(82).string(message.Tags); } if (message.OccurredFrom !== undefined) { SerializableDateTimeOffset.encode(message.OccurredFrom, writer.uint32(90).fork()).join(); } if (message.OccurredTo !== undefined) { SerializableDateTimeOffset.encode(message.OccurredTo, writer.uint32(98).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryEventsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryEventsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 2: { if (tag !== 18) { break; } message.EventStore = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Namespace = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSequenceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceId = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventSourceType = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventStreamType = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.CorrelationId = reader.string(); continue; } case 9: { if (tag !== 74) { break; } message.EventTypeIds = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.Tags = reader.string(); continue; } case 11: { if (tag !== 90) { break; } message.OccurredFrom = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 12: { if (tag !== 98) { break; } message.OccurredTo = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryEventsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", CorrelationId: isSet(object.CorrelationId) ? globalThis.String(object.CorrelationId) : "", EventTypeIds: isSet(object.EventTypeIds) ? globalThis.String(object.EventTypeIds) : "", Tags: isSet(object.Tags) ? globalThis.String(object.Tags) : "", OccurredFrom: isSet(object.OccurredFrom) ? SerializableDateTimeOffset.fromJSON(object.OccurredFrom) : undefined, OccurredTo: isSet(object.OccurredTo) ? SerializableDateTimeOffset.fromJSON(object.OccurredTo) : undefined, }; }, toJSON(message: QueryEventsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.CorrelationId !== "") { obj.CorrelationId = message.CorrelationId; } if (message.EventTypeIds !== "") { obj.EventTypeIds = message.EventTypeIds; } if (message.Tags !== "") { obj.Tags = message.Tags; } if (message.OccurredFrom !== undefined) { obj.OccurredFrom = SerializableDateTimeOffset.toJSON(message.OccurredFrom); } if (message.OccurredTo !== undefined) { obj.OccurredTo = SerializableDateTimeOffset.toJSON(message.OccurredTo); } return obj; }, create(base?: DeepPartial): QueryEventsRequest { return QueryEventsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryEventsRequest { const message = createBaseQueryEventsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.CorrelationId = object.CorrelationId ?? ""; message.EventTypeIds = object.EventTypeIds ?? ""; message.Tags = object.Tags ?? ""; message.OccurredFrom = (object.OccurredFrom !== undefined && object.OccurredFrom !== null) ? SerializableDateTimeOffset.fromPartial(object.OccurredFrom) : undefined; message.OccurredTo = (object.OccurredTo !== undefined && object.OccurredTo !== null) ? SerializableDateTimeOffset.fromPartial(object.OccurredTo) : undefined; return message; }, }; function createBaseQueryResultEventSequenceTailResponse(): QueryResultEventSequenceTailResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultEventSequenceTailResponse: MessageFns = { encode(message: QueryResultEventSequenceTailResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.Data !== undefined) { EventSequenceTailResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultEventSequenceTailResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultEventSequenceTailResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data = EventSequenceTailResponse.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultEventSequenceTailResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: isSet(object.Data) ? EventSequenceTailResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultEventSequenceTailResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data !== undefined) { obj.Data = EventSequenceTailResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultEventSequenceTailResponse { return QueryResultEventSequenceTailResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultEventSequenceTailResponse { const message = createBaseQueryResultEventSequenceTailResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = (object.Data !== undefined && object.Data !== null) ? EventSequenceTailResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseQueryResultEventSourceEventsResponse(): QueryResultEventSourceEventsResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultEventSourceEventsResponse: MessageFns = { encode(message: QueryResultEventSourceEventsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.Data !== undefined) { EventSourceEventsResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultEventSourceEventsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultEventSourceEventsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data = EventSourceEventsResponse.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultEventSourceEventsResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: isSet(object.Data) ? EventSourceEventsResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultEventSourceEventsResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data !== undefined) { obj.Data = EventSourceEventsResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultEventSourceEventsResponse { return QueryResultEventSourceEventsResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultEventSourceEventsResponse { const message = createBaseQueryResultEventSourceEventsResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = (object.Data !== undefined && object.Data !== null) ? EventSourceEventsResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseQueryResultHistogramResolution(): QueryResultHistogramResolution { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: 0, }; } export const QueryResultHistogramResolution: MessageFns = { encode(message: QueryResultHistogramResolution, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.Data !== 0) { writer.uint32(48).int32(message.Data); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultHistogramResolution { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultHistogramResolution(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 48) { break; } message.Data = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultHistogramResolution { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: isSet(object.Data) ? histogramResolutionFromJSON(object.Data) : 0, }; }, toJSON(message: QueryResultHistogramResolution): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data !== 0) { obj.Data = histogramResolutionToJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultHistogramResolution { return QueryResultHistogramResolution.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultHistogramResolution { const message = createBaseQueryResultHistogramResolution(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = object.Data ?? 0; return message; }, }; function createBaseQueryResultIEnumerableAppendedEventResponse(): QueryResultIEnumerableAppendedEventResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableAppendedEventResponse: MessageFns = { encode( message: QueryResultIEnumerableAppendedEventResponse, writer: BinaryWriter = new BinaryWriter(), ): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } for (const v of message.Data) { AppendedEventResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableAppendedEventResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultIEnumerableAppendedEventResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data.push(AppendedEventResponse.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultIEnumerableAppendedEventResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: globalThis.Array.isArray(object?.Data) ? object.Data.map((e: any) => AppendedEventResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableAppendedEventResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data?.length) { obj.Data = message.Data.map((e) => AppendedEventResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableAppendedEventResponse { return QueryResultIEnumerableAppendedEventResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableAppendedEventResponse { const message = createBaseQueryResultIEnumerableAppendedEventResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = object.Data?.map((e) => AppendedEventResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultIEnumerableEventSequenceNamesResponse(): QueryResultIEnumerableEventSequenceNamesResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableEventSequenceNamesResponse: MessageFns< QueryResultIEnumerableEventSequenceNamesResponse > = { encode( message: QueryResultIEnumerableEventSequenceNamesResponse, writer: BinaryWriter = new BinaryWriter(), ): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } for (const v of message.Data) { EventSequenceNamesResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableEventSequenceNamesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultIEnumerableEventSequenceNamesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data.push(EventSequenceNamesResponse.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultIEnumerableEventSequenceNamesResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: globalThis.Array.isArray(object?.Data) ? object.Data.map((e: any) => EventSequenceNamesResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableEventSequenceNamesResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data?.length) { obj.Data = message.Data.map((e) => EventSequenceNamesResponse.toJSON(e)); } return obj; }, create( base?: DeepPartial, ): QueryResultIEnumerableEventSequenceNamesResponse { return QueryResultIEnumerableEventSequenceNamesResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableEventSequenceNamesResponse { const message = createBaseQueryResultIEnumerableEventSequenceNamesResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = object.Data?.map((e) => EventSequenceNamesResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultIEnumerableExportedEventResponse(): QueryResultIEnumerableExportedEventResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableExportedEventResponse: MessageFns = { encode( message: QueryResultIEnumerableExportedEventResponse, writer: BinaryWriter = new BinaryWriter(), ): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } for (const v of message.Data) { ExportedEventResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableExportedEventResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultIEnumerableExportedEventResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data.push(ExportedEventResponse.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultIEnumerableExportedEventResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: globalThis.Array.isArray(object?.Data) ? object.Data.map((e: any) => ExportedEventResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableExportedEventResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data?.length) { obj.Data = message.Data.map((e) => ExportedEventResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableExportedEventResponse { return QueryResultIEnumerableExportedEventResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableExportedEventResponse { const message = createBaseQueryResultIEnumerableExportedEventResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = object.Data?.map((e) => ExportedEventResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultIEnumerableSequenceHistogramBucketResponse(): QueryResultIEnumerableSequenceHistogramBucketResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableSequenceHistogramBucketResponse: MessageFns< QueryResultIEnumerableSequenceHistogramBucketResponse > = { encode( message: QueryResultIEnumerableSequenceHistogramBucketResponse, writer: BinaryWriter = new BinaryWriter(), ): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } for (const v of message.Data) { SequenceHistogramBucketResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableSequenceHistogramBucketResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultIEnumerableSequenceHistogramBucketResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data.push(SequenceHistogramBucketResponse.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultIEnumerableSequenceHistogramBucketResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: globalThis.Array.isArray(object?.Data) ? object.Data.map((e: any) => SequenceHistogramBucketResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableSequenceHistogramBucketResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data?.length) { obj.Data = message.Data.map((e) => SequenceHistogramBucketResponse.toJSON(e)); } return obj; }, create( base?: DeepPartial, ): QueryResultIEnumerableSequenceHistogramBucketResponse { return QueryResultIEnumerableSequenceHistogramBucketResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableSequenceHistogramBucketResponse { const message = createBaseQueryResultIEnumerableSequenceHistogramBucketResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = object.Data?.map((e) => SequenceHistogramBucketResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultSerializableDateTimeOffset(): QueryResultSerializableDateTimeOffset { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultSerializableDateTimeOffset: MessageFns = { encode(message: QueryResultSerializableDateTimeOffset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.Data !== undefined) { SerializableDateTimeOffset.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultSerializableDateTimeOffset { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseQueryResultSerializableDateTimeOffset(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Data = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): QueryResultSerializableDateTimeOffset { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: isSet(object.Data) ? SerializableDateTimeOffset.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultSerializableDateTimeOffset): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data !== undefined) { obj.Data = SerializableDateTimeOffset.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultSerializableDateTimeOffset { return QueryResultSerializableDateTimeOffset.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultSerializableDateTimeOffset { const message = createBaseQueryResultSerializableDateTimeOffset(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = (object.Data !== undefined && object.Data !== null) ? SerializableDateTimeOffset.fromPartial(object.Data) : undefined; return message; }, }; function createBaseRedactForEventSourceRequest(): RedactForEventSourceRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", Reason: "", EventTypes: [], Causation: [], CausedBy: undefined, }; } export const RedactForEventSourceRequest: MessageFns = { encode(message: RedactForEventSourceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.EventSourceId !== "") { writer.uint32(34).string(message.EventSourceId); } if (message.Reason !== "") { writer.uint32(42).string(message.Reason); } for (const v of message.EventTypes) { writer.uint32(50).string(v!); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(58).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(66).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RedactForEventSourceRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedactForEventSourceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSourceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Reason = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventTypes.push(reader.string()); continue; } case 7: { if (tag !== 58) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 8: { if (tag !== 66) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): RedactForEventSourceRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", Reason: isSet(object.Reason) ? globalThis.String(object.Reason) : "", EventTypes: globalThis.Array.isArray(object?.EventTypes) ? object.EventTypes.map((e: any) => globalThis.String(e)) : [], Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, }; }, toJSON(message: RedactForEventSourceRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.Reason !== "") { obj.Reason = message.Reason; } if (message.EventTypes?.length) { obj.EventTypes = message.EventTypes; } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } return obj; }, create(base?: DeepPartial): RedactForEventSourceRequest { return RedactForEventSourceRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RedactForEventSourceRequest { const message = createBaseRedactForEventSourceRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.Reason = object.Reason ?? ""; message.EventTypes = object.EventTypes?.map((e) => e) || []; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; return message; }, }; function createBaseRedactRequest(): RedactRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", SequenceNumber: 0n, Reason: "", Causation: [], CausedBy: undefined, }; } export const RedactRequest: MessageFns = { encode(message: RedactRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(32).uint64(message.SequenceNumber); } if (message.Reason !== "") { writer.uint32(42).string(message.Reason); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(50).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RedactRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseRedactRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 5: { if (tag !== 42) { break; } message.Reason = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 7: { if (tag !== 58) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): RedactRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, Reason: isSet(object.Reason) ? globalThis.String(object.Reason) : "", Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, }; }, toJSON(message: RedactRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.Reason !== "") { obj.Reason = message.Reason; } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } return obj; }, create(base?: DeepPartial): RedactRequest { return RedactRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RedactRequest { const message = createBaseRedactRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.Reason = object.Reason ?? ""; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; return message; }, }; function createBaseReviseRequest(): ReviseRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", SequenceNumber: 0n, EventType: undefined, Content: "", Causation: [], CausedBy: undefined, }; } export const ReviseRequest: MessageFns = { encode(message: ReviseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(32).uint64(message.SequenceNumber); } if (message.EventType !== undefined) { EventType.encode(message.EventType, writer.uint32(42).fork()).join(); } if (message.Content !== "") { writer.uint32(50).string(message.Content); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(58).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(66).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ReviseRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseReviseRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 5: { if (tag !== 42) { break; } message.EventType = EventType.decode(reader, reader.uint32()); continue; } case 6: { if (tag !== 50) { break; } message.Content = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 8: { if (tag !== 66) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ReviseRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], CausedBy: isSet(object.CausedBy) ? Identity.fromJSON(object.CausedBy) : undefined, }; }, toJSON(message: ReviseRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.Content !== "") { obj.Content = message.Content; } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.CausedBy !== undefined) { obj.CausedBy = Identity.toJSON(message.CausedBy); } return obj; }, create(base?: DeepPartial): ReviseRequest { return ReviseRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ReviseRequest { const message = createBaseReviseRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.Content = object.Content ?? ""; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.CausedBy = (object.CausedBy !== undefined && object.CausedBy !== null) ? Identity.fromPartial(object.CausedBy) : undefined; return message; }, }; function createBaseSequenceHistogramBucketResponse(): SequenceHistogramBucketResponse { return { From: undefined, To: undefined, Count: 0n }; } export const SequenceHistogramBucketResponse: MessageFns = { encode(message: SequenceHistogramBucketResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.From !== undefined) { SerializableDateTimeOffset.encode(message.From, writer.uint32(10).fork()).join(); } if (message.To !== undefined) { SerializableDateTimeOffset.encode(message.To, writer.uint32(18).fork()).join(); } if (message.Count !== 0n) { if (BigInt.asIntN(64, message.Count) !== message.Count) { throw new globalThis.Error("value provided for field message.Count of type int64 too large"); } writer.uint32(24).int64(message.Count); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SequenceHistogramBucketResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSequenceHistogramBucketResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.From = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.To = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 24) { break; } message.Count = reader.int64() as bigint; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): SequenceHistogramBucketResponse { return { From: isSet(object.From) ? SerializableDateTimeOffset.fromJSON(object.From) : undefined, To: isSet(object.To) ? SerializableDateTimeOffset.fromJSON(object.To) : undefined, Count: isSet(object.Count) ? BigInt(object.Count) : 0n, }; }, toJSON(message: SequenceHistogramBucketResponse): unknown { const obj: any = {}; if (message.From !== undefined) { obj.From = SerializableDateTimeOffset.toJSON(message.From); } if (message.To !== undefined) { obj.To = SerializableDateTimeOffset.toJSON(message.To); } if (message.Count !== 0n) { obj.Count = message.Count.toString(); } return obj; }, create(base?: DeepPartial): SequenceHistogramBucketResponse { return SequenceHistogramBucketResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SequenceHistogramBucketResponse { const message = createBaseSequenceHistogramBucketResponse(); message.From = (object.From !== undefined && object.From !== null) ? SerializableDateTimeOffset.fromPartial(object.From) : undefined; message.To = (object.To !== undefined && object.To !== null) ? SerializableDateTimeOffset.fromPartial(object.To) : undefined; message.Count = (object.Count !== undefined && object.Count !== null) ? BigInt(object.Count) : 0n; return message; }, }; function createBaseSequenceHistogramRequest(): SequenceHistogramRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", Resolution: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", CorrelationId: "", EventTypeIds: "", Tags: "", OccurredFrom: undefined, OccurredTo: undefined, }; } export const SequenceHistogramRequest: MessageFns = { encode(message: SequenceHistogramRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.Resolution !== "") { writer.uint32(34).string(message.Resolution); } if (message.EventSourceId !== "") { writer.uint32(42).string(message.EventSourceId); } if (message.EventSourceType !== "") { writer.uint32(50).string(message.EventSourceType); } if (message.EventStreamType !== "") { writer.uint32(58).string(message.EventStreamType); } if (message.CorrelationId !== "") { writer.uint32(66).string(message.CorrelationId); } if (message.EventTypeIds !== "") { writer.uint32(74).string(message.EventTypeIds); } if (message.Tags !== "") { writer.uint32(82).string(message.Tags); } if (message.OccurredFrom !== undefined) { SerializableDateTimeOffset.encode(message.OccurredFrom, writer.uint32(90).fork()).join(); } if (message.OccurredTo !== undefined) { SerializableDateTimeOffset.encode(message.OccurredTo, writer.uint32(98).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SequenceHistogramRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSequenceHistogramRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.Resolution = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceId = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventSourceType = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventStreamType = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.CorrelationId = reader.string(); continue; } case 9: { if (tag !== 74) { break; } message.EventTypeIds = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.Tags = reader.string(); continue; } case 11: { if (tag !== 90) { break; } message.OccurredFrom = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 12: { if (tag !== 98) { break; } message.OccurredTo = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): SequenceHistogramRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", Resolution: isSet(object.Resolution) ? globalThis.String(object.Resolution) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", CorrelationId: isSet(object.CorrelationId) ? globalThis.String(object.CorrelationId) : "", EventTypeIds: isSet(object.EventTypeIds) ? globalThis.String(object.EventTypeIds) : "", Tags: isSet(object.Tags) ? globalThis.String(object.Tags) : "", OccurredFrom: isSet(object.OccurredFrom) ? SerializableDateTimeOffset.fromJSON(object.OccurredFrom) : undefined, OccurredTo: isSet(object.OccurredTo) ? SerializableDateTimeOffset.fromJSON(object.OccurredTo) : undefined, }; }, toJSON(message: SequenceHistogramRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.Resolution !== "") { obj.Resolution = message.Resolution; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.CorrelationId !== "") { obj.CorrelationId = message.CorrelationId; } if (message.EventTypeIds !== "") { obj.EventTypeIds = message.EventTypeIds; } if (message.Tags !== "") { obj.Tags = message.Tags; } if (message.OccurredFrom !== undefined) { obj.OccurredFrom = SerializableDateTimeOffset.toJSON(message.OccurredFrom); } if (message.OccurredTo !== undefined) { obj.OccurredTo = SerializableDateTimeOffset.toJSON(message.OccurredTo); } return obj; }, create(base?: DeepPartial): SequenceHistogramRequest { return SequenceHistogramRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SequenceHistogramRequest { const message = createBaseSequenceHistogramRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.Resolution = object.Resolution ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.CorrelationId = object.CorrelationId ?? ""; message.EventTypeIds = object.EventTypeIds ?? ""; message.Tags = object.Tags ?? ""; message.OccurredFrom = (object.OccurredFrom !== undefined && object.OccurredFrom !== null) ? SerializableDateTimeOffset.fromPartial(object.OccurredFrom) : undefined; message.OccurredTo = (object.OccurredTo !== undefined && object.OccurredTo !== null) ? SerializableDateTimeOffset.fromPartial(object.OccurredTo) : undefined; return message; }, }; function createBaseSerializableDateTimeOffset(): SerializableDateTimeOffset { return { Value: "" }; } export const SerializableDateTimeOffset: MessageFns = { encode(message: SerializableDateTimeOffset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Value !== "") { writer.uint32(10).string(message.Value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SerializableDateTimeOffset { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSerializableDateTimeOffset(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): SerializableDateTimeOffset { return { Value: isSet(object.Value) ? globalThis.String(object.Value) : "" }; }, toJSON(message: SerializableDateTimeOffset): unknown { const obj: any = {}; if (message.Value !== "") { obj.Value = message.Value; } return obj; }, create(base?: DeepPartial): SerializableDateTimeOffset { return SerializableDateTimeOffset.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SerializableDateTimeOffset { const message = createBaseSerializableDateTimeOffset(); message.Value = object.Value ?? ""; return message; }, }; function createBaseTailSequenceNumberRequest(): TailSequenceNumberRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventTypeIds: "", EventSourceId: "", EventSourceType: "", EventStreamId: "", EventStreamType: "", }; } export const TailSequenceNumberRequest: MessageFns = { encode(message: TailSequenceNumberRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EventSequenceId !== "") { writer.uint32(26).string(message.EventSequenceId); } if (message.EventTypeIds !== "") { writer.uint32(34).string(message.EventTypeIds); } if (message.EventSourceId !== "") { writer.uint32(42).string(message.EventSourceId); } if (message.EventSourceType !== "") { writer.uint32(50).string(message.EventSourceType); } if (message.EventStreamId !== "") { writer.uint32(58).string(message.EventStreamId); } if (message.EventStreamType !== "") { writer.uint32(66).string(message.EventStreamType); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TailSequenceNumberRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseTailSequenceNumberRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSequenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventTypeIds = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.EventSourceId = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventSourceType = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventStreamId = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.EventStreamType = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): TailSequenceNumberRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", EventTypeIds: isSet(object.EventTypeIds) ? globalThis.String(object.EventTypeIds) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", }; }, toJSON(message: TailSequenceNumberRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.EventTypeIds !== "") { obj.EventTypeIds = message.EventTypeIds; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } return obj; }, create(base?: DeepPartial): TailSequenceNumberRequest { return TailSequenceNumberRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): TailSequenceNumberRequest { const message = createBaseTailSequenceNumberRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventTypeIds = object.EventTypeIds ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.EventStreamType = object.EventStreamType ?? ""; return message; }, }; function createBaseValidationResult(): ValidationResult { return { Severity: 0, Message: "", Members: [] }; } export const ValidationResult: MessageFns = { encode(message: ValidationResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Severity !== 0) { writer.uint32(8).int32(message.Severity); } if (message.Message !== "") { writer.uint32(18).string(message.Message); } for (const v of message.Members) { writer.uint32(26).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ValidationResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidationResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Severity = reader.int32() as any; continue; } case 2: { if (tag !== 18) { break; } message.Message = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Members.push(reader.string()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ValidationResult { return { Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0, Message: isSet(object.Message) ? globalThis.String(object.Message) : "", Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: ValidationResult): unknown { const obj: any = {}; if (message.Severity !== 0) { obj.Severity = validationResultSeverityToJSON(message.Severity); } if (message.Message !== "") { obj.Message = message.Message; } if (message.Members?.length) { obj.Members = message.Members; } return obj; }, create(base?: DeepPartial): ValidationResult { return ValidationResult.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ValidationResult { const message = createBaseValidationResult(); message.Severity = object.Severity ?? 0; message.Message = object.Message ?? ""; message.Members = object.Members?.map((e) => e) || []; return message; }, }; export type EventSequencesDefinition = typeof EventSequencesDefinition; export const EventSequencesDefinition = { name: "EventSequences", fullName: "Cratis.Chronicle.Contracts.Sequences.EventSequences", methods: { allEventSequences: { name: "AllEventSequences", requestType: AllEventSequencesRequest as typeof AllEventSequencesRequest, requestStream: false, responseType: QueryResultIEnumerableEventSequenceNamesResponse as typeof QueryResultIEnumerableEventSequenceNamesResponse, responseStream: false, options: {}, }, append: { name: "Append", requestType: AppendRequest as typeof AppendRequest, requestStream: false, responseType: CommandResultAppendResponse as typeof CommandResultAppendResponse, responseStream: false, options: {}, }, appendedEvents: { name: "AppendedEvents", requestType: AppendedEventsRequest as typeof AppendedEventsRequest, requestStream: false, responseType: QueryResultIEnumerableAppendedEventResponse as typeof QueryResultIEnumerableAppendedEventResponse, responseStream: false, options: {}, }, appendMany: { name: "AppendMany", requestType: AppendManyRequest as typeof AppendManyRequest, requestStream: false, responseType: CommandResultAppendManyResponse as typeof CommandResultAppendManyResponse, responseStream: false, options: {}, }, appendManyForEventSources: { name: "AppendManyForEventSources", requestType: AppendManyForEventSourcesRequest as typeof AppendManyForEventSourcesRequest, requestStream: false, responseType: CommandResultAppendManyResponse as typeof CommandResultAppendManyResponse, responseStream: false, options: {}, }, completeStream: { name: "CompleteStream", requestType: CompleteStreamRequest as typeof CompleteStreamRequest, requestStream: false, responseType: CommandResultCompleteStreamResponse as typeof CommandResultCompleteStreamResponse, responseStream: false, options: {}, }, endOf: { name: "EndOf", requestType: EndOfRequest as typeof EndOfRequest, requestStream: false, responseType: QueryResultSerializableDateTimeOffset as typeof QueryResultSerializableDateTimeOffset, responseStream: false, options: {}, }, exportEvents: { name: "ExportEvents", requestType: ExportEventsRequest as typeof ExportEventsRequest, requestStream: false, responseType: QueryResultIEnumerableExportedEventResponse as typeof QueryResultIEnumerableExportedEventResponse, responseStream: false, options: {}, }, forEventSourceIdAndEventTypes: { name: "ForEventSourceIdAndEventTypes", requestType: ForEventSourceIdAndEventTypesRequest as typeof ForEventSourceIdAndEventTypesRequest, requestStream: false, responseType: QueryResultIEnumerableAppendedEventResponse as typeof QueryResultIEnumerableAppendedEventResponse, responseStream: false, options: {}, }, fromSequenceNumber: { name: "FromSequenceNumber", requestType: FromSequenceNumberRequest as typeof FromSequenceNumberRequest, requestStream: false, responseType: QueryResultIEnumerableAppendedEventResponse as typeof QueryResultIEnumerableAppendedEventResponse, responseStream: false, options: {}, }, hasEventsForEventSourceId: { name: "HasEventsForEventSourceId", requestType: HasEventsForEventSourceIdRequest as typeof HasEventsForEventSourceIdRequest, requestStream: false, responseType: QueryResultEventSourceEventsResponse as typeof QueryResultEventSourceEventsResponse, responseStream: false, options: {}, }, parseResolution: { name: "ParseResolution", requestType: ParseResolutionRequest as typeof ParseResolutionRequest, requestStream: false, responseType: QueryResultHistogramResolution as typeof QueryResultHistogramResolution, responseStream: false, options: {}, }, queryEvents: { name: "QueryEvents", requestType: QueryEventsRequest as typeof QueryEventsRequest, requestStream: false, responseType: QueryResultIEnumerableAppendedEventResponse as typeof QueryResultIEnumerableAppendedEventResponse, responseStream: false, options: {}, }, redact: { name: "Redact", requestType: RedactRequest as typeof RedactRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, redactForEventSource: { name: "RedactForEventSource", requestType: RedactForEventSourceRequest as typeof RedactForEventSourceRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, revise: { name: "Revise", requestType: ReviseRequest as typeof ReviseRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, sequenceHistogram: { name: "SequenceHistogram", requestType: SequenceHistogramRequest as typeof SequenceHistogramRequest, requestStream: false, responseType: QueryResultIEnumerableSequenceHistogramBucketResponse as typeof QueryResultIEnumerableSequenceHistogramBucketResponse, responseStream: false, options: {}, }, tailSequenceNumber: { name: "TailSequenceNumber", requestType: TailSequenceNumberRequest as typeof TailSequenceNumberRequest, requestStream: false, responseType: QueryResultEventSequenceTailResponse as typeof QueryResultEventSequenceTailResponse, responseStream: false, options: {}, }, }, } as const; export interface EventSequencesServiceImplementation { allEventSequences( request: AllEventSequencesRequest, context: CallContext & CallContextExt, ): Promise>; append( request: AppendRequest, context: CallContext & CallContextExt, ): Promise>; appendedEvents( request: AppendedEventsRequest, context: CallContext & CallContextExt, ): Promise>; appendMany( request: AppendManyRequest, context: CallContext & CallContextExt, ): Promise>; appendManyForEventSources( request: AppendManyForEventSourcesRequest, context: CallContext & CallContextExt, ): Promise>; completeStream( request: CompleteStreamRequest, context: CallContext & CallContextExt, ): Promise>; endOf( request: EndOfRequest, context: CallContext & CallContextExt, ): Promise>; exportEvents( request: ExportEventsRequest, context: CallContext & CallContextExt, ): Promise>; forEventSourceIdAndEventTypes( request: ForEventSourceIdAndEventTypesRequest, context: CallContext & CallContextExt, ): Promise>; fromSequenceNumber( request: FromSequenceNumberRequest, context: CallContext & CallContextExt, ): Promise>; hasEventsForEventSourceId( request: HasEventsForEventSourceIdRequest, context: CallContext & CallContextExt, ): Promise>; parseResolution( request: ParseResolutionRequest, context: CallContext & CallContextExt, ): Promise>; queryEvents( request: QueryEventsRequest, context: CallContext & CallContextExt, ): Promise>; redact(request: RedactRequest, context: CallContext & CallContextExt): Promise>; redactForEventSource( request: RedactForEventSourceRequest, context: CallContext & CallContextExt, ): Promise>; revise(request: ReviseRequest, context: CallContext & CallContextExt): Promise>; sequenceHistogram( request: SequenceHistogramRequest, context: CallContext & CallContextExt, ): Promise>; tailSequenceNumber( request: TailSequenceNumberRequest, context: CallContext & CallContextExt, ): Promise>; } export interface EventSequencesClient { allEventSequences( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; append( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; appendedEvents( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; appendMany( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; appendManyForEventSources( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; completeStream( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; endOf( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; exportEvents( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; forEventSourceIdAndEventTypes( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; fromSequenceNumber( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; hasEventsForEventSourceId( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; parseResolution( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; queryEvents( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; redact(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; redactForEventSource( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; revise(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; sequenceHistogram( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; tailSequenceNumber( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined; export type DeepPartial = T extends bigint ? string | number | bigint : T extends Builtin ? T : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; function isObject(value: any): boolean { return typeof value === "object" && value !== null; } function isSet(value: any): boolean { return value !== null && value !== undefined; } export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; }