// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.15.3 // 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 ClosedStreamOrigin { CompleteStream = 0, ClosingEvent = 1, UNRECOGNIZED = -1, } export function closedStreamOriginFromJSON(object: any): ClosedStreamOrigin { switch (object) { case 0: case "CompleteStream": return ClosedStreamOrigin.CompleteStream; case 1: case "ClosingEvent": return ClosedStreamOrigin.ClosingEvent; case -1: case "UNRECOGNIZED": default: return ClosedStreamOrigin.UNRECOGNIZED; } } export function closedStreamOriginToJSON(object: ClosedStreamOrigin): string { switch (object) { case ClosedStreamOrigin.CompleteStream: return "CompleteStream"; case ClosedStreamOrigin.ClosingEvent: return "ClosingEvent"; case ClosedStreamOrigin.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum CompleteStreamError { COMPLETE_STREAM_ERROR_None = 0, AlreadyCompleted = 1, DefaultStreamCannotBeCompleted = 2, EmptyScope = 3, ExpectedTailMismatch = 4, 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 3: case "EmptyScope": return CompleteStreamError.EmptyScope; case 4: case "ExpectedTailMismatch": return CompleteStreamError.ExpectedTailMismatch; 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.EmptyScope: return "EmptyScope"; case CompleteStreamError.ExpectedTailMismatch: return "ExpectedTailMismatch"; case CompleteStreamError.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ConstraintType { CONSTRAINT_TYPE_Unknown = 0, Unique = 1, UniqueEventType = 2, Schema = 3, StreamClosed = 4, ClosesStream = 5, 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 5: case "ClosesStream": return ConstraintType.ClosesStream; 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.ClosesStream: return "ClosesStream"; case ConstraintType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ContentVerificationResult { Unavailable = 0, Equal = 1, Different = 2, UNRECOGNIZED = -1, } export function contentVerificationResultFromJSON(object: any): ContentVerificationResult { switch (object) { case 0: case "Unavailable": return ContentVerificationResult.Unavailable; case 1: case "Equal": return ContentVerificationResult.Equal; case 2: case "Different": return ContentVerificationResult.Different; case -1: case "UNRECOGNIZED": default: return ContentVerificationResult.UNRECOGNIZED; } } export function contentVerificationResultToJSON(object: ContentVerificationResult): string { switch (object) { case ContentVerificationResult.Unavailable: return "Unavailable"; case ContentVerificationResult.Equal: return "Equal"; case ContentVerificationResult.Different: return "Different"; case ContentVerificationResult.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum EffectOutcome { Appended = 0, NoEvents = 1, Refused = 2, UNRECOGNIZED = -1, } export function effectOutcomeFromJSON(object: any): EffectOutcome { switch (object) { case 0: case "Appended": return EffectOutcome.Appended; case 1: case "NoEvents": return EffectOutcome.NoEvents; case 2: case "Refused": return EffectOutcome.Refused; case -1: case "UNRECOGNIZED": default: return EffectOutcome.UNRECOGNIZED; } } export function effectOutcomeToJSON(object: EffectOutcome): string { switch (object) { case EffectOutcome.Appended: return "Appended"; case EffectOutcome.NoEvents: return "NoEvents"; case EffectOutcome.Refused: return "Refused"; case EffectOutcome.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 IdentityResolution { Resolved = 0, NameUnavailable = 1, Missing = 2, NotSet = 3, IDENTITY_RESOLUTION_System = 4, UNRECOGNIZED = -1, } export function identityResolutionFromJSON(object: any): IdentityResolution { switch (object) { case 0: case "Resolved": return IdentityResolution.Resolved; case 1: case "NameUnavailable": return IdentityResolution.NameUnavailable; case 2: case "Missing": return IdentityResolution.Missing; case 3: case "NotSet": return IdentityResolution.NotSet; case 4: case "IDENTITY_RESOLUTION_System": return IdentityResolution.IDENTITY_RESOLUTION_System; case -1: case "UNRECOGNIZED": default: return IdentityResolution.UNRECOGNIZED; } } export function identityResolutionToJSON(object: IdentityResolution): string { switch (object) { case IdentityResolution.Resolved: return "Resolved"; case IdentityResolution.NameUnavailable: return "NameUnavailable"; case IdentityResolution.Missing: return "Missing"; case IdentityResolution.NotSet: return "NotSet"; case IdentityResolution.IDENTITY_RESOLUTION_System: return "IDENTITY_RESOLUTION_System"; case IdentityResolution.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum InitiatorType { INITIATOR_TYPE_Unknown = 0, User = 1, Agent = 2, INITIATOR_TYPE_System = 3, UNRECOGNIZED = -1, } export function initiatorTypeFromJSON(object: any): InitiatorType { switch (object) { case 0: case "INITIATOR_TYPE_Unknown": return InitiatorType.INITIATOR_TYPE_Unknown; case 1: case "User": return InitiatorType.User; case 2: case "Agent": return InitiatorType.Agent; case 3: case "INITIATOR_TYPE_System": return InitiatorType.INITIATOR_TYPE_System; case -1: case "UNRECOGNIZED": default: return InitiatorType.UNRECOGNIZED; } } export function initiatorTypeToJSON(object: InitiatorType): string { switch (object) { case InitiatorType.INITIATOR_TYPE_Unknown: return "INITIATOR_TYPE_Unknown"; case InitiatorType.User: return "User"; case InitiatorType.Agent: return "Agent"; case InitiatorType.INITIATOR_TYPE_System: return "INITIATOR_TYPE_System"; case InitiatorType.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ReopenStreamScopeError { REOPEN_STREAM_SCOPE_ERROR_None = 0, NotCompleted = 1, ClosedByEvent = 2, UNRECOGNIZED = -1, } export function reopenStreamScopeErrorFromJSON(object: any): ReopenStreamScopeError { switch (object) { case 0: case "REOPEN_STREAM_SCOPE_ERROR_None": return ReopenStreamScopeError.REOPEN_STREAM_SCOPE_ERROR_None; case 1: case "NotCompleted": return ReopenStreamScopeError.NotCompleted; case 2: case "ClosedByEvent": return ReopenStreamScopeError.ClosedByEvent; case -1: case "UNRECOGNIZED": default: return ReopenStreamScopeError.UNRECOGNIZED; } } export function reopenStreamScopeErrorToJSON(object: ReopenStreamScopeError): string { switch (object) { case ReopenStreamScopeError.REOPEN_STREAM_SCOPE_ERROR_None: return "REOPEN_STREAM_SCOPE_ERROR_None"; case ReopenStreamScopeError.NotCompleted: return "NotCompleted"; case ReopenStreamScopeError.ClosedByEvent: return "ClosedByEvent"; case ReopenStreamScopeError.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[]; EffectReceipt: EffectReceipt | undefined; } export interface AppendManyForEventSourcesWithNamedTagsRequest { EventStore: string; Namespace: string; EventSequenceId: string; Events: EventForEventSourceIdWithNamedTags[]; CorrelationId: Guid | undefined; Tags: string[]; Causation: Causation[]; CausedBy: Identity | undefined; ConcurrencyScopes: EventSourceConcurrencyScope[]; EffectReceipt: EffectReceipt | undefined; } 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; EffectReceipt: EffectReceipt | 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[]; EffectReceipt: EffectReceiptDetails | undefined; EffectAlreadyRecorded: boolean; } export interface AppendManyWithNamedTagsRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; Events: EventToAppendWithNamedTags[]; CorrelationId: Guid | undefined; Tags: string[]; Occurred: SerializableDateTimeOffset | undefined; Causation: Causation[]; CausedBy: Identity | undefined; ConcurrencyScope: ConcurrencyScope | undefined; EffectReceipt: EffectReceipt | undefined; } 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; EventSource: string; EffectReceipt: EffectReceipt | 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; EffectReceipt: EffectReceiptDetails | undefined; EffectAlreadyRecorded: boolean; } export interface AppendWithNamedTagsRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; EventType: EventType | undefined; Content: string; NamedTags: NamedTag[]; CorrelationId: Guid | undefined; Tags: string[]; Occurred: SerializableDateTimeOffset | undefined; Subject: string; Causation: Causation[]; CausedBy: Identity | undefined; ConcurrencyScope: ConcurrencyScope | undefined; EventSource: string; EffectReceipt: EffectReceipt | undefined; } export interface AppendedEventResponse { Id: string; Context: EventContext | undefined; Content: string; OriginalContent: string; Revisions: EventRevision[]; GenerationalContent: KeyValuePairInt32String[]; RevisedGeneration: number; } 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 ClosedStreamResponse { EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; Origin: ClosedStreamOrigin; ClosedBy: string; SequenceNumber: bigint; ClosedAt: SerializableDateTimeOffset | undefined; } export interface ClosedStreamsRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: 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 CommandResultReopenStreamScopeResponse { /** 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: ReopenStreamScopeResponse | undefined; } export interface CommandResultVerifyContentResponse { /** 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: VerifyContentResponse | 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 CompleteStreamScopeRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; ExpectedTailSequenceNumber: bigint; } 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; ConflictingEventTypeId: string; ConflictingSequenceNumber: 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 EffectReceipt { OccurrenceId: string; EffectKey: string; Epoch: bigint; Response: string; } export interface EffectReceiptDetails { Id: string; OccurrenceId: string; Epoch: bigint; Outcome: EffectOutcome; EventSequenceId: string; FirstSequenceNumber: bigint; LastSequenceNumber: bigint; Reasons: string[]; Response: string; RecordedAt: SerializableDateTimeOffset | undefined; } 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; NamedTags: NamedTag[]; EventSource: string; } export interface EventForEventSourceId { EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; EventType: EventType | undefined; Content: string; Tags: string[]; Occurred: SerializableDateTimeOffset | undefined; Subject: string; Causation: Causation[]; EventSource: string; } export interface EventForEventSourceIdWithNamedTags { EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; EventType: EventType | undefined; Content: string; Tags: string[]; NamedTags: NamedTag[]; Occurred: SerializableDateTimeOffset | undefined; Subject: string; Causation: Causation[]; EventSource: string; } export interface EventMetadataResponse { SequenceNumber: bigint; EventTypeId: string; EventSourceType: string; EventSourceId: string; EventStreamType: string; EventStreamId: string; Occurred: | SerializableDateTimeOffset | undefined; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; Causation: Causation[]; CausedBy: ResolvedIdentity | undefined; InitiatorType: InitiatorType; Tags: string[]; Subject: string; EventSourceName: 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 EventToAppendWithNamedTags { EventType: EventType | undefined; Content: string; NamedTags: NamedTag[]; 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; NamedTags: NamedTag[]; } 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 IsStreamScopeCompletedRequest { EventStore: string; Namespace: string; EventSequenceId: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; } export interface KeyValuePairInt32String { Key: number; Value: string; } export interface MetadataAtRequest { EventStore: string; Namespace: string; EventSequenceId: string; SequenceNumbers: bigint[]; } export interface NamedTag { Name: string; Value: string; } export interface NamedTagQueryCriterion { Name: string; Values: string[]; AnyValue: boolean; } 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 QueryEventsWithNamedTagsRequest { EventStore: string; Namespace: string; EventSequenceId: string; NamedTags: NamedTagQueryCriterion[]; 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 QueryResultIEnumerableClosedStreamResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: ClosedStreamResponse[]; } export interface QueryResultIEnumerableEventMetadataResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: EventMetadataResponse[]; } 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 QueryResultStreamScopeCompletionResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: StreamScopeCompletionResponse | 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 ReopenStreamScopeRequest { EventStore: string; Namespace: string; EventSequenceId: string; Reason: string; EventSourceId: string; EventSourceType: string; EventStreamType: string; EventStreamId: string; Causation: Causation[]; CausedBy: Identity | undefined; } export interface ReopenStreamScopeResponse { IsSuccess: boolean; Error: ReopenStreamScopeError; } export interface ResolvedIdentity { Subject: string; Name: string; UserName: string; Resolution: IdentityResolution; OnBehalfOf: ResolvedIdentity | 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; } export interface SequenceHistogramWithNamedTagsRequest { EventStore: string; Namespace: string; EventSequenceId: string; NamedTags: NamedTagQueryCriterion[]; 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 StreamScopeCompletionResponse { IsCompleted: boolean; } 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[]; } export interface VerifyContentRequest { EventStore: string; Namespace: string; EventSequenceId: string; SequenceNumber: bigint; EventType: EventType | undefined; Content: string; EventSourceId: string; } export interface VerifyContentResponse { Result: ContentVerificationResult; } 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: [], EffectReceipt: undefined, }; } 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(); } if (message.EffectReceipt !== undefined) { EffectReceipt.encode(message.EffectReceipt, writer.uint32(82).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; } case 10: { if (tag !== 82) { break; } message.EffectReceipt = EffectReceipt.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)) : [], EffectReceipt: isSet(object.EffectReceipt) ? EffectReceipt.fromJSON(object.EffectReceipt) : undefined, }; }, 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)); } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceipt.toJSON(message.EffectReceipt); } 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)) || []; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceipt.fromPartial(object.EffectReceipt) : undefined; return message; }, }; function createBaseAppendManyForEventSourcesWithNamedTagsRequest(): AppendManyForEventSourcesWithNamedTagsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", Events: [], CorrelationId: undefined, Tags: [], Causation: [], CausedBy: undefined, ConcurrencyScopes: [], EffectReceipt: undefined, }; } export const AppendManyForEventSourcesWithNamedTagsRequest: MessageFns = { encode( message: AppendManyForEventSourcesWithNamedTagsRequest, 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) { EventForEventSourceIdWithNamedTags.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(); } if (message.EffectReceipt !== undefined) { EffectReceipt.encode(message.EffectReceipt, writer.uint32(82).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendManyForEventSourcesWithNamedTagsRequest { 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 = createBaseAppendManyForEventSourcesWithNamedTagsRequest(); 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(EventForEventSourceIdWithNamedTags.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; } case 10: { if (tag !== 82) { break; } message.EffectReceipt = EffectReceipt.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): AppendManyForEventSourcesWithNamedTagsRequest { 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) => EventForEventSourceIdWithNamedTags.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)) : [], EffectReceipt: isSet(object.EffectReceipt) ? EffectReceipt.fromJSON(object.EffectReceipt) : undefined, }; }, toJSON(message: AppendManyForEventSourcesWithNamedTagsRequest): 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) => EventForEventSourceIdWithNamedTags.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)); } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceipt.toJSON(message.EffectReceipt); } return obj; }, create( base?: DeepPartial, ): AppendManyForEventSourcesWithNamedTagsRequest { return AppendManyForEventSourcesWithNamedTagsRequest.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): AppendManyForEventSourcesWithNamedTagsRequest { const message = createBaseAppendManyForEventSourcesWithNamedTagsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.Events = object.Events?.map((e) => EventForEventSourceIdWithNamedTags.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)) || []; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceipt.fromPartial(object.EffectReceipt) : undefined; return message; }, }; function createBaseAppendManyRequest(): AppendManyRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", Events: [], CorrelationId: undefined, Tags: [], Causation: [], CausedBy: undefined, ConcurrencyScope: undefined, Occurred: undefined, EffectReceipt: 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(); } if (message.EffectReceipt !== undefined) { EffectReceipt.encode(message.EffectReceipt, writer.uint32(98).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; } case 12: { if (tag !== 98) { break; } message.EffectReceipt = EffectReceipt.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, EffectReceipt: isSet(object.EffectReceipt) ? EffectReceipt.fromJSON(object.EffectReceipt) : 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); } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceipt.toJSON(message.EffectReceipt); } 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; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceipt.fromPartial(object.EffectReceipt) : undefined; return message; }, }; function createBaseAppendManyResponse(): AppendManyResponse { return { CorrelationId: undefined, SequenceNumbers: [], IsSuccess: false, HasConstraintViolations: false, HasConcurrencyViolations: false, HasErrors: false, ConcurrencyCheckPerformed: false, ConstraintViolations: [], Errors: [], ConcurrencyViolations: [], EffectReceipt: undefined, EffectAlreadyRecorded: false, }; } 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(); } if (message.EffectReceipt !== undefined) { EffectReceiptDetails.encode(message.EffectReceipt, writer.uint32(90).fork()).join(); } if (message.EffectAlreadyRecorded !== false) { writer.uint32(96).bool(message.EffectAlreadyRecorded); } 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; } case 11: { if (tag !== 90) { break; } message.EffectReceipt = EffectReceiptDetails.decode(reader, reader.uint32()); continue; } case 12: { if (tag !== 96) { break; } message.EffectAlreadyRecorded = 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): 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)) : [], EffectReceipt: isSet(object.EffectReceipt) ? EffectReceiptDetails.fromJSON(object.EffectReceipt) : undefined, EffectAlreadyRecorded: isSet(object.EffectAlreadyRecorded) ? globalThis.Boolean(object.EffectAlreadyRecorded) : false, }; }, 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)); } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceiptDetails.toJSON(message.EffectReceipt); } if (message.EffectAlreadyRecorded !== false) { obj.EffectAlreadyRecorded = message.EffectAlreadyRecorded; } 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)) || []; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceiptDetails.fromPartial(object.EffectReceipt) : undefined; message.EffectAlreadyRecorded = object.EffectAlreadyRecorded ?? false; return message; }, }; function createBaseAppendManyWithNamedTagsRequest(): AppendManyWithNamedTagsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", Events: [], CorrelationId: undefined, Tags: [], Occurred: undefined, Causation: [], CausedBy: undefined, ConcurrencyScope: undefined, EffectReceipt: undefined, }; } export const AppendManyWithNamedTagsRequest: MessageFns = { encode(message: AppendManyWithNamedTagsRequest, 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) { EventToAppendWithNamedTags.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!); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, 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(); } if (message.ConcurrencyScope !== undefined) { ConcurrencyScope.encode(message.ConcurrencyScope, writer.uint32(90).fork()).join(); } if (message.EffectReceipt !== undefined) { EffectReceipt.encode(message.EffectReceipt, writer.uint32(98).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendManyWithNamedTagsRequest { 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 = createBaseAppendManyWithNamedTagsRequest(); 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(EventToAppendWithNamedTags.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.Occurred = SerializableDateTimeOffset.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.ConcurrencyScope = ConcurrencyScope.decode(reader, reader.uint32()); continue; } case 12: { if (tag !== 98) { break; } message.EffectReceipt = EffectReceipt.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): AppendManyWithNamedTagsRequest { 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) => EventToAppendWithNamedTags.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)) : [], Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, 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, EffectReceipt: isSet(object.EffectReceipt) ? EffectReceipt.fromJSON(object.EffectReceipt) : undefined, }; }, toJSON(message: AppendManyWithNamedTagsRequest): 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) => EventToAppendWithNamedTags.toJSON(e)); } 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.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.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceipt.toJSON(message.EffectReceipt); } return obj; }, create(base?: DeepPartial): AppendManyWithNamedTagsRequest { return AppendManyWithNamedTagsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendManyWithNamedTagsRequest { const message = createBaseAppendManyWithNamedTagsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.Events = object.Events?.map((e) => EventToAppendWithNamedTags.fromPartial(e)) || []; 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.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.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceipt.fromPartial(object.EffectReceipt) : undefined; 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, EventSource: "", EffectReceipt: 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(); } if (message.EventSource !== "") { writer.uint32(138).string(message.EventSource); } if (message.EffectReceipt !== undefined) { EffectReceipt.encode(message.EffectReceipt, writer.uint32(146).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; } case 17: { if (tag !== 138) { break; } message.EventSource = reader.string(); continue; } case 18: { if (tag !== 146) { break; } message.EffectReceipt = EffectReceipt.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, EventSource: isSet(object.EventSource) ? globalThis.String(object.EventSource) : "", EffectReceipt: isSet(object.EffectReceipt) ? EffectReceipt.fromJSON(object.EffectReceipt) : 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); } if (message.EventSource !== "") { obj.EventSource = message.EventSource; } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceipt.toJSON(message.EffectReceipt); } 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; message.EventSource = object.EventSource ?? ""; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceipt.fromPartial(object.EffectReceipt) : 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, EffectReceipt: undefined, EffectAlreadyRecorded: false, }; } 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(); } if (message.EffectReceipt !== undefined) { EffectReceiptDetails.encode(message.EffectReceipt, writer.uint32(90).fork()).join(); } if (message.EffectAlreadyRecorded !== false) { writer.uint32(96).bool(message.EffectAlreadyRecorded); } 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; } case 11: { if (tag !== 90) { break; } message.EffectReceipt = EffectReceiptDetails.decode(reader, reader.uint32()); continue; } case 12: { if (tag !== 96) { break; } message.EffectAlreadyRecorded = 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): 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, EffectReceipt: isSet(object.EffectReceipt) ? EffectReceiptDetails.fromJSON(object.EffectReceipt) : undefined, EffectAlreadyRecorded: isSet(object.EffectAlreadyRecorded) ? globalThis.Boolean(object.EffectAlreadyRecorded) : false, }; }, 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); } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceiptDetails.toJSON(message.EffectReceipt); } if (message.EffectAlreadyRecorded !== false) { obj.EffectAlreadyRecorded = message.EffectAlreadyRecorded; } 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; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceiptDetails.fromPartial(object.EffectReceipt) : undefined; message.EffectAlreadyRecorded = object.EffectAlreadyRecorded ?? false; return message; }, }; function createBaseAppendWithNamedTagsRequest(): AppendWithNamedTagsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", EventType: undefined, Content: "", NamedTags: [], CorrelationId: undefined, Tags: [], Occurred: undefined, Subject: "", Causation: [], CausedBy: undefined, ConcurrencyScope: undefined, EventSource: "", EffectReceipt: undefined, }; } export const AppendWithNamedTagsRequest: MessageFns = { encode(message: AppendWithNamedTagsRequest, 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); } for (const v of message.NamedTags) { NamedTag.encode(v!, writer.uint32(82).fork()).join(); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(90).fork()).join(); } for (const v of message.Tags) { writer.uint32(98).string(v!); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(106).fork()).join(); } if (message.Subject !== "") { writer.uint32(114).string(message.Subject); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(122).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(130).fork()).join(); } if (message.ConcurrencyScope !== undefined) { ConcurrencyScope.encode(message.ConcurrencyScope, writer.uint32(138).fork()).join(); } if (message.EventSource !== "") { writer.uint32(146).string(message.EventSource); } if (message.EffectReceipt !== undefined) { EffectReceipt.encode(message.EffectReceipt, writer.uint32(154).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AppendWithNamedTagsRequest { 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 = createBaseAppendWithNamedTagsRequest(); 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.NamedTags.push(NamedTag.decode(reader, reader.uint32())); continue; } case 11: { if (tag !== 90) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 12: { if (tag !== 98) { break; } message.Tags.push(reader.string()); continue; } case 13: { if (tag !== 106) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 14: { if (tag !== 114) { break; } message.Subject = reader.string(); continue; } case 15: { if (tag !== 122) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 16: { if (tag !== 130) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 17: { if (tag !== 138) { break; } message.ConcurrencyScope = ConcurrencyScope.decode(reader, reader.uint32()); continue; } case 18: { if (tag !== 146) { break; } message.EventSource = reader.string(); continue; } case 19: { if (tag !== 154) { break; } message.EffectReceipt = EffectReceipt.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): AppendWithNamedTagsRequest { 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) : "", NamedTags: globalThis.Array.isArray(object?.NamedTags) ? object.NamedTags.map((e: any) => NamedTag.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)) : [], 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, EventSource: isSet(object.EventSource) ? globalThis.String(object.EventSource) : "", EffectReceipt: isSet(object.EffectReceipt) ? EffectReceipt.fromJSON(object.EffectReceipt) : undefined, }; }, toJSON(message: AppendWithNamedTagsRequest): 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.NamedTags?.length) { obj.NamedTags = message.NamedTags.map((e) => NamedTag.toJSON(e)); } 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); } if (message.EventSource !== "") { obj.EventSource = message.EventSource; } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceipt.toJSON(message.EffectReceipt); } return obj; }, create(base?: DeepPartial): AppendWithNamedTagsRequest { return AppendWithNamedTagsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AppendWithNamedTagsRequest { const message = createBaseAppendWithNamedTagsRequest(); 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.NamedTags = object.NamedTags?.map((e) => NamedTag.fromPartial(e)) || []; 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; message.EventSource = object.EventSource ?? ""; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceipt.fromPartial(object.EffectReceipt) : undefined; return message; }, }; function createBaseAppendedEventResponse(): AppendedEventResponse { return { Id: "", Context: undefined, Content: "", OriginalContent: "", Revisions: [], GenerationalContent: [], RevisedGeneration: 0, }; } 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(); } if (message.RevisedGeneration !== 0) { writer.uint32(56).uint32(message.RevisedGeneration); } 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; } case 7: { if (tag !== 56) { break; } message.RevisedGeneration = 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)) : [], RevisedGeneration: isSet(object.RevisedGeneration) ? globalThis.Number(object.RevisedGeneration) : 0, }; }, 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)); } if (message.RevisedGeneration !== 0) { obj.RevisedGeneration = Math.round(message.RevisedGeneration); } 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)) || []; message.RevisedGeneration = object.RevisedGeneration ?? 0; 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 createBaseClosedStreamResponse(): ClosedStreamResponse { return { EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", Origin: 0, ClosedBy: "", SequenceNumber: 0n, ClosedAt: undefined, }; } export const ClosedStreamResponse: MessageFns = { encode(message: ClosedStreamResponse, 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.Origin !== 0) { writer.uint32(40).int32(message.Origin); } if (message.ClosedBy !== "") { writer.uint32(50).string(message.ClosedBy); } 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(56).uint64(message.SequenceNumber); } if (message.ClosedAt !== undefined) { SerializableDateTimeOffset.encode(message.ClosedAt, writer.uint32(66).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ClosedStreamResponse { 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 = createBaseClosedStreamResponse(); 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 !== 40) { break; } message.Origin = reader.int32() as any; continue; } case 6: { if (tag !== 50) { break; } message.ClosedBy = reader.string(); continue; } case 7: { if (tag !== 56) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 8: { if (tag !== 66) { break; } message.ClosedAt = 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): ClosedStreamResponse { 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) : "", Origin: isSet(object.Origin) ? closedStreamOriginFromJSON(object.Origin) : 0, ClosedBy: isSet(object.ClosedBy) ? globalThis.String(object.ClosedBy) : "", SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, ClosedAt: isSet(object.ClosedAt) ? SerializableDateTimeOffset.fromJSON(object.ClosedAt) : undefined, }; }, toJSON(message: ClosedStreamResponse): 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.Origin !== 0) { obj.Origin = closedStreamOriginToJSON(message.Origin); } if (message.ClosedBy !== "") { obj.ClosedBy = message.ClosedBy; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.ClosedAt !== undefined) { obj.ClosedAt = SerializableDateTimeOffset.toJSON(message.ClosedAt); } return obj; }, create(base?: DeepPartial): ClosedStreamResponse { return ClosedStreamResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ClosedStreamResponse { const message = createBaseClosedStreamResponse(); message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.Origin = object.Origin ?? 0; message.ClosedBy = object.ClosedBy ?? ""; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.ClosedAt = (object.ClosedAt !== undefined && object.ClosedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.ClosedAt) : undefined; return message; }, }; function createBaseClosedStreamsRequest(): ClosedStreamsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", }; } export const ClosedStreamsRequest: MessageFns = { encode(message: ClosedStreamsRequest, 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); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ClosedStreamsRequest { 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 = createBaseClosedStreamsRequest(); 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; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ClosedStreamsRequest { 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) : "", }; }, toJSON(message: ClosedStreamsRequest): 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; } return obj; }, create(base?: DeepPartial): ClosedStreamsRequest { return ClosedStreamsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ClosedStreamsRequest { const message = createBaseClosedStreamsRequest(); 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 ?? ""; 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 createBaseCommandResultReopenStreamScopeResponse(): CommandResultReopenStreamScopeResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultReopenStreamScopeResponse: MessageFns = { encode(message: CommandResultReopenStreamScopeResponse, 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) { ReopenStreamScopeResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultReopenStreamScopeResponse { 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 = createBaseCommandResultReopenStreamScopeResponse(); 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 = ReopenStreamScopeResponse.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): CommandResultReopenStreamScopeResponse { 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) ? ReopenStreamScopeResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultReopenStreamScopeResponse): 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 = ReopenStreamScopeResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultReopenStreamScopeResponse { return CommandResultReopenStreamScopeResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultReopenStreamScopeResponse { const message = createBaseCommandResultReopenStreamScopeResponse(); 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) ? ReopenStreamScopeResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultVerifyContentResponse(): CommandResultVerifyContentResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultVerifyContentResponse: MessageFns = { encode(message: CommandResultVerifyContentResponse, 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) { VerifyContentResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultVerifyContentResponse { 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 = createBaseCommandResultVerifyContentResponse(); 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 = VerifyContentResponse.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): CommandResultVerifyContentResponse { 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) ? VerifyContentResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultVerifyContentResponse): 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 = VerifyContentResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultVerifyContentResponse { return CommandResultVerifyContentResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultVerifyContentResponse { const message = createBaseCommandResultVerifyContentResponse(); 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) ? VerifyContentResponse.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 createBaseCompleteStreamScopeRequest(): CompleteStreamScopeRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", ExpectedTailSequenceNumber: 0n, }; } export const CompleteStreamScopeRequest: MessageFns = { encode(message: CompleteStreamScopeRequest, 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.ExpectedTailSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.ExpectedTailSequenceNumber) !== message.ExpectedTailSequenceNumber) { throw new globalThis.Error( "value provided for field message.ExpectedTailSequenceNumber of type uint64 too large", ); } writer.uint32(64).uint64(message.ExpectedTailSequenceNumber); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CompleteStreamScopeRequest { 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 = createBaseCompleteStreamScopeRequest(); 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 !== 64) { break; } message.ExpectedTailSequenceNumber = 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): CompleteStreamScopeRequest { 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) : "", ExpectedTailSequenceNumber: isSet(object.ExpectedTailSequenceNumber) ? BigInt(object.ExpectedTailSequenceNumber) : 0n, }; }, toJSON(message: CompleteStreamScopeRequest): 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.ExpectedTailSequenceNumber !== 0n) { obj.ExpectedTailSequenceNumber = message.ExpectedTailSequenceNumber.toString(); } return obj; }, create(base?: DeepPartial): CompleteStreamScopeRequest { return CompleteStreamScopeRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CompleteStreamScopeRequest { const message = createBaseCompleteStreamScopeRequest(); 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.ExpectedTailSequenceNumber = (object.ExpectedTailSequenceNumber !== undefined && object.ExpectedTailSequenceNumber !== null) ? BigInt(object.ExpectedTailSequenceNumber) : 0n; 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, ConflictingEventTypeId: "", ConflictingSequenceNumber: 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); } if (message.ConflictingEventTypeId !== "") { writer.uint32(34).string(message.ConflictingEventTypeId); } if (message.ConflictingSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.ConflictingSequenceNumber) !== message.ConflictingSequenceNumber) { throw new globalThis.Error( "value provided for field message.ConflictingSequenceNumber of type uint64 too large", ); } writer.uint32(40).uint64(message.ConflictingSequenceNumber); } 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; } case 4: { if (tag !== 34) { break; } message.ConflictingEventTypeId = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.ConflictingSequenceNumber = 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, ConflictingEventTypeId: isSet(object.ConflictingEventTypeId) ? globalThis.String(object.ConflictingEventTypeId) : "", ConflictingSequenceNumber: isSet(object.ConflictingSequenceNumber) ? BigInt(object.ConflictingSequenceNumber) : 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(); } if (message.ConflictingEventTypeId !== "") { obj.ConflictingEventTypeId = message.ConflictingEventTypeId; } if (message.ConflictingSequenceNumber !== 0n) { obj.ConflictingSequenceNumber = message.ConflictingSequenceNumber.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; message.ConflictingEventTypeId = object.ConflictingEventTypeId ?? ""; message.ConflictingSequenceNumber = (object.ConflictingSequenceNumber !== undefined && object.ConflictingSequenceNumber !== null) ? BigInt(object.ConflictingSequenceNumber) : 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 createBaseEffectReceipt(): EffectReceipt { return { OccurrenceId: "", EffectKey: "", Epoch: 0n, Response: "" }; } export const EffectReceipt: MessageFns = { encode(message: EffectReceipt, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.OccurrenceId !== "") { writer.uint32(10).string(message.OccurrenceId); } if (message.EffectKey !== "") { writer.uint32(18).string(message.EffectKey); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(24).int64(message.Epoch); } if (message.Response !== "") { writer.uint32(34).string(message.Response); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EffectReceipt { 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 = createBaseEffectReceipt(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.OccurrenceId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.EffectKey = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Epoch = reader.int64() as bigint; continue; } case 4: { if (tag !== 34) { break; } message.Response = 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): EffectReceipt { return { OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", EffectKey: isSet(object.EffectKey) ? globalThis.String(object.EffectKey) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, Response: isSet(object.Response) ? globalThis.String(object.Response) : "", }; }, toJSON(message: EffectReceipt): unknown { const obj: any = {}; if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.EffectKey !== "") { obj.EffectKey = message.EffectKey; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.Response !== "") { obj.Response = message.Response; } return obj; }, create(base?: DeepPartial): EffectReceipt { return EffectReceipt.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EffectReceipt { const message = createBaseEffectReceipt(); message.OccurrenceId = object.OccurrenceId ?? ""; message.EffectKey = object.EffectKey ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.Response = object.Response ?? ""; return message; }, }; function createBaseEffectReceiptDetails(): EffectReceiptDetails { return { Id: "", OccurrenceId: "", Epoch: 0n, Outcome: 0, EventSequenceId: "", FirstSequenceNumber: 0n, LastSequenceNumber: 0n, Reasons: [], Response: "", RecordedAt: undefined, }; } export const EffectReceiptDetails: MessageFns = { encode(message: EffectReceiptDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.OccurrenceId !== "") { writer.uint32(18).string(message.OccurrenceId); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(24).int64(message.Epoch); } if (message.Outcome !== 0) { writer.uint32(32).int32(message.Outcome); } if (message.EventSequenceId !== "") { writer.uint32(42).string(message.EventSequenceId); } if (message.FirstSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.FirstSequenceNumber) !== message.FirstSequenceNumber) { throw new globalThis.Error("value provided for field message.FirstSequenceNumber of type uint64 too large"); } writer.uint32(48).uint64(message.FirstSequenceNumber); } if (message.LastSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.LastSequenceNumber) !== message.LastSequenceNumber) { throw new globalThis.Error("value provided for field message.LastSequenceNumber of type uint64 too large"); } writer.uint32(56).uint64(message.LastSequenceNumber); } for (const v of message.Reasons) { writer.uint32(66).string(v!); } if (message.Response !== "") { writer.uint32(74).string(message.Response); } if (message.RecordedAt !== undefined) { SerializableDateTimeOffset.encode(message.RecordedAt, writer.uint32(82).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EffectReceiptDetails { 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 = createBaseEffectReceiptDetails(); 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.OccurrenceId = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Epoch = reader.int64() as bigint; continue; } case 4: { if (tag !== 32) { break; } message.Outcome = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.EventSequenceId = reader.string(); continue; } case 6: { if (tag !== 48) { break; } message.FirstSequenceNumber = reader.uint64() as bigint; continue; } case 7: { if (tag !== 56) { break; } message.LastSequenceNumber = reader.uint64() as bigint; continue; } case 8: { if (tag !== 66) { break; } message.Reasons.push(reader.string()); continue; } case 9: { if (tag !== 74) { break; } message.Response = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.RecordedAt = 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): EffectReceiptDetails { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, Outcome: isSet(object.Outcome) ? effectOutcomeFromJSON(object.Outcome) : 0, EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", FirstSequenceNumber: isSet(object.FirstSequenceNumber) ? BigInt(object.FirstSequenceNumber) : 0n, LastSequenceNumber: isSet(object.LastSequenceNumber) ? BigInt(object.LastSequenceNumber) : 0n, Reasons: globalThis.Array.isArray(object?.Reasons) ? object.Reasons.map((e: any) => globalThis.String(e)) : [], Response: isSet(object.Response) ? globalThis.String(object.Response) : "", RecordedAt: isSet(object.RecordedAt) ? SerializableDateTimeOffset.fromJSON(object.RecordedAt) : undefined, }; }, toJSON(message: EffectReceiptDetails): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.Outcome !== 0) { obj.Outcome = effectOutcomeToJSON(message.Outcome); } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.FirstSequenceNumber !== 0n) { obj.FirstSequenceNumber = message.FirstSequenceNumber.toString(); } if (message.LastSequenceNumber !== 0n) { obj.LastSequenceNumber = message.LastSequenceNumber.toString(); } if (message.Reasons?.length) { obj.Reasons = message.Reasons; } if (message.Response !== "") { obj.Response = message.Response; } if (message.RecordedAt !== undefined) { obj.RecordedAt = SerializableDateTimeOffset.toJSON(message.RecordedAt); } return obj; }, create(base?: DeepPartial): EffectReceiptDetails { return EffectReceiptDetails.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EffectReceiptDetails { const message = createBaseEffectReceiptDetails(); message.Id = object.Id ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.Outcome = object.Outcome ?? 0; message.EventSequenceId = object.EventSequenceId ?? ""; message.FirstSequenceNumber = (object.FirstSequenceNumber !== undefined && object.FirstSequenceNumber !== null) ? BigInt(object.FirstSequenceNumber) : 0n; message.LastSequenceNumber = (object.LastSequenceNumber !== undefined && object.LastSequenceNumber !== null) ? BigInt(object.LastSequenceNumber) : 0n; message.Reasons = object.Reasons?.map((e) => e) || []; message.Response = object.Response ?? ""; message.RecordedAt = (object.RecordedAt !== undefined && object.RecordedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.RecordedAt) : undefined; 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: "", NamedTags: [], EventSource: "", }; } 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); } for (const v of message.NamedTags) { NamedTag.encode(v!, writer.uint32(122).fork()).join(); } if (message.EventSource !== "") { writer.uint32(130).string(message.EventSource); } 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; } case 15: { if (tag !== 122) { break; } message.NamedTags.push(NamedTag.decode(reader, reader.uint32())); continue; } case 16: { if (tag !== 130) { break; } message.EventSource = 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) : "", NamedTags: globalThis.Array.isArray(object?.NamedTags) ? object.NamedTags.map((e: any) => NamedTag.fromJSON(e)) : [], EventSource: isSet(object.EventSource) ? globalThis.String(object.EventSource) : "", }; }, 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; } if (message.NamedTags?.length) { obj.NamedTags = message.NamedTags.map((e) => NamedTag.toJSON(e)); } if (message.EventSource !== "") { obj.EventSource = message.EventSource; } 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 ?? ""; message.NamedTags = object.NamedTags?.map((e) => NamedTag.fromPartial(e)) || []; message.EventSource = object.EventSource ?? ""; return message; }, }; function createBaseEventForEventSourceId(): EventForEventSourceId { return { EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", EventType: undefined, Content: "", Tags: [], Occurred: undefined, Subject: "", Causation: [], EventSource: "", }; } 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); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(82).fork()).join(); } if (message.EventSource !== "") { writer.uint32(90).string(message.EventSource); } 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; } case 10: { if (tag !== 82) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 11: { if (tag !== 90) { break; } message.EventSource = 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) : "", Causation: globalThis.Array.isArray(object?.Causation) ? object.Causation.map((e: any) => Causation.fromJSON(e)) : [], EventSource: isSet(object.EventSource) ? globalThis.String(object.EventSource) : "", }; }, 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; } if (message.Causation?.length) { obj.Causation = message.Causation.map((e) => Causation.toJSON(e)); } if (message.EventSource !== "") { obj.EventSource = message.EventSource; } 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 ?? ""; message.Causation = object.Causation?.map((e) => Causation.fromPartial(e)) || []; message.EventSource = object.EventSource ?? ""; return message; }, }; function createBaseEventForEventSourceIdWithNamedTags(): EventForEventSourceIdWithNamedTags { return { EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", EventType: undefined, Content: "", Tags: [], NamedTags: [], Occurred: undefined, Subject: "", Causation: [], EventSource: "", }; } export const EventForEventSourceIdWithNamedTags: MessageFns = { encode(message: EventForEventSourceIdWithNamedTags, 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!); } for (const v of message.NamedTags) { NamedTag.encode(v!, writer.uint32(66).fork()).join(); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(74).fork()).join(); } if (message.Subject !== "") { writer.uint32(82).string(message.Subject); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(90).fork()).join(); } if (message.EventSource !== "") { writer.uint32(98).string(message.EventSource); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventForEventSourceIdWithNamedTags { 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 = createBaseEventForEventSourceIdWithNamedTags(); 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.NamedTags.push(NamedTag.decode(reader, reader.uint32())); continue; } case 9: { if (tag !== 74) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 10: { if (tag !== 82) { break; } message.Subject = reader.string(); continue; } case 11: { if (tag !== 90) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 12: { if (tag !== 98) { break; } message.EventSource = 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): EventForEventSourceIdWithNamedTags { 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)) : [], NamedTags: globalThis.Array.isArray(object?.NamedTags) ? object.NamedTags.map((e: any) => NamedTag.fromJSON(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)) : [], EventSource: isSet(object.EventSource) ? globalThis.String(object.EventSource) : "", }; }, toJSON(message: EventForEventSourceIdWithNamedTags): 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.NamedTags?.length) { obj.NamedTags = message.NamedTags.map((e) => NamedTag.toJSON(e)); } 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.EventSource !== "") { obj.EventSource = message.EventSource; } return obj; }, create(base?: DeepPartial): EventForEventSourceIdWithNamedTags { return EventForEventSourceIdWithNamedTags.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventForEventSourceIdWithNamedTags { const message = createBaseEventForEventSourceIdWithNamedTags(); 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.NamedTags = object.NamedTags?.map((e) => NamedTag.fromPartial(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.EventSource = object.EventSource ?? ""; return message; }, }; function createBaseEventMetadataResponse(): EventMetadataResponse { return { SequenceNumber: 0n, EventTypeId: "", EventSourceType: "", EventSourceId: "", EventStreamType: "", EventStreamId: "", Occurred: undefined, CorrelationId: undefined, Causation: [], CausedBy: undefined, InitiatorType: 0, Tags: [], Subject: "", EventSourceName: "", }; } export const EventMetadataResponse: MessageFns = { encode(message: EventMetadataResponse, 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.EventTypeId !== "") { writer.uint32(18).string(message.EventTypeId); } 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.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) { ResolvedIdentity.encode(message.CausedBy, writer.uint32(82).fork()).join(); } if (message.InitiatorType !== 0) { writer.uint32(88).int32(message.InitiatorType); } for (const v of message.Tags) { writer.uint32(98).string(v!); } if (message.Subject !== "") { writer.uint32(106).string(message.Subject); } if (message.EventSourceName !== "") { writer.uint32(114).string(message.EventSourceName); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventMetadataResponse { 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 = createBaseEventMetadataResponse(); 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.EventTypeId = 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.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 = ResolvedIdentity.decode(reader, reader.uint32()); continue; } case 11: { if (tag !== 88) { break; } message.InitiatorType = reader.int32() as any; continue; } case 12: { if (tag !== 98) { break; } message.Tags.push(reader.string()); continue; } case 13: { if (tag !== 106) { break; } message.Subject = reader.string(); continue; } case 14: { if (tag !== 114) { break; } message.EventSourceName = 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): EventMetadataResponse { return { SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, EventTypeId: isSet(object.EventTypeId) ? globalThis.String(object.EventTypeId) : "", EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", 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) ? ResolvedIdentity.fromJSON(object.CausedBy) : undefined, InitiatorType: isSet(object.InitiatorType) ? initiatorTypeFromJSON(object.InitiatorType) : 0, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", EventSourceName: isSet(object.EventSourceName) ? globalThis.String(object.EventSourceName) : "", }; }, toJSON(message: EventMetadataResponse): unknown { const obj: any = {}; if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.EventTypeId !== "") { obj.EventTypeId = message.EventTypeId; } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } 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 = ResolvedIdentity.toJSON(message.CausedBy); } if (message.InitiatorType !== 0) { obj.InitiatorType = initiatorTypeToJSON(message.InitiatorType); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Subject !== "") { obj.Subject = message.Subject; } if (message.EventSourceName !== "") { obj.EventSourceName = message.EventSourceName; } return obj; }, create(base?: DeepPartial): EventMetadataResponse { return EventMetadataResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventMetadataResponse { const message = createBaseEventMetadataResponse(); message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.EventTypeId = object.EventTypeId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventSourceId = object.EventSourceId ?? ""; 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) ? ResolvedIdentity.fromPartial(object.CausedBy) : undefined; message.InitiatorType = object.InitiatorType ?? 0; message.Tags = object.Tags?.map((e) => e) || []; message.Subject = object.Subject ?? ""; message.EventSourceName = object.EventSourceName ?? ""; 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 createBaseEventToAppendWithNamedTags(): EventToAppendWithNamedTags { return { EventType: undefined, Content: "", NamedTags: [], Subject: "" }; } export const EventToAppendWithNamedTags: MessageFns = { encode(message: EventToAppendWithNamedTags, 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); } for (const v of message.NamedTags) { NamedTag.encode(v!, writer.uint32(26).fork()).join(); } if (message.Subject !== "") { writer.uint32(34).string(message.Subject); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventToAppendWithNamedTags { 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 = createBaseEventToAppendWithNamedTags(); 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.NamedTags.push(NamedTag.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { 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): EventToAppendWithNamedTags { return { EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", NamedTags: globalThis.Array.isArray(object?.NamedTags) ? object.NamedTags.map((e: any) => NamedTag.fromJSON(e)) : [], Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", }; }, toJSON(message: EventToAppendWithNamedTags): unknown { const obj: any = {}; if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.Content !== "") { obj.Content = message.Content; } if (message.NamedTags?.length) { obj.NamedTags = message.NamedTags.map((e) => NamedTag.toJSON(e)); } if (message.Subject !== "") { obj.Subject = message.Subject; } return obj; }, create(base?: DeepPartial): EventToAppendWithNamedTags { return EventToAppendWithNamedTags.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventToAppendWithNamedTags { const message = createBaseEventToAppendWithNamedTags(); message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.Content = object.Content ?? ""; message.NamedTags = object.NamedTags?.map((e) => NamedTag.fromPartial(e)) || []; 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: "", NamedTags: [], }; } 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); } for (const v of message.NamedTags) { NamedTag.encode(v!, writer.uint32(82).fork()).join(); } 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; } case 10: { if (tag !== 82) { break; } message.NamedTags.push(NamedTag.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): 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) : "", NamedTags: globalThis.Array.isArray(object?.NamedTags) ? object.NamedTags.map((e: any) => NamedTag.fromJSON(e)) : [], }; }, 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; } if (message.NamedTags?.length) { obj.NamedTags = message.NamedTags.map((e) => NamedTag.toJSON(e)); } 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 ?? ""; message.NamedTags = object.NamedTags?.map((e) => NamedTag.fromPartial(e)) || []; 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 createBaseIsStreamScopeCompletedRequest(): IsStreamScopeCompletedRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", }; } export const IsStreamScopeCompletedRequest: MessageFns = { encode(message: IsStreamScopeCompletedRequest, 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); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): IsStreamScopeCompletedRequest { 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 = createBaseIsStreamScopeCompletedRequest(); 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; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): IsStreamScopeCompletedRequest { 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) : "", }; }, toJSON(message: IsStreamScopeCompletedRequest): 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; } return obj; }, create(base?: DeepPartial): IsStreamScopeCompletedRequest { return IsStreamScopeCompletedRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): IsStreamScopeCompletedRequest { const message = createBaseIsStreamScopeCompletedRequest(); 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 ?? ""; 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 createBaseMetadataAtRequest(): MetadataAtRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", SequenceNumbers: [] }; } export const MetadataAtRequest: MessageFns = { encode(message: MetadataAtRequest, 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.SequenceNumbers) { if (BigInt.asUintN(64, v!) !== v!) { throw new globalThis.Error("value provided for field v! of type uint64 too large"); } writer.uint32(32).uint64(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): MetadataAtRequest { 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 = createBaseMetadataAtRequest(); 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) { message.SequenceNumbers.push(reader.uint64() as bigint); continue; } if (tag === 34) { const end2 = reader.uint32() + reader.pos; while (reader.pos < end2) { message.SequenceNumbers.push(reader.uint64() as bigint); } continue; } break; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): MetadataAtRequest { 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) : "", SequenceNumbers: globalThis.Array.isArray(object?.SequenceNumbers) ? object.SequenceNumbers.map((e: any) => BigInt(e)) : [], }; }, toJSON(message: MetadataAtRequest): 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.SequenceNumbers?.length) { obj.SequenceNumbers = message.SequenceNumbers.map((e) => e.toString()); } return obj; }, create(base?: DeepPartial): MetadataAtRequest { return MetadataAtRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): MetadataAtRequest { const message = createBaseMetadataAtRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.SequenceNumbers = object.SequenceNumbers?.map((e) => BigInt(e)) || []; return message; }, }; function createBaseNamedTag(): NamedTag { return { Name: "", Value: "" }; } export const NamedTag: MessageFns = { encode(message: NamedTag, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Name !== "") { writer.uint32(10).string(message.Name); } if (message.Value !== "") { writer.uint32(18).string(message.Value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): NamedTag { 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 = createBaseNamedTag(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Name = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Value = 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): NamedTag { return { Name: isSet(object.Name) ? globalThis.String(object.Name) : "", Value: isSet(object.Value) ? globalThis.String(object.Value) : "", }; }, toJSON(message: NamedTag): unknown { const obj: any = {}; if (message.Name !== "") { obj.Name = message.Name; } if (message.Value !== "") { obj.Value = message.Value; } return obj; }, create(base?: DeepPartial): NamedTag { return NamedTag.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): NamedTag { const message = createBaseNamedTag(); message.Name = object.Name ?? ""; message.Value = object.Value ?? ""; return message; }, }; function createBaseNamedTagQueryCriterion(): NamedTagQueryCriterion { return { Name: "", Values: [], AnyValue: false }; } export const NamedTagQueryCriterion: MessageFns = { encode(message: NamedTagQueryCriterion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Name !== "") { writer.uint32(10).string(message.Name); } for (const v of message.Values) { writer.uint32(18).string(v!); } if (message.AnyValue !== false) { writer.uint32(24).bool(message.AnyValue); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): NamedTagQueryCriterion { 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 = createBaseNamedTagQueryCriterion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Name = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Values.push(reader.string()); continue; } case 3: { if (tag !== 24) { break; } message.AnyValue = 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): NamedTagQueryCriterion { return { Name: isSet(object.Name) ? globalThis.String(object.Name) : "", Values: globalThis.Array.isArray(object?.Values) ? object.Values.map((e: any) => globalThis.String(e)) : [], AnyValue: isSet(object.AnyValue) ? globalThis.Boolean(object.AnyValue) : false, }; }, toJSON(message: NamedTagQueryCriterion): unknown { const obj: any = {}; if (message.Name !== "") { obj.Name = message.Name; } if (message.Values?.length) { obj.Values = message.Values; } if (message.AnyValue !== false) { obj.AnyValue = message.AnyValue; } return obj; }, create(base?: DeepPartial): NamedTagQueryCriterion { return NamedTagQueryCriterion.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): NamedTagQueryCriterion { const message = createBaseNamedTagQueryCriterion(); message.Name = object.Name ?? ""; message.Values = object.Values?.map((e) => e) || []; message.AnyValue = object.AnyValue ?? false; 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 createBaseQueryEventsWithNamedTagsRequest(): QueryEventsWithNamedTagsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", NamedTags: [], EventSourceId: "", EventSourceType: "", EventStreamType: "", CorrelationId: "", EventTypeIds: "", Tags: "", OccurredFrom: undefined, OccurredTo: undefined, }; } export const QueryEventsWithNamedTagsRequest: MessageFns = { encode(message: QueryEventsWithNamedTagsRequest, 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.NamedTags) { NamedTagQueryCriterion.encode(v!, writer.uint32(34).fork()).join(); } 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): QueryEventsWithNamedTagsRequest { 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 = createBaseQueryEventsWithNamedTagsRequest(); 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.NamedTags.push(NamedTagQueryCriterion.decode(reader, reader.uint32())); 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): QueryEventsWithNamedTagsRequest { 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) : "", NamedTags: globalThis.Array.isArray(object?.NamedTags) ? object.NamedTags.map((e: any) => NamedTagQueryCriterion.fromJSON(e)) : [], 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: QueryEventsWithNamedTagsRequest): 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.NamedTags?.length) { obj.NamedTags = message.NamedTags.map((e) => NamedTagQueryCriterion.toJSON(e)); } 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): QueryEventsWithNamedTagsRequest { return QueryEventsWithNamedTagsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryEventsWithNamedTagsRequest { const message = createBaseQueryEventsWithNamedTagsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.NamedTags = object.NamedTags?.map((e) => NamedTagQueryCriterion.fromPartial(e)) || []; 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 createBaseQueryResultIEnumerableClosedStreamResponse(): QueryResultIEnumerableClosedStreamResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableClosedStreamResponse: MessageFns = { encode(message: QueryResultIEnumerableClosedStreamResponse, 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) { ClosedStreamResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableClosedStreamResponse { 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 = createBaseQueryResultIEnumerableClosedStreamResponse(); 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(ClosedStreamResponse.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): QueryResultIEnumerableClosedStreamResponse { 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) => ClosedStreamResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableClosedStreamResponse): 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) => ClosedStreamResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableClosedStreamResponse { return QueryResultIEnumerableClosedStreamResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableClosedStreamResponse { const message = createBaseQueryResultIEnumerableClosedStreamResponse(); 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) => ClosedStreamResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultIEnumerableEventMetadataResponse(): QueryResultIEnumerableEventMetadataResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableEventMetadataResponse: MessageFns = { encode( message: QueryResultIEnumerableEventMetadataResponse, 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) { EventMetadataResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableEventMetadataResponse { 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 = createBaseQueryResultIEnumerableEventMetadataResponse(); 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(EventMetadataResponse.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): QueryResultIEnumerableEventMetadataResponse { 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) => EventMetadataResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableEventMetadataResponse): 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) => EventMetadataResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableEventMetadataResponse { return QueryResultIEnumerableEventMetadataResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableEventMetadataResponse { const message = createBaseQueryResultIEnumerableEventMetadataResponse(); 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) => EventMetadataResponse.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 createBaseQueryResultStreamScopeCompletionResponse(): QueryResultStreamScopeCompletionResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultStreamScopeCompletionResponse: MessageFns = { encode(message: QueryResultStreamScopeCompletionResponse, 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) { StreamScopeCompletionResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultStreamScopeCompletionResponse { 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 = createBaseQueryResultStreamScopeCompletionResponse(); 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 = StreamScopeCompletionResponse.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): QueryResultStreamScopeCompletionResponse { 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) ? StreamScopeCompletionResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultStreamScopeCompletionResponse): 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 = StreamScopeCompletionResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultStreamScopeCompletionResponse { return QueryResultStreamScopeCompletionResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultStreamScopeCompletionResponse { const message = createBaseQueryResultStreamScopeCompletionResponse(); 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) ? StreamScopeCompletionResponse.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 createBaseReopenStreamScopeRequest(): ReopenStreamScopeRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", Reason: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", EventStreamId: "", Causation: [], CausedBy: undefined, }; } export const ReopenStreamScopeRequest: MessageFns = { encode(message: ReopenStreamScopeRequest, 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.Reason !== "") { writer.uint32(34).string(message.Reason); } 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.EventStreamId !== "") { writer.uint32(66).string(message.EventStreamId); } 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(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ReopenStreamScopeRequest { 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 = createBaseReopenStreamScopeRequest(); 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.Reason = 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.EventStreamId = reader.string(); 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; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ReopenStreamScopeRequest { 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) : "", Reason: isSet(object.Reason) ? globalThis.String(object.Reason) : "", 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) : "", 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: ReopenStreamScopeRequest): 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.Reason !== "") { obj.Reason = message.Reason; } 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.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): ReopenStreamScopeRequest { return ReopenStreamScopeRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ReopenStreamScopeRequest { const message = createBaseReopenStreamScopeRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.Reason = object.Reason ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.EventSourceType = object.EventSourceType ?? ""; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; 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 createBaseReopenStreamScopeResponse(): ReopenStreamScopeResponse { return { IsSuccess: false, Error: 0 }; } export const ReopenStreamScopeResponse: MessageFns = { encode(message: ReopenStreamScopeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.IsSuccess !== false) { writer.uint32(8).bool(message.IsSuccess); } if (message.Error !== 0) { writer.uint32(16).int32(message.Error); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ReopenStreamScopeResponse { 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 = createBaseReopenStreamScopeResponse(); 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.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): ReopenStreamScopeResponse { return { IsSuccess: isSet(object.IsSuccess) ? globalThis.Boolean(object.IsSuccess) : false, Error: isSet(object.Error) ? reopenStreamScopeErrorFromJSON(object.Error) : 0, }; }, toJSON(message: ReopenStreamScopeResponse): unknown { const obj: any = {}; if (message.IsSuccess !== false) { obj.IsSuccess = message.IsSuccess; } if (message.Error !== 0) { obj.Error = reopenStreamScopeErrorToJSON(message.Error); } return obj; }, create(base?: DeepPartial): ReopenStreamScopeResponse { return ReopenStreamScopeResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ReopenStreamScopeResponse { const message = createBaseReopenStreamScopeResponse(); message.IsSuccess = object.IsSuccess ?? false; message.Error = object.Error ?? 0; return message; }, }; function createBaseResolvedIdentity(): ResolvedIdentity { return { Subject: "", Name: "", UserName: "", Resolution: 0, OnBehalfOf: undefined }; } export const ResolvedIdentity: MessageFns = { encode(message: ResolvedIdentity, 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.Resolution !== 0) { writer.uint32(32).int32(message.Resolution); } if (message.OnBehalfOf !== undefined) { ResolvedIdentity.encode(message.OnBehalfOf, writer.uint32(42).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResolvedIdentity { 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 = createBaseResolvedIdentity(); 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 !== 32) { break; } message.Resolution = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.OnBehalfOf = ResolvedIdentity.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): ResolvedIdentity { 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) : "", Resolution: isSet(object.Resolution) ? identityResolutionFromJSON(object.Resolution) : 0, OnBehalfOf: isSet(object.OnBehalfOf) ? ResolvedIdentity.fromJSON(object.OnBehalfOf) : undefined, }; }, toJSON(message: ResolvedIdentity): 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.Resolution !== 0) { obj.Resolution = identityResolutionToJSON(message.Resolution); } if (message.OnBehalfOf !== undefined) { obj.OnBehalfOf = ResolvedIdentity.toJSON(message.OnBehalfOf); } return obj; }, create(base?: DeepPartial): ResolvedIdentity { return ResolvedIdentity.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ResolvedIdentity { const message = createBaseResolvedIdentity(); message.Subject = object.Subject ?? ""; message.Name = object.Name ?? ""; message.UserName = object.UserName ?? ""; message.Resolution = object.Resolution ?? 0; message.OnBehalfOf = (object.OnBehalfOf !== undefined && object.OnBehalfOf !== null) ? ResolvedIdentity.fromPartial(object.OnBehalfOf) : 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 createBaseSequenceHistogramWithNamedTagsRequest(): SequenceHistogramWithNamedTagsRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", NamedTags: [], Resolution: "", EventSourceId: "", EventSourceType: "", EventStreamType: "", CorrelationId: "", EventTypeIds: "", Tags: "", OccurredFrom: undefined, OccurredTo: undefined, }; } export const SequenceHistogramWithNamedTagsRequest: MessageFns = { encode(message: SequenceHistogramWithNamedTagsRequest, 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.NamedTags) { NamedTagQueryCriterion.encode(v!, writer.uint32(34).fork()).join(); } if (message.Resolution !== "") { writer.uint32(42).string(message.Resolution); } if (message.EventSourceId !== "") { writer.uint32(50).string(message.EventSourceId); } if (message.EventSourceType !== "") { writer.uint32(58).string(message.EventSourceType); } if (message.EventStreamType !== "") { writer.uint32(66).string(message.EventStreamType); } if (message.CorrelationId !== "") { writer.uint32(74).string(message.CorrelationId); } if (message.EventTypeIds !== "") { writer.uint32(82).string(message.EventTypeIds); } if (message.Tags !== "") { writer.uint32(90).string(message.Tags); } if (message.OccurredFrom !== undefined) { SerializableDateTimeOffset.encode(message.OccurredFrom, writer.uint32(98).fork()).join(); } if (message.OccurredTo !== undefined) { SerializableDateTimeOffset.encode(message.OccurredTo, writer.uint32(106).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SequenceHistogramWithNamedTagsRequest { 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 = createBaseSequenceHistogramWithNamedTagsRequest(); 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.NamedTags.push(NamedTagQueryCriterion.decode(reader, reader.uint32())); continue; } case 5: { if (tag !== 42) { break; } message.Resolution = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventSourceId = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.EventSourceType = reader.string(); continue; } case 8: { if (tag !== 66) { break; } message.EventStreamType = reader.string(); continue; } case 9: { if (tag !== 74) { break; } message.CorrelationId = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.EventTypeIds = reader.string(); continue; } case 11: { if (tag !== 90) { break; } message.Tags = reader.string(); continue; } case 12: { if (tag !== 98) { break; } message.OccurredFrom = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 13: { if (tag !== 106) { 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): SequenceHistogramWithNamedTagsRequest { 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) : "", NamedTags: globalThis.Array.isArray(object?.NamedTags) ? object.NamedTags.map((e: any) => NamedTagQueryCriterion.fromJSON(e)) : [], 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: SequenceHistogramWithNamedTagsRequest): 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.NamedTags?.length) { obj.NamedTags = message.NamedTags.map((e) => NamedTagQueryCriterion.toJSON(e)); } 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): SequenceHistogramWithNamedTagsRequest { return SequenceHistogramWithNamedTagsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SequenceHistogramWithNamedTagsRequest { const message = createBaseSequenceHistogramWithNamedTagsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.NamedTags = object.NamedTags?.map((e) => NamedTagQueryCriterion.fromPartial(e)) || []; 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 createBaseStreamScopeCompletionResponse(): StreamScopeCompletionResponse { return { IsCompleted: false }; } export const StreamScopeCompletionResponse: MessageFns = { encode(message: StreamScopeCompletionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.IsCompleted !== false) { writer.uint32(8).bool(message.IsCompleted); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): StreamScopeCompletionResponse { 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 = createBaseStreamScopeCompletionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.IsCompleted = 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): StreamScopeCompletionResponse { return { IsCompleted: isSet(object.IsCompleted) ? globalThis.Boolean(object.IsCompleted) : false }; }, toJSON(message: StreamScopeCompletionResponse): unknown { const obj: any = {}; if (message.IsCompleted !== false) { obj.IsCompleted = message.IsCompleted; } return obj; }, create(base?: DeepPartial): StreamScopeCompletionResponse { return StreamScopeCompletionResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): StreamScopeCompletionResponse { const message = createBaseStreamScopeCompletionResponse(); message.IsCompleted = object.IsCompleted ?? false; 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; }, }; function createBaseVerifyContentRequest(): VerifyContentRequest { return { EventStore: "", Namespace: "", EventSequenceId: "", SequenceNumber: 0n, EventType: undefined, Content: "", EventSourceId: "", }; } export const VerifyContentRequest: MessageFns = { encode(message: VerifyContentRequest, 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); } if (message.EventSourceId !== "") { writer.uint32(58).string(message.EventSourceId); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): VerifyContentRequest { 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 = createBaseVerifyContentRequest(); 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.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): VerifyContentRequest { 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) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", }; }, toJSON(message: VerifyContentRequest): 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.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } return obj; }, create(base?: DeepPartial): VerifyContentRequest { return VerifyContentRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): VerifyContentRequest { const message = createBaseVerifyContentRequest(); 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.EventSourceId = object.EventSourceId ?? ""; return message; }, }; function createBaseVerifyContentResponse(): VerifyContentResponse { return { Result: 0 }; } export const VerifyContentResponse: MessageFns = { encode(message: VerifyContentResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Result !== 0) { writer.uint32(8).int32(message.Result); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): VerifyContentResponse { 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 = createBaseVerifyContentResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Result = 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): VerifyContentResponse { return { Result: isSet(object.Result) ? contentVerificationResultFromJSON(object.Result) : 0 }; }, toJSON(message: VerifyContentResponse): unknown { const obj: any = {}; if (message.Result !== 0) { obj.Result = contentVerificationResultToJSON(message.Result); } return obj; }, create(base?: DeepPartial): VerifyContentResponse { return VerifyContentResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): VerifyContentResponse { const message = createBaseVerifyContentResponse(); message.Result = object.Result ?? 0; 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: {}, }, appendManyForEventSourcesWithNamedTags: { name: "AppendManyForEventSourcesWithNamedTags", requestType: AppendManyForEventSourcesWithNamedTagsRequest as typeof AppendManyForEventSourcesWithNamedTagsRequest, requestStream: false, responseType: CommandResultAppendManyResponse as typeof CommandResultAppendManyResponse, responseStream: false, options: {}, }, appendManyWithNamedTags: { name: "AppendManyWithNamedTags", requestType: AppendManyWithNamedTagsRequest as typeof AppendManyWithNamedTagsRequest, requestStream: false, responseType: CommandResultAppendManyResponse as typeof CommandResultAppendManyResponse, responseStream: false, options: {}, }, appendWithNamedTags: { name: "AppendWithNamedTags", requestType: AppendWithNamedTagsRequest as typeof AppendWithNamedTagsRequest, requestStream: false, responseType: CommandResultAppendResponse as typeof CommandResultAppendResponse, responseStream: false, options: {}, }, closedStreams: { name: "ClosedStreams", requestType: ClosedStreamsRequest as typeof ClosedStreamsRequest, requestStream: false, responseType: QueryResultIEnumerableClosedStreamResponse as typeof QueryResultIEnumerableClosedStreamResponse, responseStream: false, options: {}, }, completeStream: { name: "CompleteStream", requestType: CompleteStreamRequest as typeof CompleteStreamRequest, requestStream: false, responseType: CommandResultCompleteStreamResponse as typeof CommandResultCompleteStreamResponse, responseStream: false, options: {}, }, completeStreamScope: { name: "CompleteStreamScope", requestType: CompleteStreamScopeRequest as typeof CompleteStreamScopeRequest, 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: {}, }, isStreamScopeCompleted: { name: "IsStreamScopeCompleted", requestType: IsStreamScopeCompletedRequest as typeof IsStreamScopeCompletedRequest, requestStream: false, responseType: QueryResultStreamScopeCompletionResponse as typeof QueryResultStreamScopeCompletionResponse, responseStream: false, options: {}, }, metadataAt: { name: "MetadataAt", requestType: MetadataAtRequest as typeof MetadataAtRequest, requestStream: false, responseType: QueryResultIEnumerableEventMetadataResponse as typeof QueryResultIEnumerableEventMetadataResponse, 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: {}, }, queryEventsWithNamedTags: { name: "QueryEventsWithNamedTags", requestType: QueryEventsWithNamedTagsRequest as typeof QueryEventsWithNamedTagsRequest, 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: {}, }, reopenStreamScope: { name: "ReopenStreamScope", requestType: ReopenStreamScopeRequest as typeof ReopenStreamScopeRequest, requestStream: false, responseType: CommandResultReopenStreamScopeResponse as typeof CommandResultReopenStreamScopeResponse, 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: {}, }, sequenceHistogramWithNamedTags: { name: "SequenceHistogramWithNamedTags", requestType: SequenceHistogramWithNamedTagsRequest as typeof SequenceHistogramWithNamedTagsRequest, 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: {}, }, verifyContent: { name: "VerifyContent", requestType: VerifyContentRequest as typeof VerifyContentRequest, requestStream: false, responseType: CommandResultVerifyContentResponse as typeof CommandResultVerifyContentResponse, 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>; appendManyForEventSourcesWithNamedTags( request: AppendManyForEventSourcesWithNamedTagsRequest, context: CallContext & CallContextExt, ): Promise>; appendManyWithNamedTags( request: AppendManyWithNamedTagsRequest, context: CallContext & CallContextExt, ): Promise>; appendWithNamedTags( request: AppendWithNamedTagsRequest, context: CallContext & CallContextExt, ): Promise>; closedStreams( request: ClosedStreamsRequest, context: CallContext & CallContextExt, ): Promise>; completeStream( request: CompleteStreamRequest, context: CallContext & CallContextExt, ): Promise>; completeStreamScope( request: CompleteStreamScopeRequest, 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>; isStreamScopeCompleted( request: IsStreamScopeCompletedRequest, context: CallContext & CallContextExt, ): Promise>; metadataAt( request: MetadataAtRequest, context: CallContext & CallContextExt, ): Promise>; parseResolution( request: ParseResolutionRequest, context: CallContext & CallContextExt, ): Promise>; queryEvents( request: QueryEventsRequest, context: CallContext & CallContextExt, ): Promise>; queryEventsWithNamedTags( request: QueryEventsWithNamedTagsRequest, context: CallContext & CallContextExt, ): Promise>; redact(request: RedactRequest, context: CallContext & CallContextExt): Promise>; redactForEventSource( request: RedactForEventSourceRequest, context: CallContext & CallContextExt, ): Promise>; reopenStreamScope( request: ReopenStreamScopeRequest, context: CallContext & CallContextExt, ): Promise>; revise(request: ReviseRequest, context: CallContext & CallContextExt): Promise>; sequenceHistogram( request: SequenceHistogramRequest, context: CallContext & CallContextExt, ): Promise>; sequenceHistogramWithNamedTags( request: SequenceHistogramWithNamedTagsRequest, context: CallContext & CallContextExt, ): Promise>; tailSequenceNumber( request: TailSequenceNumberRequest, context: CallContext & CallContextExt, ): Promise>; verifyContent( request: VerifyContentRequest, 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; appendManyForEventSourcesWithNamedTags( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; appendManyWithNamedTags( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; appendWithNamedTags( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; closedStreams( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; completeStream( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; completeStreamScope( 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; isStreamScopeCompleted( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; metadataAt( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; parseResolution( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; queryEvents( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; queryEventsWithNamedTags( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; redact(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; redactForEventSource( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; reopenStreamScope( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; revise(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; sequenceHistogram( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; sequenceHistogramWithNamedTags( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; tailSequenceNumber( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; verifyContent( 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; }