// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: captures.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.Captures"; export enum CaptureStatus { Stopped = 0, Started = 1, UNRECOGNIZED = -1, } export function captureStatusFromJSON(object: any): CaptureStatus { switch (object) { case 0: case "Stopped": return CaptureStatus.Stopped; case 1: case "Started": return CaptureStatus.Started; case -1: case "UNRECOGNIZED": default: return CaptureStatus.UNRECOGNIZED; } } export function captureStatusToJSON(object: CaptureStatus): string { switch (object) { case CaptureStatus.Stopped: return "Stopped"; case CaptureStatus.Started: return "Started"; case CaptureStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum EventObservationState { None = 0, Initial = 1, Replay = 2, UNRECOGNIZED = -1, } export function eventObservationStateFromJSON(object: any): EventObservationState { switch (object) { case 0: case "None": return EventObservationState.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.None: return "None"; case EventObservationState.Initial: return "Initial"; case EventObservationState.Replay: return "Replay"; case EventObservationState.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ValidationResultSeverity { Unknown = 0, Information = 1, Warning = 2, Error = 3, UNRECOGNIZED = -1, } export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity { switch (object) { case 0: case "Unknown": return ValidationResultSeverity.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.Unknown: return "Unknown"; case ValidationResultSeverity.Information: return "Information"; case ValidationResultSeverity.Warning: return "Warning"; case ValidationResultSeverity.Error: return "Error"; case ValidationResultSeverity.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface CaptureDetailsResponse { Id: string; Name: string; Declaration: string; Status: CaptureStatus; } export interface CaptureValidationMessage { Message: string; Line: number; Column: number; } export interface CapturedEventResponse { Context: EventContext | undefined; Content: string; Id: string; } export interface CapturedEventsRequest { EventStore: string; CaptureName: string; Namespace: string; MaxEvents: number; } export interface Causation { Occurred: SerializableDateTimeOffset | undefined; Type: string; Properties: { [key: string]: string }; } export interface Causation_PropertiesEntry { key: string; value: string; } export interface CommandResult { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; } export interface CommandResultSaveCaptureResponse { /** 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: SaveCaptureResponse | undefined; } export interface CommandResultStartCaptureResponse { /** 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: StartCaptureResponse | undefined; } export interface CommandResultValidateCaptureDeclarationResponse { /** 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: ValidateCaptureDeclarationResponse | undefined; } export interface DeleteCaptureRequest { EventStore: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CaptureId: Guid | undefined; } export interface EventContext { EventType: EventType | undefined; EventSourceType: string; EventSourceId: string; SequenceNumber: bigint; EventStreamType: string; EventStreamId: string; Occurred: SerializableDateTimeOffset | undefined; EventStore: string; Namespace: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; Causation: Causation[]; CausedBy: Identity | undefined; ObservationState: EventObservationState; Tags: string[]; Hash: string; Subject: string; } export interface EventType { Id: string; Generation: number; Tombstone: boolean; } export interface GetCapturesRequest { EventStore: string; } export interface Identity { Subject: string; Name: string; UserName: string; OnBehalfOf: Identity | undefined; } export interface ObserveCapturesRequest { EventStore: string; } export interface QueryResultIEnumerableCaptureDetailsResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: CaptureDetailsResponse[]; } export interface QueryResultIEnumerableCapturedEventResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: CapturedEventResponse[]; } export interface SaveCaptureRequest { EventStore: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; Declaration: string; } export interface SaveCaptureResponse { Capture: CaptureDetailsResponse | undefined; Messages: CaptureValidationMessage[]; } /** 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 StartCaptureRequest { EventStore: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CaptureId: Guid | undefined; } export interface StartCaptureResponse { Messages: CaptureValidationMessage[]; } export interface StopCaptureRequest { EventStore: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CaptureId: Guid | undefined; } export interface ValidateCaptureDeclarationRequest { EventStore: string; Declaration: string; } export interface ValidateCaptureDeclarationResponse { Messages: CaptureValidationMessage[]; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseCaptureDetailsResponse(): CaptureDetailsResponse { return { Id: "", Name: "", Declaration: "", Status: 0 }; } export const CaptureDetailsResponse: MessageFns = { encode(message: CaptureDetailsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Name !== "") { writer.uint32(18).string(message.Name); } if (message.Declaration !== "") { writer.uint32(26).string(message.Declaration); } if (message.Status !== 0) { writer.uint32(32).int32(message.Status); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CaptureDetailsResponse { 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 = createBaseCaptureDetailsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Name = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Declaration = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.Status = 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): CaptureDetailsResponse { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Name: isSet(object.Name) ? globalThis.String(object.Name) : "", Declaration: isSet(object.Declaration) ? globalThis.String(object.Declaration) : "", Status: isSet(object.Status) ? captureStatusFromJSON(object.Status) : 0, }; }, toJSON(message: CaptureDetailsResponse): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Name !== "") { obj.Name = message.Name; } if (message.Declaration !== "") { obj.Declaration = message.Declaration; } if (message.Status !== 0) { obj.Status = captureStatusToJSON(message.Status); } return obj; }, create(base?: DeepPartial): CaptureDetailsResponse { return CaptureDetailsResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CaptureDetailsResponse { const message = createBaseCaptureDetailsResponse(); message.Id = object.Id ?? ""; message.Name = object.Name ?? ""; message.Declaration = object.Declaration ?? ""; message.Status = object.Status ?? 0; return message; }, }; function createBaseCaptureValidationMessage(): CaptureValidationMessage { return { Message: "", Line: 0, Column: 0 }; } export const CaptureValidationMessage: MessageFns = { encode(message: CaptureValidationMessage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Message !== "") { writer.uint32(10).string(message.Message); } if (message.Line !== 0) { writer.uint32(16).int32(message.Line); } if (message.Column !== 0) { writer.uint32(24).int32(message.Column); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CaptureValidationMessage { 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 = createBaseCaptureValidationMessage(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Message = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.Line = reader.int32(); continue; } case 3: { if (tag !== 24) { break; } message.Column = reader.int32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CaptureValidationMessage { return { Message: isSet(object.Message) ? globalThis.String(object.Message) : "", Line: isSet(object.Line) ? globalThis.Number(object.Line) : 0, Column: isSet(object.Column) ? globalThis.Number(object.Column) : 0, }; }, toJSON(message: CaptureValidationMessage): unknown { const obj: any = {}; if (message.Message !== "") { obj.Message = message.Message; } if (message.Line !== 0) { obj.Line = Math.round(message.Line); } if (message.Column !== 0) { obj.Column = Math.round(message.Column); } return obj; }, create(base?: DeepPartial): CaptureValidationMessage { return CaptureValidationMessage.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CaptureValidationMessage { const message = createBaseCaptureValidationMessage(); message.Message = object.Message ?? ""; message.Line = object.Line ?? 0; message.Column = object.Column ?? 0; return message; }, }; function createBaseCapturedEventResponse(): CapturedEventResponse { return { Context: undefined, Content: "", Id: "" }; } export const CapturedEventResponse: MessageFns = { encode(message: CapturedEventResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Context !== undefined) { EventContext.encode(message.Context, writer.uint32(10).fork()).join(); } if (message.Content !== "") { writer.uint32(18).string(message.Content); } if (message.Id !== "") { writer.uint32(26).string(message.Id); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CapturedEventResponse { 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 = createBaseCapturedEventResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Context = EventContext.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Content = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Id = 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): CapturedEventResponse { return { Context: isSet(object.Context) ? EventContext.fromJSON(object.Context) : undefined, Content: isSet(object.Content) ? globalThis.String(object.Content) : "", Id: isSet(object.Id) ? globalThis.String(object.Id) : "", }; }, toJSON(message: CapturedEventResponse): unknown { const obj: any = {}; if (message.Context !== undefined) { obj.Context = EventContext.toJSON(message.Context); } if (message.Content !== "") { obj.Content = message.Content; } if (message.Id !== "") { obj.Id = message.Id; } return obj; }, create(base?: DeepPartial): CapturedEventResponse { return CapturedEventResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CapturedEventResponse { const message = createBaseCapturedEventResponse(); message.Context = (object.Context !== undefined && object.Context !== null) ? EventContext.fromPartial(object.Context) : undefined; message.Content = object.Content ?? ""; message.Id = object.Id ?? ""; return message; }, }; function createBaseCapturedEventsRequest(): CapturedEventsRequest { return { EventStore: "", CaptureName: "", Namespace: "", MaxEvents: 0 }; } export const CapturedEventsRequest: MessageFns = { encode(message: CapturedEventsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.CaptureName !== "") { writer.uint32(18).string(message.CaptureName); } if (message.Namespace !== "") { writer.uint32(26).string(message.Namespace); } if (message.MaxEvents !== 0) { writer.uint32(32).int32(message.MaxEvents); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CapturedEventsRequest { 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 = createBaseCapturedEventsRequest(); 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.CaptureName = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Namespace = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.MaxEvents = reader.int32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CapturedEventsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", CaptureName: isSet(object.CaptureName) ? globalThis.String(object.CaptureName) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", MaxEvents: isSet(object.MaxEvents) ? globalThis.Number(object.MaxEvents) : 0, }; }, toJSON(message: CapturedEventsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.CaptureName !== "") { obj.CaptureName = message.CaptureName; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.MaxEvents !== 0) { obj.MaxEvents = Math.round(message.MaxEvents); } return obj; }, create(base?: DeepPartial): CapturedEventsRequest { return CapturedEventsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CapturedEventsRequest { const message = createBaseCapturedEventsRequest(); message.EventStore = object.EventStore ?? ""; message.CaptureName = object.CaptureName ?? ""; message.Namespace = object.Namespace ?? ""; message.MaxEvents = object.MaxEvents ?? 0; return message; }, }; function createBaseCausation(): Causation { return { Occurred: undefined, Type: "", Properties: {} }; } export const Causation: MessageFns = { encode(message: Causation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(10).fork()).join(); } if (message.Type !== "") { writer.uint32(18).string(message.Type); } globalThis.Object.entries(message.Properties).forEach(([key, value]: [string, string]) => { Causation_PropertiesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); }); return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Causation { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCausation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Type = reader.string(); continue; } case 3: { if (tag !== 26) { break; } const entry3 = Causation_PropertiesEntry.decode(reader, reader.uint32()); if (entry3.value !== undefined) { message.Properties[entry3.key] = entry3.value; } continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Causation { return { Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, Type: isSet(object.Type) ? globalThis.String(object.Type) : "", Properties: isObject(object.Properties) ? (globalThis.Object.entries(object.Properties) as [string, any][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, any]) => { globalThis.Object.defineProperty(acc, key, { value: globalThis.String(value), enumerable: true, configurable: true, writable: true, }); return acc; }, {}, ) : {}, }; }, toJSON(message: Causation): unknown { const obj: any = {}; if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.Type !== "") { obj.Type = message.Type; } if (message.Properties) { const entries = globalThis.Object.entries(message.Properties) as [string, string][]; if (entries.length > 0) { obj.Properties = {}; entries.forEach(([k, v]) => { obj.Properties[k] = v; }); } } return obj; }, create(base?: DeepPartial): Causation { return Causation.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Causation { const message = createBaseCausation(); message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.Type = object.Type ?? ""; message.Properties = (globalThis.Object.entries(object.Properties ?? {}) as [string, string][]).reduce( (acc: { [key: string]: string }, [key, value]: [string, string]) => { if (value !== undefined) { acc[key] = globalThis.String(value); } return acc; }, {}, ); return message; }, }; function createBaseCausation_PropertiesEntry(): Causation_PropertiesEntry { return { key: "", value: "" }; } export const Causation_PropertiesEntry: MessageFns = { encode(message: Causation_PropertiesEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.key !== "") { writer.uint32(10).string(message.key); } if (message.value !== "") { writer.uint32(18).string(message.value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): Causation_PropertiesEntry { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCausation_PropertiesEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.key = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): Causation_PropertiesEntry { return { key: isSet(object.key) ? globalThis.String(object.key) : "", value: isSet(object.value) ? globalThis.String(object.value) : "", }; }, toJSON(message: Causation_PropertiesEntry): unknown { const obj: any = {}; if (message.key !== "") { obj.key = message.key; } if (message.value !== "") { obj.value = message.value; } return obj; }, create(base?: DeepPartial): Causation_PropertiesEntry { return Causation_PropertiesEntry.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): Causation_PropertiesEntry { const message = createBaseCausation_PropertiesEntry(); message.key = object.key ?? ""; message.value = object.value ?? ""; return message; }, }; function createBaseCommandResult(): CommandResult { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", }; } export const CommandResult: MessageFns = { encode(message: CommandResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.AuthorizationFailureReason !== "") { writer.uint32(50).string(message.AuthorizationFailureReason); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommandResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.AuthorizationFailureReason = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CommandResult { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", AuthorizationFailureReason: isSet(object.AuthorizationFailureReason) ? globalThis.String(object.AuthorizationFailureReason) : "", }; }, toJSON(message: CommandResult): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.AuthorizationFailureReason !== "") { obj.AuthorizationFailureReason = message.AuthorizationFailureReason; } return obj; }, create(base?: DeepPartial): CommandResult { return CommandResult.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResult { const message = createBaseCommandResult(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? ""; return message; }, }; function createBaseCommandResultSaveCaptureResponse(): CommandResultSaveCaptureResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultSaveCaptureResponse: MessageFns = { encode(message: CommandResultSaveCaptureResponse, 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) { SaveCaptureResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultSaveCaptureResponse { 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 = createBaseCommandResultSaveCaptureResponse(); 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 = SaveCaptureResponse.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): CommandResultSaveCaptureResponse { 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) ? SaveCaptureResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultSaveCaptureResponse): 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 = SaveCaptureResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultSaveCaptureResponse { return CommandResultSaveCaptureResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultSaveCaptureResponse { const message = createBaseCommandResultSaveCaptureResponse(); 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) ? SaveCaptureResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultStartCaptureResponse(): CommandResultStartCaptureResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultStartCaptureResponse: MessageFns = { encode(message: CommandResultStartCaptureResponse, 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) { StartCaptureResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultStartCaptureResponse { 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 = createBaseCommandResultStartCaptureResponse(); 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 = StartCaptureResponse.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): CommandResultStartCaptureResponse { 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) ? StartCaptureResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultStartCaptureResponse): 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 = StartCaptureResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultStartCaptureResponse { return CommandResultStartCaptureResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultStartCaptureResponse { const message = createBaseCommandResultStartCaptureResponse(); 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) ? StartCaptureResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultValidateCaptureDeclarationResponse(): CommandResultValidateCaptureDeclarationResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultValidateCaptureDeclarationResponse: MessageFns< CommandResultValidateCaptureDeclarationResponse > = { encode( message: CommandResultValidateCaptureDeclarationResponse, 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) { ValidateCaptureDeclarationResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultValidateCaptureDeclarationResponse { 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 = createBaseCommandResultValidateCaptureDeclarationResponse(); 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 = ValidateCaptureDeclarationResponse.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): CommandResultValidateCaptureDeclarationResponse { 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) ? ValidateCaptureDeclarationResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultValidateCaptureDeclarationResponse): 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 = ValidateCaptureDeclarationResponse.toJSON(message.Response); } return obj; }, create( base?: DeepPartial, ): CommandResultValidateCaptureDeclarationResponse { return CommandResultValidateCaptureDeclarationResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): CommandResultValidateCaptureDeclarationResponse { const message = createBaseCommandResultValidateCaptureDeclarationResponse(); 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) ? ValidateCaptureDeclarationResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseDeleteCaptureRequest(): DeleteCaptureRequest { return { EventStore: "", CaptureId: undefined }; } export const DeleteCaptureRequest: MessageFns = { encode(message: DeleteCaptureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.CaptureId !== undefined) { Guid.encode(message.CaptureId, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DeleteCaptureRequest { 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 = createBaseDeleteCaptureRequest(); 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.CaptureId = Guid.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): DeleteCaptureRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", CaptureId: isSet(object.CaptureId) ? Guid.fromJSON(object.CaptureId) : undefined, }; }, toJSON(message: DeleteCaptureRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.CaptureId !== undefined) { obj.CaptureId = Guid.toJSON(message.CaptureId); } return obj; }, create(base?: DeepPartial): DeleteCaptureRequest { return DeleteCaptureRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): DeleteCaptureRequest { const message = createBaseDeleteCaptureRequest(); message.EventStore = object.EventStore ?? ""; message.CaptureId = (object.CaptureId !== undefined && object.CaptureId !== null) ? Guid.fromPartial(object.CaptureId) : undefined; return message; }, }; function createBaseEventContext(): EventContext { return { EventType: undefined, EventSourceType: "", EventSourceId: "", SequenceNumber: 0n, EventStreamType: "", EventStreamId: "", Occurred: undefined, EventStore: "", Namespace: "", CorrelationId: undefined, Causation: [], CausedBy: undefined, ObservationState: 0, Tags: [], Hash: "", Subject: "", }; } export const EventContext: MessageFns = { encode(message: EventContext, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventType !== undefined) { EventType.encode(message.EventType, writer.uint32(10).fork()).join(); } if (message.EventSourceType !== "") { writer.uint32(18).string(message.EventSourceType); } if (message.EventSourceId !== "") { writer.uint32(26).string(message.EventSourceId); } if (message.SequenceNumber !== 0n) { if (BigInt.asUintN(64, message.SequenceNumber) !== message.SequenceNumber) { throw new globalThis.Error("value provided for field message.SequenceNumber of type uint64 too large"); } writer.uint32(32).uint64(message.SequenceNumber); } if (message.EventStreamType !== "") { writer.uint32(42).string(message.EventStreamType); } if (message.EventStreamId !== "") { writer.uint32(50).string(message.EventStreamId); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(58).fork()).join(); } if (message.EventStore !== "") { writer.uint32(66).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(74).string(message.Namespace); } if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(82).fork()).join(); } for (const v of message.Causation) { Causation.encode(v!, writer.uint32(90).fork()).join(); } if (message.CausedBy !== undefined) { Identity.encode(message.CausedBy, writer.uint32(98).fork()).join(); } if (message.ObservationState !== 0) { writer.uint32(104).int32(message.ObservationState); } for (const v of message.Tags) { writer.uint32(114).string(v!); } if (message.Hash !== "") { writer.uint32(122).string(message.Hash); } if (message.Subject !== "") { writer.uint32(130).string(message.Subject); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EventContext { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEventContext(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventType = EventType.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.EventSourceType = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EventSourceId = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.SequenceNumber = reader.uint64() as bigint; continue; } case 5: { if (tag !== 42) { break; } message.EventStreamType = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.EventStreamId = reader.string(); continue; } case 7: { if (tag !== 58) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 8: { if (tag !== 66) { break; } message.EventStore = reader.string(); continue; } case 9: { if (tag !== 74) { break; } message.Namespace = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 11: { if (tag !== 90) { break; } message.Causation.push(Causation.decode(reader, reader.uint32())); continue; } case 12: { if (tag !== 98) { break; } message.CausedBy = Identity.decode(reader, reader.uint32()); continue; } case 13: { if (tag !== 104) { break; } message.ObservationState = reader.int32() as any; continue; } case 14: { if (tag !== 114) { break; } message.Tags.push(reader.string()); continue; } case 15: { if (tag !== 122) { break; } message.Hash = reader.string(); continue; } case 16: { if (tag !== 130) { break; } message.Subject = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EventContext { return { EventType: isSet(object.EventType) ? EventType.fromJSON(object.EventType) : undefined, EventSourceType: isSet(object.EventSourceType) ? globalThis.String(object.EventSourceType) : "", EventSourceId: isSet(object.EventSourceId) ? globalThis.String(object.EventSourceId) : "", SequenceNumber: isSet(object.SequenceNumber) ? BigInt(object.SequenceNumber) : 0n, EventStreamType: isSet(object.EventStreamType) ? globalThis.String(object.EventStreamType) : "", EventStreamId: isSet(object.EventStreamId) ? globalThis.String(object.EventStreamId) : "", Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", 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, ObservationState: isSet(object.ObservationState) ? eventObservationStateFromJSON(object.ObservationState) : 0, Tags: globalThis.Array.isArray(object?.Tags) ? object.Tags.map((e: any) => globalThis.String(e)) : [], Hash: isSet(object.Hash) ? globalThis.String(object.Hash) : "", Subject: isSet(object.Subject) ? globalThis.String(object.Subject) : "", }; }, toJSON(message: EventContext): unknown { const obj: any = {}; if (message.EventType !== undefined) { obj.EventType = EventType.toJSON(message.EventType); } if (message.EventSourceType !== "") { obj.EventSourceType = message.EventSourceType; } if (message.EventSourceId !== "") { obj.EventSourceId = message.EventSourceId; } if (message.SequenceNumber !== 0n) { obj.SequenceNumber = message.SequenceNumber.toString(); } if (message.EventStreamType !== "") { obj.EventStreamType = message.EventStreamType; } if (message.EventStreamId !== "") { obj.EventStreamId = message.EventStreamId; } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } 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.ObservationState !== 0) { obj.ObservationState = eventObservationStateToJSON(message.ObservationState); } if (message.Tags?.length) { obj.Tags = message.Tags; } if (message.Hash !== "") { obj.Hash = message.Hash; } if (message.Subject !== "") { obj.Subject = message.Subject; } return obj; }, create(base?: DeepPartial): EventContext { return EventContext.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EventContext { const message = createBaseEventContext(); message.EventType = (object.EventType !== undefined && object.EventType !== null) ? EventType.fromPartial(object.EventType) : undefined; message.EventSourceType = object.EventSourceType ?? ""; message.EventSourceId = object.EventSourceId ?? ""; message.SequenceNumber = (object.SequenceNumber !== undefined && object.SequenceNumber !== null) ? BigInt(object.SequenceNumber) : 0n; message.EventStreamType = object.EventStreamType ?? ""; message.EventStreamId = object.EventStreamId ?? ""; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; 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.ObservationState = object.ObservationState ?? 0; message.Tags = object.Tags?.map((e) => e) || []; message.Hash = object.Hash ?? ""; 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 createBaseGetCapturesRequest(): GetCapturesRequest { return { EventStore: "" }; } export const GetCapturesRequest: MessageFns = { encode(message: GetCapturesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetCapturesRequest { 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 = createBaseGetCapturesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = 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): GetCapturesRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "" }; }, toJSON(message: GetCapturesRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } return obj; }, create(base?: DeepPartial): GetCapturesRequest { return GetCapturesRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetCapturesRequest { const message = createBaseGetCapturesRequest(); message.EventStore = object.EventStore ?? ""; 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 createBaseObserveCapturesRequest(): ObserveCapturesRequest { return { EventStore: "" }; } export const ObserveCapturesRequest: MessageFns = { encode(message: ObserveCapturesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ObserveCapturesRequest { 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 = createBaseObserveCapturesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = 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): ObserveCapturesRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "" }; }, toJSON(message: ObserveCapturesRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } return obj; }, create(base?: DeepPartial): ObserveCapturesRequest { return ObserveCapturesRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ObserveCapturesRequest { const message = createBaseObserveCapturesRequest(); message.EventStore = object.EventStore ?? ""; return message; }, }; function createBaseQueryResultIEnumerableCaptureDetailsResponse(): QueryResultIEnumerableCaptureDetailsResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableCaptureDetailsResponse: MessageFns = { encode( message: QueryResultIEnumerableCaptureDetailsResponse, 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) { CaptureDetailsResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableCaptureDetailsResponse { 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 = createBaseQueryResultIEnumerableCaptureDetailsResponse(); 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(CaptureDetailsResponse.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): QueryResultIEnumerableCaptureDetailsResponse { 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) => CaptureDetailsResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableCaptureDetailsResponse): 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) => CaptureDetailsResponse.toJSON(e)); } return obj; }, create( base?: DeepPartial, ): QueryResultIEnumerableCaptureDetailsResponse { return QueryResultIEnumerableCaptureDetailsResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableCaptureDetailsResponse { const message = createBaseQueryResultIEnumerableCaptureDetailsResponse(); 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) => CaptureDetailsResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultIEnumerableCapturedEventResponse(): QueryResultIEnumerableCapturedEventResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableCapturedEventResponse: MessageFns = { encode( message: QueryResultIEnumerableCapturedEventResponse, 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) { CapturedEventResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableCapturedEventResponse { 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 = createBaseQueryResultIEnumerableCapturedEventResponse(); 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(CapturedEventResponse.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): QueryResultIEnumerableCapturedEventResponse { 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) => CapturedEventResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableCapturedEventResponse): 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) => CapturedEventResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableCapturedEventResponse { return QueryResultIEnumerableCapturedEventResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableCapturedEventResponse { const message = createBaseQueryResultIEnumerableCapturedEventResponse(); 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) => CapturedEventResponse.fromPartial(e)) || []; return message; }, }; function createBaseSaveCaptureRequest(): SaveCaptureRequest { return { EventStore: "", Id: undefined, Declaration: "" }; } export const SaveCaptureRequest: MessageFns = { encode(message: SaveCaptureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(18).fork()).join(); } if (message.Declaration !== "") { writer.uint32(26).string(message.Declaration); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SaveCaptureRequest { 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 = createBaseSaveCaptureRequest(); 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.Id = Guid.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.Declaration = 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): SaveCaptureRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, Declaration: isSet(object.Declaration) ? globalThis.String(object.Declaration) : "", }; }, toJSON(message: SaveCaptureRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.Declaration !== "") { obj.Declaration = message.Declaration; } return obj; }, create(base?: DeepPartial): SaveCaptureRequest { return SaveCaptureRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SaveCaptureRequest { const message = createBaseSaveCaptureRequest(); message.EventStore = object.EventStore ?? ""; message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.Declaration = object.Declaration ?? ""; return message; }, }; function createBaseSaveCaptureResponse(): SaveCaptureResponse { return { Capture: undefined, Messages: [] }; } export const SaveCaptureResponse: MessageFns = { encode(message: SaveCaptureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Capture !== undefined) { CaptureDetailsResponse.encode(message.Capture, writer.uint32(10).fork()).join(); } for (const v of message.Messages) { CaptureValidationMessage.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SaveCaptureResponse { 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 = createBaseSaveCaptureResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Capture = CaptureDetailsResponse.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Messages.push(CaptureValidationMessage.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): SaveCaptureResponse { return { Capture: isSet(object.Capture) ? CaptureDetailsResponse.fromJSON(object.Capture) : undefined, Messages: globalThis.Array.isArray(object?.Messages) ? object.Messages.map((e: any) => CaptureValidationMessage.fromJSON(e)) : [], }; }, toJSON(message: SaveCaptureResponse): unknown { const obj: any = {}; if (message.Capture !== undefined) { obj.Capture = CaptureDetailsResponse.toJSON(message.Capture); } if (message.Messages?.length) { obj.Messages = message.Messages.map((e) => CaptureValidationMessage.toJSON(e)); } return obj; }, create(base?: DeepPartial): SaveCaptureResponse { return SaveCaptureResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SaveCaptureResponse { const message = createBaseSaveCaptureResponse(); message.Capture = (object.Capture !== undefined && object.Capture !== null) ? CaptureDetailsResponse.fromPartial(object.Capture) : undefined; message.Messages = object.Messages?.map((e) => CaptureValidationMessage.fromPartial(e)) || []; 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 createBaseStartCaptureRequest(): StartCaptureRequest { return { EventStore: "", CaptureId: undefined }; } export const StartCaptureRequest: MessageFns = { encode(message: StartCaptureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.CaptureId !== undefined) { Guid.encode(message.CaptureId, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): StartCaptureRequest { 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 = createBaseStartCaptureRequest(); 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.CaptureId = Guid.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): StartCaptureRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", CaptureId: isSet(object.CaptureId) ? Guid.fromJSON(object.CaptureId) : undefined, }; }, toJSON(message: StartCaptureRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.CaptureId !== undefined) { obj.CaptureId = Guid.toJSON(message.CaptureId); } return obj; }, create(base?: DeepPartial): StartCaptureRequest { return StartCaptureRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): StartCaptureRequest { const message = createBaseStartCaptureRequest(); message.EventStore = object.EventStore ?? ""; message.CaptureId = (object.CaptureId !== undefined && object.CaptureId !== null) ? Guid.fromPartial(object.CaptureId) : undefined; return message; }, }; function createBaseStartCaptureResponse(): StartCaptureResponse { return { Messages: [] }; } export const StartCaptureResponse: MessageFns = { encode(message: StartCaptureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { for (const v of message.Messages) { CaptureValidationMessage.encode(v!, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): StartCaptureResponse { 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 = createBaseStartCaptureResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Messages.push(CaptureValidationMessage.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): StartCaptureResponse { return { Messages: globalThis.Array.isArray(object?.Messages) ? object.Messages.map((e: any) => CaptureValidationMessage.fromJSON(e)) : [], }; }, toJSON(message: StartCaptureResponse): unknown { const obj: any = {}; if (message.Messages?.length) { obj.Messages = message.Messages.map((e) => CaptureValidationMessage.toJSON(e)); } return obj; }, create(base?: DeepPartial): StartCaptureResponse { return StartCaptureResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): StartCaptureResponse { const message = createBaseStartCaptureResponse(); message.Messages = object.Messages?.map((e) => CaptureValidationMessage.fromPartial(e)) || []; return message; }, }; function createBaseStopCaptureRequest(): StopCaptureRequest { return { EventStore: "", CaptureId: undefined }; } export const StopCaptureRequest: MessageFns = { encode(message: StopCaptureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.CaptureId !== undefined) { Guid.encode(message.CaptureId, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): StopCaptureRequest { 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 = createBaseStopCaptureRequest(); 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.CaptureId = Guid.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): StopCaptureRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", CaptureId: isSet(object.CaptureId) ? Guid.fromJSON(object.CaptureId) : undefined, }; }, toJSON(message: StopCaptureRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.CaptureId !== undefined) { obj.CaptureId = Guid.toJSON(message.CaptureId); } return obj; }, create(base?: DeepPartial): StopCaptureRequest { return StopCaptureRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): StopCaptureRequest { const message = createBaseStopCaptureRequest(); message.EventStore = object.EventStore ?? ""; message.CaptureId = (object.CaptureId !== undefined && object.CaptureId !== null) ? Guid.fromPartial(object.CaptureId) : undefined; return message; }, }; function createBaseValidateCaptureDeclarationRequest(): ValidateCaptureDeclarationRequest { return { EventStore: "", Declaration: "" }; } export const ValidateCaptureDeclarationRequest: MessageFns = { encode(message: ValidateCaptureDeclarationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Declaration !== "") { writer.uint32(18).string(message.Declaration); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ValidateCaptureDeclarationRequest { 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 = createBaseValidateCaptureDeclarationRequest(); 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.Declaration = 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): ValidateCaptureDeclarationRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Declaration: isSet(object.Declaration) ? globalThis.String(object.Declaration) : "", }; }, toJSON(message: ValidateCaptureDeclarationRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Declaration !== "") { obj.Declaration = message.Declaration; } return obj; }, create(base?: DeepPartial): ValidateCaptureDeclarationRequest { return ValidateCaptureDeclarationRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ValidateCaptureDeclarationRequest { const message = createBaseValidateCaptureDeclarationRequest(); message.EventStore = object.EventStore ?? ""; message.Declaration = object.Declaration ?? ""; return message; }, }; function createBaseValidateCaptureDeclarationResponse(): ValidateCaptureDeclarationResponse { return { Messages: [] }; } export const ValidateCaptureDeclarationResponse: MessageFns = { encode(message: ValidateCaptureDeclarationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { for (const v of message.Messages) { CaptureValidationMessage.encode(v!, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ValidateCaptureDeclarationResponse { 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 = createBaseValidateCaptureDeclarationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Messages.push(CaptureValidationMessage.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): ValidateCaptureDeclarationResponse { return { Messages: globalThis.Array.isArray(object?.Messages) ? object.Messages.map((e: any) => CaptureValidationMessage.fromJSON(e)) : [], }; }, toJSON(message: ValidateCaptureDeclarationResponse): unknown { const obj: any = {}; if (message.Messages?.length) { obj.Messages = message.Messages.map((e) => CaptureValidationMessage.toJSON(e)); } return obj; }, create(base?: DeepPartial): ValidateCaptureDeclarationResponse { return ValidateCaptureDeclarationResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ValidateCaptureDeclarationResponse { const message = createBaseValidateCaptureDeclarationResponse(); message.Messages = object.Messages?.map((e) => CaptureValidationMessage.fromPartial(e)) || []; return message; }, }; function createBaseValidationResult(): ValidationResult { return { Severity: 0, Message: "", Members: [] }; } export const ValidationResult: MessageFns = { encode(message: ValidationResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Severity !== 0) { writer.uint32(8).int32(message.Severity); } if (message.Message !== "") { writer.uint32(18).string(message.Message); } for (const v of message.Members) { writer.uint32(26).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ValidationResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseValidationResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Severity = reader.int32() as any; continue; } case 2: { if (tag !== 18) { break; } message.Message = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Members.push(reader.string()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): ValidationResult { return { Severity: isSet(object.Severity) ? validationResultSeverityFromJSON(object.Severity) : 0, Message: isSet(object.Message) ? globalThis.String(object.Message) : "", Members: globalThis.Array.isArray(object?.Members) ? object.Members.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: ValidationResult): unknown { const obj: any = {}; if (message.Severity !== 0) { obj.Severity = validationResultSeverityToJSON(message.Severity); } if (message.Message !== "") { obj.Message = message.Message; } if (message.Members?.length) { obj.Members = message.Members; } return obj; }, create(base?: DeepPartial): ValidationResult { return ValidationResult.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ValidationResult { const message = createBaseValidationResult(); message.Severity = object.Severity ?? 0; message.Message = object.Message ?? ""; message.Members = object.Members?.map((e) => e) || []; return message; }, }; export type CapturesDefinition = typeof CapturesDefinition; export const CapturesDefinition = { name: "Captures", fullName: "Cratis.Chronicle.Contracts.Captures.Captures", methods: { capturedEvents: { name: "CapturedEvents", requestType: CapturedEventsRequest as typeof CapturedEventsRequest, requestStream: false, responseType: QueryResultIEnumerableCapturedEventResponse as typeof QueryResultIEnumerableCapturedEventResponse, responseStream: false, options: {}, }, deleteCapture: { name: "DeleteCapture", requestType: DeleteCaptureRequest as typeof DeleteCaptureRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, getCaptures: { name: "GetCaptures", requestType: GetCapturesRequest as typeof GetCapturesRequest, requestStream: false, responseType: QueryResultIEnumerableCaptureDetailsResponse as typeof QueryResultIEnumerableCaptureDetailsResponse, responseStream: false, options: {}, }, observeCaptures: { name: "ObserveCaptures", requestType: ObserveCapturesRequest as typeof ObserveCapturesRequest, requestStream: false, responseType: QueryResultIEnumerableCaptureDetailsResponse as typeof QueryResultIEnumerableCaptureDetailsResponse, responseStream: true, options: {}, }, saveCapture: { name: "SaveCapture", requestType: SaveCaptureRequest as typeof SaveCaptureRequest, requestStream: false, responseType: CommandResultSaveCaptureResponse as typeof CommandResultSaveCaptureResponse, responseStream: false, options: {}, }, startCapture: { name: "StartCapture", requestType: StartCaptureRequest as typeof StartCaptureRequest, requestStream: false, responseType: CommandResultStartCaptureResponse as typeof CommandResultStartCaptureResponse, responseStream: false, options: {}, }, stopCapture: { name: "StopCapture", requestType: StopCaptureRequest as typeof StopCaptureRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, validateCaptureDeclaration: { name: "ValidateCaptureDeclaration", requestType: ValidateCaptureDeclarationRequest as typeof ValidateCaptureDeclarationRequest, requestStream: false, responseType: CommandResultValidateCaptureDeclarationResponse as typeof CommandResultValidateCaptureDeclarationResponse, responseStream: false, options: {}, }, }, } as const; export interface CapturesServiceImplementation { capturedEvents( request: CapturedEventsRequest, context: CallContext & CallContextExt, ): Promise>; deleteCapture( request: DeleteCaptureRequest, context: CallContext & CallContextExt, ): Promise>; getCaptures( request: GetCapturesRequest, context: CallContext & CallContextExt, ): Promise>; observeCaptures( request: ObserveCapturesRequest, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; saveCapture( request: SaveCaptureRequest, context: CallContext & CallContextExt, ): Promise>; startCapture( request: StartCaptureRequest, context: CallContext & CallContextExt, ): Promise>; stopCapture(request: StopCaptureRequest, context: CallContext & CallContextExt): Promise>; validateCaptureDeclaration( request: ValidateCaptureDeclarationRequest, context: CallContext & CallContextExt, ): Promise>; } export interface CapturesClient { capturedEvents( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; deleteCapture( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getCaptures( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; observeCaptures( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; saveCapture( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; startCapture( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; stopCapture(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; validateCaptureDeclaration( 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 type ServerStreamingMethodResult = { [Symbol.asyncIterator](): AsyncIterator }; export interface MessageFns { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create(base?: DeepPartial): T; fromPartial(object: DeepPartial): T; }