// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.15.3 // protoc v5.28.3 // source: occurrences.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.Occurrences"; export enum EffectOutcome { Appended = 0, NoEvents = 1, Refused = 2, UNRECOGNIZED = -1, } export function effectOutcomeFromJSON(object: any): EffectOutcome { switch (object) { case 0: case "Appended": return EffectOutcome.Appended; case 1: case "NoEvents": return EffectOutcome.NoEvents; case 2: case "Refused": return EffectOutcome.Refused; case -1: case "UNRECOGNIZED": default: return EffectOutcome.UNRECOGNIZED; } } export function effectOutcomeToJSON(object: EffectOutcome): string { switch (object) { case EffectOutcome.Appended: return "Appended"; case EffectOutcome.NoEvents: return "NoEvents"; case EffectOutcome.Refused: return "Refused"; case EffectOutcome.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum EffectReceiptStatus { EFFECT_RECEIPT_STATUS_Recorded = 0, EFFECT_RECEIPT_STATUS_AlreadyRecorded = 1, UNRECOGNIZED = -1, } export function effectReceiptStatusFromJSON(object: any): EffectReceiptStatus { switch (object) { case 0: case "EFFECT_RECEIPT_STATUS_Recorded": return EffectReceiptStatus.EFFECT_RECEIPT_STATUS_Recorded; case 1: case "EFFECT_RECEIPT_STATUS_AlreadyRecorded": return EffectReceiptStatus.EFFECT_RECEIPT_STATUS_AlreadyRecorded; case -1: case "UNRECOGNIZED": default: return EffectReceiptStatus.UNRECOGNIZED; } } export function effectReceiptStatusToJSON(object: EffectReceiptStatus): string { switch (object) { case EffectReceiptStatus.EFFECT_RECEIPT_STATUS_Recorded: return "EFFECT_RECEIPT_STATUS_Recorded"; case EffectReceiptStatus.EFFECT_RECEIPT_STATUS_AlreadyRecorded: return "EFFECT_RECEIPT_STATUS_AlreadyRecorded"; case EffectReceiptStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum OccurrenceIngressStatus { OCCURRENCE_INGRESS_STATUS_Recorded = 0, OCCURRENCE_INGRESS_STATUS_AlreadyRecorded = 1, OccurrenceIdConflict = 2, OccurrencePayloadInvalid = 3, UNRECOGNIZED = -1, } export function occurrenceIngressStatusFromJSON(object: any): OccurrenceIngressStatus { switch (object) { case 0: case "OCCURRENCE_INGRESS_STATUS_Recorded": return OccurrenceIngressStatus.OCCURRENCE_INGRESS_STATUS_Recorded; case 1: case "OCCURRENCE_INGRESS_STATUS_AlreadyRecorded": return OccurrenceIngressStatus.OCCURRENCE_INGRESS_STATUS_AlreadyRecorded; case 2: case "OccurrenceIdConflict": return OccurrenceIngressStatus.OccurrenceIdConflict; case 3: case "OccurrencePayloadInvalid": return OccurrenceIngressStatus.OccurrencePayloadInvalid; case -1: case "UNRECOGNIZED": default: return OccurrenceIngressStatus.UNRECOGNIZED; } } export function occurrenceIngressStatusToJSON(object: OccurrenceIngressStatus): string { switch (object) { case OccurrenceIngressStatus.OCCURRENCE_INGRESS_STATUS_Recorded: return "OCCURRENCE_INGRESS_STATUS_Recorded"; case OccurrenceIngressStatus.OCCURRENCE_INGRESS_STATUS_AlreadyRecorded: return "OCCURRENCE_INGRESS_STATUS_AlreadyRecorded"; case OccurrenceIngressStatus.OccurrenceIdConflict: return "OccurrenceIdConflict"; case OccurrenceIngressStatus.OccurrencePayloadInvalid: return "OccurrencePayloadInvalid"; case OccurrenceIngressStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum OccurrenceKind { Application = 0, Schedule = 1, Startup = 2, Shutdown = 3, UNRECOGNIZED = -1, } export function occurrenceKindFromJSON(object: any): OccurrenceKind { switch (object) { case 0: case "Application": return OccurrenceKind.Application; case 1: case "Schedule": return OccurrenceKind.Schedule; case 2: case "Startup": return OccurrenceKind.Startup; case 3: case "Shutdown": return OccurrenceKind.Shutdown; case -1: case "UNRECOGNIZED": default: return OccurrenceKind.UNRECOGNIZED; } } export function occurrenceKindToJSON(object: OccurrenceKind): string { switch (object) { case OccurrenceKind.Application: return "Application"; case OccurrenceKind.Schedule: return "Schedule"; case OccurrenceKind.Startup: return "Startup"; case OccurrenceKind.Shutdown: return "Shutdown"; case OccurrenceKind.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum OccurrenceLeaseResult { Updated = 0, AlreadyCompleted = 1, OccurrenceLeaseLost = 2, UNRECOGNIZED = -1, } export function occurrenceLeaseResultFromJSON(object: any): OccurrenceLeaseResult { switch (object) { case 0: case "Updated": return OccurrenceLeaseResult.Updated; case 1: case "AlreadyCompleted": return OccurrenceLeaseResult.AlreadyCompleted; case 2: case "OccurrenceLeaseLost": return OccurrenceLeaseResult.OccurrenceLeaseLost; case -1: case "UNRECOGNIZED": default: return OccurrenceLeaseResult.UNRECOGNIZED; } } export function occurrenceLeaseResultToJSON(object: OccurrenceLeaseResult): string { switch (object) { case OccurrenceLeaseResult.Updated: return "Updated"; case OccurrenceLeaseResult.AlreadyCompleted: return "AlreadyCompleted"; case OccurrenceLeaseResult.OccurrenceLeaseLost: return "OccurrenceLeaseLost"; case OccurrenceLeaseResult.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum OccurrenceState { Pending = 0, Leased = 1, Completed = 2, Quarantined = 3, Skipped = 4, UNRECOGNIZED = -1, } export function occurrenceStateFromJSON(object: any): OccurrenceState { switch (object) { case 0: case "Pending": return OccurrenceState.Pending; case 1: case "Leased": return OccurrenceState.Leased; case 2: case "Completed": return OccurrenceState.Completed; case 3: case "Quarantined": return OccurrenceState.Quarantined; case 4: case "Skipped": return OccurrenceState.Skipped; case -1: case "UNRECOGNIZED": default: return OccurrenceState.UNRECOGNIZED; } } export function occurrenceStateToJSON(object: OccurrenceState): string { switch (object) { case OccurrenceState.Pending: return "Pending"; case OccurrenceState.Leased: return "Leased"; case OccurrenceState.Completed: return "Completed"; case OccurrenceState.Quarantined: return "Quarantined"; case OccurrenceState.Skipped: return "Skipped"; case OccurrenceState.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 ClaimOccurrencesRequest { EventStore: string; Namespace: string; Trigger: string; WorkerId: string; LeaseSeconds: number; Max: number; ApplicationScope: boolean; } export interface ClaimOccurrencesResponse { Claims: OccurrenceClaimDetails[]; } export interface CommandResultBoolean { /** 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: boolean; } export interface CommandResultClaimOccurrencesResponse { /** 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: ClaimOccurrencesResponse | undefined; } export interface CommandResultCompleteOccurrenceResponse { /** 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: CompleteOccurrenceResponse | undefined; } export interface CommandResultRecordEffectReceiptResponse { /** 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: RecordEffectReceiptResponse | undefined; } export interface CommandResultRecordLifecycleOccurrenceResponse { /** 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: RecordLifecycleOccurrenceResponse | undefined; } export interface CommandResultRecordOccurrenceResponse { /** 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: RecordOccurrenceResponse | undefined; } export interface CommandResultRegisterTriggersResponse { /** 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: RegisterTriggersResponse | undefined; } export interface CompleteOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; Epoch: bigint; ApplicationScope: boolean; } export interface CompleteOccurrenceResponse { Status: OccurrenceLeaseResult; } export interface EffectReceipt { OccurrenceId: string; EffectKey: string; Epoch: bigint; Response: string; } export interface EffectReceiptDetails { Id: string; OccurrenceId: string; Epoch: bigint; Outcome: EffectOutcome; EventSequenceId: string; FirstSequenceNumber: bigint; LastSequenceNumber: bigint; Reasons: string[]; Response: string; RecordedAt: SerializableDateTimeOffset | undefined; } export interface EffectReceiptRecordResponse { Id: string; OccurrenceId: string; Epoch: bigint; Outcome: EffectOutcome; EventSequenceId: string; FirstSequenceNumber: bigint; LastSequenceNumber: bigint; Reasons: string[]; Response: string; RecordedAt: SerializableDateTimeOffset | undefined; } export interface FailOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; Epoch: bigint; Error: string; ApplicationScope: boolean; } export interface GetEffectReceiptRequest { EventStore: string; Namespace: string; OccurrenceId: string; EffectKey: string; } export interface GetOccurrenceRequest { EventStore: string; Namespace: string; OccurrenceId: string; ApplicationScope: boolean; } export interface ObserveOccurrencesRequest { EventStore: string; Namespace: string; Trigger: string; ApplicationScope: boolean; } export interface OccurrenceClaimDetails { Id: string; Trigger: string; Kind: OccurrenceKind; Payload: string; SchemaRevision: bigint; RecordedAt: SerializableDateTimeOffset | undefined; Due: SerializableDateTimeOffset | undefined; Attempts: number; Epoch: bigint; LeaseExpiry: SerializableDateTimeOffset | undefined; } export interface OccurrenceEffectReceipt { Namespace: string; Receipt: EffectReceiptDetails | undefined; } export interface OccurrenceSnapshotResponse { Id: string; Trigger: string; Kind: OccurrenceKind; Payload: string; SchemaRevision: bigint; RecordedAt: SerializableDateTimeOffset | undefined; Due: SerializableDateTimeOffset | undefined; State: OccurrenceState; Attempts: number; Epoch: bigint; Owner: string; LeaseExpiry: SerializableDateTimeOffset | undefined; LastError: string; NextAttempt: SerializableDateTimeOffset | undefined; RetriedBy: string; RetriedAt: SerializableDateTimeOffset | undefined; Receipts: OccurrenceEffectReceipt[]; } export interface QueryResultEffectReceiptRecordResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: EffectReceiptRecordResponse | undefined; } export interface QueryResultIEnumerableOccurrenceSnapshotResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: OccurrenceSnapshotResponse[]; } export interface QueryResultOccurrenceSnapshotResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: OccurrenceSnapshotResponse | undefined; } export interface RecordEffectReceiptRequest { EventStore: string; Namespace: string; EffectReceipt: EffectReceipt | undefined; Outcome: EffectOutcome; Reasons: string[]; } export interface RecordEffectReceiptResponse { Status: EffectReceiptStatus; Receipt: EffectReceiptDetails | undefined; } export interface RecordLifecycleOccurrenceRequest { EventStore: string; ActivationId: string; Kind: OccurrenceKind; AllNamespaces: boolean; } export interface RecordLifecycleOccurrenceResponse { Id: string; Status: OccurrenceIngressStatus; Namespaces: string[]; } export interface RecordOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; IdempotencyId: string; Payload: string; Kind: OccurrenceKind; ApplicationScope: boolean; } export interface RecordOccurrenceResponse { Id: string; Status: OccurrenceIngressStatus; } export interface RegisterTriggersRequest { EventStore: string; Triggers: TriggerRegistration[]; } export interface RegisterTriggersResponse { Registered: boolean; Errors: string[]; } export interface RenewOccurrenceLeaseRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; Epoch: bigint; LeaseSeconds: number; ApplicationScope: boolean; } export interface RetryQuarantinedOccurrenceRequest { EventStore: string; Namespace: string; Trigger: string; OccurrenceId: string; ApplicationScope: boolean; } /** 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 TriggerRegistration { Id: string; Name: string; Schema: string; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseClaimOccurrencesRequest(): ClaimOccurrencesRequest { return { EventStore: "", Namespace: "", Trigger: "", WorkerId: "", LeaseSeconds: 0, Max: 0, ApplicationScope: false }; } export const ClaimOccurrencesRequest: MessageFns = { encode(message: ClaimOccurrencesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.Trigger !== "") { writer.uint32(26).string(message.Trigger); } if (message.WorkerId !== "") { writer.uint32(34).string(message.WorkerId); } if (message.LeaseSeconds !== 0) { writer.uint32(40).int32(message.LeaseSeconds); } if (message.Max !== 0) { writer.uint32(48).int32(message.Max); } if (message.ApplicationScope !== false) { writer.uint32(56).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ClaimOccurrencesRequest { 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 = createBaseClaimOccurrencesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Trigger = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.WorkerId = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.LeaseSeconds = reader.int32(); continue; } case 6: { if (tag !== 48) { break; } message.Max = reader.int32(); continue; } case 7: { if (tag !== 56) { break; } message.ApplicationScope = 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): ClaimOccurrencesRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", WorkerId: isSet(object.WorkerId) ? globalThis.String(object.WorkerId) : "", LeaseSeconds: isSet(object.LeaseSeconds) ? globalThis.Number(object.LeaseSeconds) : 0, Max: isSet(object.Max) ? globalThis.Number(object.Max) : 0, ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: ClaimOccurrencesRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.WorkerId !== "") { obj.WorkerId = message.WorkerId; } if (message.LeaseSeconds !== 0) { obj.LeaseSeconds = Math.round(message.LeaseSeconds); } if (message.Max !== 0) { obj.Max = Math.round(message.Max); } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): ClaimOccurrencesRequest { return ClaimOccurrencesRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ClaimOccurrencesRequest { const message = createBaseClaimOccurrencesRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.Trigger = object.Trigger ?? ""; message.WorkerId = object.WorkerId ?? ""; message.LeaseSeconds = object.LeaseSeconds ?? 0; message.Max = object.Max ?? 0; message.ApplicationScope = object.ApplicationScope ?? false; return message; }, }; function createBaseClaimOccurrencesResponse(): ClaimOccurrencesResponse { return { Claims: [] }; } export const ClaimOccurrencesResponse: MessageFns = { encode(message: ClaimOccurrencesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { for (const v of message.Claims) { OccurrenceClaimDetails.encode(v!, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ClaimOccurrencesResponse { 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 = createBaseClaimOccurrencesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Claims.push(OccurrenceClaimDetails.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): ClaimOccurrencesResponse { return { Claims: globalThis.Array.isArray(object?.Claims) ? object.Claims.map((e: any) => OccurrenceClaimDetails.fromJSON(e)) : [], }; }, toJSON(message: ClaimOccurrencesResponse): unknown { const obj: any = {}; if (message.Claims?.length) { obj.Claims = message.Claims.map((e) => OccurrenceClaimDetails.toJSON(e)); } return obj; }, create(base?: DeepPartial): ClaimOccurrencesResponse { return ClaimOccurrencesResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ClaimOccurrencesResponse { const message = createBaseClaimOccurrencesResponse(); message.Claims = object.Claims?.map((e) => OccurrenceClaimDetails.fromPartial(e)) || []; return message; }, }; function createBaseCommandResultBoolean(): CommandResultBoolean { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: false, }; } export const CommandResultBoolean: MessageFns = { encode(message: CommandResultBoolean, 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 !== false) { writer.uint32(56).bool(message.Response); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultBoolean { 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 = createBaseCommandResultBoolean(); 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 !== 56) { break; } message.Response = 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): CommandResultBoolean { 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) ? globalThis.Boolean(object.Response) : false, }; }, toJSON(message: CommandResultBoolean): 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 !== false) { obj.Response = message.Response; } return obj; }, create(base?: DeepPartial): CommandResultBoolean { return CommandResultBoolean.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultBoolean { const message = createBaseCommandResultBoolean(); 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 ?? false; return message; }, }; function createBaseCommandResultClaimOccurrencesResponse(): CommandResultClaimOccurrencesResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultClaimOccurrencesResponse: MessageFns = { encode(message: CommandResultClaimOccurrencesResponse, 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) { ClaimOccurrencesResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultClaimOccurrencesResponse { 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 = createBaseCommandResultClaimOccurrencesResponse(); 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 = ClaimOccurrencesResponse.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): CommandResultClaimOccurrencesResponse { 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) ? ClaimOccurrencesResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultClaimOccurrencesResponse): 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 = ClaimOccurrencesResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultClaimOccurrencesResponse { return CommandResultClaimOccurrencesResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultClaimOccurrencesResponse { const message = createBaseCommandResultClaimOccurrencesResponse(); 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) ? ClaimOccurrencesResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultCompleteOccurrenceResponse(): CommandResultCompleteOccurrenceResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultCompleteOccurrenceResponse: MessageFns = { encode(message: CommandResultCompleteOccurrenceResponse, 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) { CompleteOccurrenceResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultCompleteOccurrenceResponse { 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 = createBaseCommandResultCompleteOccurrenceResponse(); 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 = CompleteOccurrenceResponse.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): CommandResultCompleteOccurrenceResponse { 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) ? CompleteOccurrenceResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultCompleteOccurrenceResponse): 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 = CompleteOccurrenceResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultCompleteOccurrenceResponse { return CommandResultCompleteOccurrenceResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultCompleteOccurrenceResponse { const message = createBaseCommandResultCompleteOccurrenceResponse(); 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) ? CompleteOccurrenceResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultRecordEffectReceiptResponse(): CommandResultRecordEffectReceiptResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultRecordEffectReceiptResponse: MessageFns = { encode(message: CommandResultRecordEffectReceiptResponse, 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) { RecordEffectReceiptResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultRecordEffectReceiptResponse { 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 = createBaseCommandResultRecordEffectReceiptResponse(); 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 = RecordEffectReceiptResponse.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): CommandResultRecordEffectReceiptResponse { 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) ? RecordEffectReceiptResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultRecordEffectReceiptResponse): 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 = RecordEffectReceiptResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultRecordEffectReceiptResponse { return CommandResultRecordEffectReceiptResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultRecordEffectReceiptResponse { const message = createBaseCommandResultRecordEffectReceiptResponse(); 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) ? RecordEffectReceiptResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultRecordLifecycleOccurrenceResponse(): CommandResultRecordLifecycleOccurrenceResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultRecordLifecycleOccurrenceResponse: MessageFns< CommandResultRecordLifecycleOccurrenceResponse > = { encode( message: CommandResultRecordLifecycleOccurrenceResponse, 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) { RecordLifecycleOccurrenceResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultRecordLifecycleOccurrenceResponse { 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 = createBaseCommandResultRecordLifecycleOccurrenceResponse(); 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 = RecordLifecycleOccurrenceResponse.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): CommandResultRecordLifecycleOccurrenceResponse { 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) ? RecordLifecycleOccurrenceResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultRecordLifecycleOccurrenceResponse): 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 = RecordLifecycleOccurrenceResponse.toJSON(message.Response); } return obj; }, create( base?: DeepPartial, ): CommandResultRecordLifecycleOccurrenceResponse { return CommandResultRecordLifecycleOccurrenceResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): CommandResultRecordLifecycleOccurrenceResponse { const message = createBaseCommandResultRecordLifecycleOccurrenceResponse(); 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) ? RecordLifecycleOccurrenceResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultRecordOccurrenceResponse(): CommandResultRecordOccurrenceResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultRecordOccurrenceResponse: MessageFns = { encode(message: CommandResultRecordOccurrenceResponse, 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) { RecordOccurrenceResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultRecordOccurrenceResponse { 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 = createBaseCommandResultRecordOccurrenceResponse(); 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 = RecordOccurrenceResponse.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): CommandResultRecordOccurrenceResponse { 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) ? RecordOccurrenceResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultRecordOccurrenceResponse): 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 = RecordOccurrenceResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultRecordOccurrenceResponse { return CommandResultRecordOccurrenceResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultRecordOccurrenceResponse { const message = createBaseCommandResultRecordOccurrenceResponse(); 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) ? RecordOccurrenceResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCommandResultRegisterTriggersResponse(): CommandResultRegisterTriggersResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", Response: undefined, }; } export const CommandResultRegisterTriggersResponse: MessageFns = { encode(message: CommandResultRegisterTriggersResponse, 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) { RegisterTriggersResponse.encode(message.Response, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResultRegisterTriggersResponse { 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 = createBaseCommandResultRegisterTriggersResponse(); 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 = RegisterTriggersResponse.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): CommandResultRegisterTriggersResponse { 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) ? RegisterTriggersResponse.fromJSON(object.Response) : undefined, }; }, toJSON(message: CommandResultRegisterTriggersResponse): 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 = RegisterTriggersResponse.toJSON(message.Response); } return obj; }, create(base?: DeepPartial): CommandResultRegisterTriggersResponse { return CommandResultRegisterTriggersResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResultRegisterTriggersResponse { const message = createBaseCommandResultRegisterTriggersResponse(); 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) ? RegisterTriggersResponse.fromPartial(object.Response) : undefined; return message; }, }; function createBaseCompleteOccurrenceRequest(): CompleteOccurrenceRequest { return { EventStore: "", Namespace: "", Trigger: "", OccurrenceId: "", Epoch: 0n, ApplicationScope: false }; } export const CompleteOccurrenceRequest: MessageFns = { encode(message: CompleteOccurrenceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.Trigger !== "") { writer.uint32(26).string(message.Trigger); } if (message.OccurrenceId !== "") { writer.uint32(34).string(message.OccurrenceId); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(40).int64(message.Epoch); } if (message.ApplicationScope !== false) { writer.uint32(48).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CompleteOccurrenceRequest { 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 = createBaseCompleteOccurrenceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Trigger = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.OccurrenceId = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.Epoch = reader.int64() as bigint; continue; } case 6: { if (tag !== 48) { break; } message.ApplicationScope = 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): CompleteOccurrenceRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: CompleteOccurrenceRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): CompleteOccurrenceRequest { return CompleteOccurrenceRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CompleteOccurrenceRequest { const message = createBaseCompleteOccurrenceRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.Trigger = object.Trigger ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.ApplicationScope = object.ApplicationScope ?? false; return message; }, }; function createBaseCompleteOccurrenceResponse(): CompleteOccurrenceResponse { return { Status: 0 }; } export const CompleteOccurrenceResponse: MessageFns = { encode(message: CompleteOccurrenceResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Status !== 0) { writer.uint32(8).int32(message.Status); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CompleteOccurrenceResponse { 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 = createBaseCompleteOccurrenceResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { 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): CompleteOccurrenceResponse { return { Status: isSet(object.Status) ? occurrenceLeaseResultFromJSON(object.Status) : 0 }; }, toJSON(message: CompleteOccurrenceResponse): unknown { const obj: any = {}; if (message.Status !== 0) { obj.Status = occurrenceLeaseResultToJSON(message.Status); } return obj; }, create(base?: DeepPartial): CompleteOccurrenceResponse { return CompleteOccurrenceResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CompleteOccurrenceResponse { const message = createBaseCompleteOccurrenceResponse(); message.Status = object.Status ?? 0; return message; }, }; function createBaseEffectReceipt(): EffectReceipt { return { OccurrenceId: "", EffectKey: "", Epoch: 0n, Response: "" }; } export const EffectReceipt: MessageFns = { encode(message: EffectReceipt, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.OccurrenceId !== "") { writer.uint32(10).string(message.OccurrenceId); } if (message.EffectKey !== "") { writer.uint32(18).string(message.EffectKey); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(24).int64(message.Epoch); } if (message.Response !== "") { writer.uint32(34).string(message.Response); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EffectReceipt { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEffectReceipt(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.OccurrenceId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.EffectKey = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Epoch = reader.int64() as bigint; continue; } case 4: { if (tag !== 34) { break; } message.Response = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EffectReceipt { return { OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", EffectKey: isSet(object.EffectKey) ? globalThis.String(object.EffectKey) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, Response: isSet(object.Response) ? globalThis.String(object.Response) : "", }; }, toJSON(message: EffectReceipt): unknown { const obj: any = {}; if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.EffectKey !== "") { obj.EffectKey = message.EffectKey; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.Response !== "") { obj.Response = message.Response; } return obj; }, create(base?: DeepPartial): EffectReceipt { return EffectReceipt.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EffectReceipt { const message = createBaseEffectReceipt(); message.OccurrenceId = object.OccurrenceId ?? ""; message.EffectKey = object.EffectKey ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.Response = object.Response ?? ""; return message; }, }; function createBaseEffectReceiptDetails(): EffectReceiptDetails { return { Id: "", OccurrenceId: "", Epoch: 0n, Outcome: 0, EventSequenceId: "", FirstSequenceNumber: 0n, LastSequenceNumber: 0n, Reasons: [], Response: "", RecordedAt: undefined, }; } export const EffectReceiptDetails: MessageFns = { encode(message: EffectReceiptDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.OccurrenceId !== "") { writer.uint32(18).string(message.OccurrenceId); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(24).int64(message.Epoch); } if (message.Outcome !== 0) { writer.uint32(32).int32(message.Outcome); } if (message.EventSequenceId !== "") { writer.uint32(42).string(message.EventSequenceId); } if (message.FirstSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.FirstSequenceNumber) !== message.FirstSequenceNumber) { throw new globalThis.Error("value provided for field message.FirstSequenceNumber of type uint64 too large"); } writer.uint32(48).uint64(message.FirstSequenceNumber); } if (message.LastSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.LastSequenceNumber) !== message.LastSequenceNumber) { throw new globalThis.Error("value provided for field message.LastSequenceNumber of type uint64 too large"); } writer.uint32(56).uint64(message.LastSequenceNumber); } for (const v of message.Reasons) { writer.uint32(66).string(v!); } if (message.Response !== "") { writer.uint32(74).string(message.Response); } if (message.RecordedAt !== undefined) { SerializableDateTimeOffset.encode(message.RecordedAt, writer.uint32(82).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EffectReceiptDetails { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseEffectReceiptDetails(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.OccurrenceId = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Epoch = reader.int64() as bigint; continue; } case 4: { if (tag !== 32) { break; } message.Outcome = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.EventSequenceId = reader.string(); continue; } case 6: { if (tag !== 48) { break; } message.FirstSequenceNumber = reader.uint64() as bigint; continue; } case 7: { if (tag !== 56) { break; } message.LastSequenceNumber = reader.uint64() as bigint; continue; } case 8: { if (tag !== 66) { break; } message.Reasons.push(reader.string()); continue; } case 9: { if (tag !== 74) { break; } message.Response = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.RecordedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EffectReceiptDetails { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, Outcome: isSet(object.Outcome) ? effectOutcomeFromJSON(object.Outcome) : 0, EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", FirstSequenceNumber: isSet(object.FirstSequenceNumber) ? BigInt(object.FirstSequenceNumber) : 0n, LastSequenceNumber: isSet(object.LastSequenceNumber) ? BigInt(object.LastSequenceNumber) : 0n, Reasons: globalThis.Array.isArray(object?.Reasons) ? object.Reasons.map((e: any) => globalThis.String(e)) : [], Response: isSet(object.Response) ? globalThis.String(object.Response) : "", RecordedAt: isSet(object.RecordedAt) ? SerializableDateTimeOffset.fromJSON(object.RecordedAt) : undefined, }; }, toJSON(message: EffectReceiptDetails): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.Outcome !== 0) { obj.Outcome = effectOutcomeToJSON(message.Outcome); } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.FirstSequenceNumber !== 0n) { obj.FirstSequenceNumber = message.FirstSequenceNumber.toString(); } if (message.LastSequenceNumber !== 0n) { obj.LastSequenceNumber = message.LastSequenceNumber.toString(); } if (message.Reasons?.length) { obj.Reasons = message.Reasons; } if (message.Response !== "") { obj.Response = message.Response; } if (message.RecordedAt !== undefined) { obj.RecordedAt = SerializableDateTimeOffset.toJSON(message.RecordedAt); } return obj; }, create(base?: DeepPartial): EffectReceiptDetails { return EffectReceiptDetails.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EffectReceiptDetails { const message = createBaseEffectReceiptDetails(); message.Id = object.Id ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.Outcome = object.Outcome ?? 0; message.EventSequenceId = object.EventSequenceId ?? ""; message.FirstSequenceNumber = (object.FirstSequenceNumber !== undefined && object.FirstSequenceNumber !== null) ? BigInt(object.FirstSequenceNumber) : 0n; message.LastSequenceNumber = (object.LastSequenceNumber !== undefined && object.LastSequenceNumber !== null) ? BigInt(object.LastSequenceNumber) : 0n; message.Reasons = object.Reasons?.map((e) => e) || []; message.Response = object.Response ?? ""; message.RecordedAt = (object.RecordedAt !== undefined && object.RecordedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.RecordedAt) : undefined; return message; }, }; function createBaseEffectReceiptRecordResponse(): EffectReceiptRecordResponse { return { Id: "", OccurrenceId: "", Epoch: 0n, Outcome: 0, EventSequenceId: "", FirstSequenceNumber: 0n, LastSequenceNumber: 0n, Reasons: [], Response: "", RecordedAt: undefined, }; } export const EffectReceiptRecordResponse: MessageFns = { encode(message: EffectReceiptRecordResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.OccurrenceId !== "") { writer.uint32(18).string(message.OccurrenceId); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(24).int64(message.Epoch); } if (message.Outcome !== 0) { writer.uint32(32).int32(message.Outcome); } if (message.EventSequenceId !== "") { writer.uint32(42).string(message.EventSequenceId); } if (message.FirstSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.FirstSequenceNumber) !== message.FirstSequenceNumber) { throw new globalThis.Error("value provided for field message.FirstSequenceNumber of type uint64 too large"); } writer.uint32(48).uint64(message.FirstSequenceNumber); } if (message.LastSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.LastSequenceNumber) !== message.LastSequenceNumber) { throw new globalThis.Error("value provided for field message.LastSequenceNumber of type uint64 too large"); } writer.uint32(56).uint64(message.LastSequenceNumber); } for (const v of message.Reasons) { writer.uint32(66).string(v!); } if (message.Response !== "") { writer.uint32(74).string(message.Response); } if (message.RecordedAt !== undefined) { SerializableDateTimeOffset.encode(message.RecordedAt, writer.uint32(82).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): EffectReceiptRecordResponse { 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 = createBaseEffectReceiptRecordResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.OccurrenceId = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Epoch = reader.int64() as bigint; continue; } case 4: { if (tag !== 32) { break; } message.Outcome = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.EventSequenceId = reader.string(); continue; } case 6: { if (tag !== 48) { break; } message.FirstSequenceNumber = reader.uint64() as bigint; continue; } case 7: { if (tag !== 56) { break; } message.LastSequenceNumber = reader.uint64() as bigint; continue; } case 8: { if (tag !== 66) { break; } message.Reasons.push(reader.string()); continue; } case 9: { if (tag !== 74) { break; } message.Response = reader.string(); continue; } case 10: { if (tag !== 82) { break; } message.RecordedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): EffectReceiptRecordResponse { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, Outcome: isSet(object.Outcome) ? effectOutcomeFromJSON(object.Outcome) : 0, EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", FirstSequenceNumber: isSet(object.FirstSequenceNumber) ? BigInt(object.FirstSequenceNumber) : 0n, LastSequenceNumber: isSet(object.LastSequenceNumber) ? BigInt(object.LastSequenceNumber) : 0n, Reasons: globalThis.Array.isArray(object?.Reasons) ? object.Reasons.map((e: any) => globalThis.String(e)) : [], Response: isSet(object.Response) ? globalThis.String(object.Response) : "", RecordedAt: isSet(object.RecordedAt) ? SerializableDateTimeOffset.fromJSON(object.RecordedAt) : undefined, }; }, toJSON(message: EffectReceiptRecordResponse): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.Outcome !== 0) { obj.Outcome = effectOutcomeToJSON(message.Outcome); } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.FirstSequenceNumber !== 0n) { obj.FirstSequenceNumber = message.FirstSequenceNumber.toString(); } if (message.LastSequenceNumber !== 0n) { obj.LastSequenceNumber = message.LastSequenceNumber.toString(); } if (message.Reasons?.length) { obj.Reasons = message.Reasons; } if (message.Response !== "") { obj.Response = message.Response; } if (message.RecordedAt !== undefined) { obj.RecordedAt = SerializableDateTimeOffset.toJSON(message.RecordedAt); } return obj; }, create(base?: DeepPartial): EffectReceiptRecordResponse { return EffectReceiptRecordResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): EffectReceiptRecordResponse { const message = createBaseEffectReceiptRecordResponse(); message.Id = object.Id ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.Outcome = object.Outcome ?? 0; message.EventSequenceId = object.EventSequenceId ?? ""; message.FirstSequenceNumber = (object.FirstSequenceNumber !== undefined && object.FirstSequenceNumber !== null) ? BigInt(object.FirstSequenceNumber) : 0n; message.LastSequenceNumber = (object.LastSequenceNumber !== undefined && object.LastSequenceNumber !== null) ? BigInt(object.LastSequenceNumber) : 0n; message.Reasons = object.Reasons?.map((e) => e) || []; message.Response = object.Response ?? ""; message.RecordedAt = (object.RecordedAt !== undefined && object.RecordedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.RecordedAt) : undefined; return message; }, }; function createBaseFailOccurrenceRequest(): FailOccurrenceRequest { return { EventStore: "", Namespace: "", Trigger: "", OccurrenceId: "", Epoch: 0n, Error: "", ApplicationScope: false, }; } export const FailOccurrenceRequest: MessageFns = { encode(message: FailOccurrenceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.Trigger !== "") { writer.uint32(26).string(message.Trigger); } if (message.OccurrenceId !== "") { writer.uint32(34).string(message.OccurrenceId); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(40).int64(message.Epoch); } if (message.Error !== "") { writer.uint32(50).string(message.Error); } if (message.ApplicationScope !== false) { writer.uint32(56).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): FailOccurrenceRequest { 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 = createBaseFailOccurrenceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Trigger = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.OccurrenceId = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.Epoch = reader.int64() as bigint; continue; } case 6: { if (tag !== 50) { break; } message.Error = reader.string(); continue; } case 7: { if (tag !== 56) { break; } message.ApplicationScope = 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): FailOccurrenceRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, Error: isSet(object.Error) ? globalThis.String(object.Error) : "", ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: FailOccurrenceRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.Error !== "") { obj.Error = message.Error; } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): FailOccurrenceRequest { return FailOccurrenceRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): FailOccurrenceRequest { const message = createBaseFailOccurrenceRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.Trigger = object.Trigger ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.Error = object.Error ?? ""; message.ApplicationScope = object.ApplicationScope ?? false; return message; }, }; function createBaseGetEffectReceiptRequest(): GetEffectReceiptRequest { return { EventStore: "", Namespace: "", OccurrenceId: "", EffectKey: "" }; } export const GetEffectReceiptRequest: MessageFns = { encode(message: GetEffectReceiptRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.OccurrenceId !== "") { writer.uint32(26).string(message.OccurrenceId); } if (message.EffectKey !== "") { writer.uint32(34).string(message.EffectKey); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetEffectReceiptRequest { 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 = createBaseGetEffectReceiptRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.OccurrenceId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EffectKey = 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): GetEffectReceiptRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", EffectKey: isSet(object.EffectKey) ? globalThis.String(object.EffectKey) : "", }; }, toJSON(message: GetEffectReceiptRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.EffectKey !== "") { obj.EffectKey = message.EffectKey; } return obj; }, create(base?: DeepPartial): GetEffectReceiptRequest { return GetEffectReceiptRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetEffectReceiptRequest { const message = createBaseGetEffectReceiptRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.EffectKey = object.EffectKey ?? ""; return message; }, }; function createBaseGetOccurrenceRequest(): GetOccurrenceRequest { return { EventStore: "", Namespace: "", OccurrenceId: "", ApplicationScope: false }; } export const GetOccurrenceRequest: MessageFns = { encode(message: GetOccurrenceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.OccurrenceId !== "") { writer.uint32(26).string(message.OccurrenceId); } if (message.ApplicationScope !== false) { writer.uint32(32).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetOccurrenceRequest { 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 = createBaseGetOccurrenceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.OccurrenceId = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.ApplicationScope = 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): GetOccurrenceRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: GetOccurrenceRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): GetOccurrenceRequest { return GetOccurrenceRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetOccurrenceRequest { const message = createBaseGetOccurrenceRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.ApplicationScope = object.ApplicationScope ?? false; return message; }, }; function createBaseObserveOccurrencesRequest(): ObserveOccurrencesRequest { return { EventStore: "", Namespace: "", Trigger: "", ApplicationScope: false }; } export const ObserveOccurrencesRequest: MessageFns = { encode(message: ObserveOccurrencesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.Trigger !== "") { writer.uint32(26).string(message.Trigger); } if (message.ApplicationScope !== false) { writer.uint32(32).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ObserveOccurrencesRequest { 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 = createBaseObserveOccurrencesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Trigger = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.ApplicationScope = 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): ObserveOccurrencesRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: ObserveOccurrencesRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): ObserveOccurrencesRequest { return ObserveOccurrencesRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ObserveOccurrencesRequest { const message = createBaseObserveOccurrencesRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.Trigger = object.Trigger ?? ""; message.ApplicationScope = object.ApplicationScope ?? false; return message; }, }; function createBaseOccurrenceClaimDetails(): OccurrenceClaimDetails { return { Id: "", Trigger: "", Kind: 0, Payload: "", SchemaRevision: 0n, RecordedAt: undefined, Due: undefined, Attempts: 0, Epoch: 0n, LeaseExpiry: undefined, }; } export const OccurrenceClaimDetails: MessageFns = { encode(message: OccurrenceClaimDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Trigger !== "") { writer.uint32(18).string(message.Trigger); } if (message.Kind !== 0) { writer.uint32(24).int32(message.Kind); } if (message.Payload !== "") { writer.uint32(34).string(message.Payload); } if (message.SchemaRevision !== 0n) { if (BigInt.asIntN(64, message.SchemaRevision) !== message.SchemaRevision) { throw new globalThis.Error("value provided for field message.SchemaRevision of type int64 too large"); } writer.uint32(40).int64(message.SchemaRevision); } if (message.RecordedAt !== undefined) { SerializableDateTimeOffset.encode(message.RecordedAt, writer.uint32(50).fork()).join(); } if (message.Due !== undefined) { SerializableDateTimeOffset.encode(message.Due, writer.uint32(58).fork()).join(); } if (message.Attempts !== 0) { writer.uint32(64).int32(message.Attempts); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(72).int64(message.Epoch); } if (message.LeaseExpiry !== undefined) { SerializableDateTimeOffset.encode(message.LeaseExpiry, writer.uint32(82).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): OccurrenceClaimDetails { 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 = createBaseOccurrenceClaimDetails(); 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.Trigger = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Kind = reader.int32() as any; continue; } case 4: { if (tag !== 34) { break; } message.Payload = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.SchemaRevision = reader.int64() as bigint; continue; } case 6: { if (tag !== 50) { break; } message.RecordedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 7: { if (tag !== 58) { break; } message.Due = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 8: { if (tag !== 64) { break; } message.Attempts = reader.int32(); continue; } case 9: { if (tag !== 72) { break; } message.Epoch = reader.int64() as bigint; continue; } case 10: { if (tag !== 82) { break; } message.LeaseExpiry = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): OccurrenceClaimDetails { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", Kind: isSet(object.Kind) ? occurrenceKindFromJSON(object.Kind) : 0, Payload: isSet(object.Payload) ? globalThis.String(object.Payload) : "", SchemaRevision: isSet(object.SchemaRevision) ? BigInt(object.SchemaRevision) : 0n, RecordedAt: isSet(object.RecordedAt) ? SerializableDateTimeOffset.fromJSON(object.RecordedAt) : undefined, Due: isSet(object.Due) ? SerializableDateTimeOffset.fromJSON(object.Due) : undefined, Attempts: isSet(object.Attempts) ? globalThis.Number(object.Attempts) : 0, Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, LeaseExpiry: isSet(object.LeaseExpiry) ? SerializableDateTimeOffset.fromJSON(object.LeaseExpiry) : undefined, }; }, toJSON(message: OccurrenceClaimDetails): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.Kind !== 0) { obj.Kind = occurrenceKindToJSON(message.Kind); } if (message.Payload !== "") { obj.Payload = message.Payload; } if (message.SchemaRevision !== 0n) { obj.SchemaRevision = message.SchemaRevision.toString(); } if (message.RecordedAt !== undefined) { obj.RecordedAt = SerializableDateTimeOffset.toJSON(message.RecordedAt); } if (message.Due !== undefined) { obj.Due = SerializableDateTimeOffset.toJSON(message.Due); } if (message.Attempts !== 0) { obj.Attempts = Math.round(message.Attempts); } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.LeaseExpiry !== undefined) { obj.LeaseExpiry = SerializableDateTimeOffset.toJSON(message.LeaseExpiry); } return obj; }, create(base?: DeepPartial): OccurrenceClaimDetails { return OccurrenceClaimDetails.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): OccurrenceClaimDetails { const message = createBaseOccurrenceClaimDetails(); message.Id = object.Id ?? ""; message.Trigger = object.Trigger ?? ""; message.Kind = object.Kind ?? 0; message.Payload = object.Payload ?? ""; message.SchemaRevision = (object.SchemaRevision !== undefined && object.SchemaRevision !== null) ? BigInt(object.SchemaRevision) : 0n; message.RecordedAt = (object.RecordedAt !== undefined && object.RecordedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.RecordedAt) : undefined; message.Due = (object.Due !== undefined && object.Due !== null) ? SerializableDateTimeOffset.fromPartial(object.Due) : undefined; message.Attempts = object.Attempts ?? 0; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.LeaseExpiry = (object.LeaseExpiry !== undefined && object.LeaseExpiry !== null) ? SerializableDateTimeOffset.fromPartial(object.LeaseExpiry) : undefined; return message; }, }; function createBaseOccurrenceEffectReceipt(): OccurrenceEffectReceipt { return { Namespace: "", Receipt: undefined }; } export const OccurrenceEffectReceipt: MessageFns = { encode(message: OccurrenceEffectReceipt, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Namespace !== "") { writer.uint32(10).string(message.Namespace); } if (message.Receipt !== undefined) { EffectReceiptDetails.encode(message.Receipt, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): OccurrenceEffectReceipt { 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 = createBaseOccurrenceEffectReceipt(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Namespace = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Receipt = EffectReceiptDetails.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): OccurrenceEffectReceipt { return { Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Receipt: isSet(object.Receipt) ? EffectReceiptDetails.fromJSON(object.Receipt) : undefined, }; }, toJSON(message: OccurrenceEffectReceipt): unknown { const obj: any = {}; if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Receipt !== undefined) { obj.Receipt = EffectReceiptDetails.toJSON(message.Receipt); } return obj; }, create(base?: DeepPartial): OccurrenceEffectReceipt { return OccurrenceEffectReceipt.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): OccurrenceEffectReceipt { const message = createBaseOccurrenceEffectReceipt(); message.Namespace = object.Namespace ?? ""; message.Receipt = (object.Receipt !== undefined && object.Receipt !== null) ? EffectReceiptDetails.fromPartial(object.Receipt) : undefined; return message; }, }; function createBaseOccurrenceSnapshotResponse(): OccurrenceSnapshotResponse { return { Id: "", Trigger: "", Kind: 0, Payload: "", SchemaRevision: 0n, RecordedAt: undefined, Due: undefined, State: 0, Attempts: 0, Epoch: 0n, Owner: "", LeaseExpiry: undefined, LastError: "", NextAttempt: undefined, RetriedBy: "", RetriedAt: undefined, Receipts: [], }; } export const OccurrenceSnapshotResponse: MessageFns = { encode(message: OccurrenceSnapshotResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Trigger !== "") { writer.uint32(18).string(message.Trigger); } if (message.Kind !== 0) { writer.uint32(24).int32(message.Kind); } if (message.Payload !== "") { writer.uint32(34).string(message.Payload); } if (message.SchemaRevision !== 0n) { if (BigInt.asIntN(64, message.SchemaRevision) !== message.SchemaRevision) { throw new globalThis.Error("value provided for field message.SchemaRevision of type int64 too large"); } writer.uint32(40).int64(message.SchemaRevision); } if (message.RecordedAt !== undefined) { SerializableDateTimeOffset.encode(message.RecordedAt, writer.uint32(50).fork()).join(); } if (message.Due !== undefined) { SerializableDateTimeOffset.encode(message.Due, writer.uint32(58).fork()).join(); } if (message.State !== 0) { writer.uint32(64).int32(message.State); } if (message.Attempts !== 0) { writer.uint32(72).int32(message.Attempts); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(80).int64(message.Epoch); } if (message.Owner !== "") { writer.uint32(90).string(message.Owner); } if (message.LeaseExpiry !== undefined) { SerializableDateTimeOffset.encode(message.LeaseExpiry, writer.uint32(98).fork()).join(); } if (message.LastError !== "") { writer.uint32(106).string(message.LastError); } if (message.NextAttempt !== undefined) { SerializableDateTimeOffset.encode(message.NextAttempt, writer.uint32(114).fork()).join(); } if (message.RetriedBy !== "") { writer.uint32(122).string(message.RetriedBy); } if (message.RetriedAt !== undefined) { SerializableDateTimeOffset.encode(message.RetriedAt, writer.uint32(130).fork()).join(); } for (const v of message.Receipts) { OccurrenceEffectReceipt.encode(v!, writer.uint32(138).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): OccurrenceSnapshotResponse { 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 = createBaseOccurrenceSnapshotResponse(); 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.Trigger = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Kind = reader.int32() as any; continue; } case 4: { if (tag !== 34) { break; } message.Payload = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.SchemaRevision = reader.int64() as bigint; continue; } case 6: { if (tag !== 50) { break; } message.RecordedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 7: { if (tag !== 58) { break; } message.Due = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 8: { if (tag !== 64) { break; } message.State = reader.int32() as any; continue; } case 9: { if (tag !== 72) { break; } message.Attempts = reader.int32(); continue; } case 10: { if (tag !== 80) { break; } message.Epoch = reader.int64() as bigint; continue; } case 11: { if (tag !== 90) { break; } message.Owner = reader.string(); continue; } case 12: { if (tag !== 98) { break; } message.LeaseExpiry = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 13: { if (tag !== 106) { break; } message.LastError = reader.string(); continue; } case 14: { if (tag !== 114) { break; } message.NextAttempt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 15: { if (tag !== 122) { break; } message.RetriedBy = reader.string(); continue; } case 16: { if (tag !== 130) { break; } message.RetriedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 17: { if (tag !== 138) { break; } message.Receipts.push(OccurrenceEffectReceipt.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): OccurrenceSnapshotResponse { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", Kind: isSet(object.Kind) ? occurrenceKindFromJSON(object.Kind) : 0, Payload: isSet(object.Payload) ? globalThis.String(object.Payload) : "", SchemaRevision: isSet(object.SchemaRevision) ? BigInt(object.SchemaRevision) : 0n, RecordedAt: isSet(object.RecordedAt) ? SerializableDateTimeOffset.fromJSON(object.RecordedAt) : undefined, Due: isSet(object.Due) ? SerializableDateTimeOffset.fromJSON(object.Due) : undefined, State: isSet(object.State) ? occurrenceStateFromJSON(object.State) : 0, Attempts: isSet(object.Attempts) ? globalThis.Number(object.Attempts) : 0, Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, Owner: isSet(object.Owner) ? globalThis.String(object.Owner) : "", LeaseExpiry: isSet(object.LeaseExpiry) ? SerializableDateTimeOffset.fromJSON(object.LeaseExpiry) : undefined, LastError: isSet(object.LastError) ? globalThis.String(object.LastError) : "", NextAttempt: isSet(object.NextAttempt) ? SerializableDateTimeOffset.fromJSON(object.NextAttempt) : undefined, RetriedBy: isSet(object.RetriedBy) ? globalThis.String(object.RetriedBy) : "", RetriedAt: isSet(object.RetriedAt) ? SerializableDateTimeOffset.fromJSON(object.RetriedAt) : undefined, Receipts: globalThis.Array.isArray(object?.Receipts) ? object.Receipts.map((e: any) => OccurrenceEffectReceipt.fromJSON(e)) : [], }; }, toJSON(message: OccurrenceSnapshotResponse): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.Kind !== 0) { obj.Kind = occurrenceKindToJSON(message.Kind); } if (message.Payload !== "") { obj.Payload = message.Payload; } if (message.SchemaRevision !== 0n) { obj.SchemaRevision = message.SchemaRevision.toString(); } if (message.RecordedAt !== undefined) { obj.RecordedAt = SerializableDateTimeOffset.toJSON(message.RecordedAt); } if (message.Due !== undefined) { obj.Due = SerializableDateTimeOffset.toJSON(message.Due); } if (message.State !== 0) { obj.State = occurrenceStateToJSON(message.State); } if (message.Attempts !== 0) { obj.Attempts = Math.round(message.Attempts); } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.Owner !== "") { obj.Owner = message.Owner; } if (message.LeaseExpiry !== undefined) { obj.LeaseExpiry = SerializableDateTimeOffset.toJSON(message.LeaseExpiry); } if (message.LastError !== "") { obj.LastError = message.LastError; } if (message.NextAttempt !== undefined) { obj.NextAttempt = SerializableDateTimeOffset.toJSON(message.NextAttempt); } if (message.RetriedBy !== "") { obj.RetriedBy = message.RetriedBy; } if (message.RetriedAt !== undefined) { obj.RetriedAt = SerializableDateTimeOffset.toJSON(message.RetriedAt); } if (message.Receipts?.length) { obj.Receipts = message.Receipts.map((e) => OccurrenceEffectReceipt.toJSON(e)); } return obj; }, create(base?: DeepPartial): OccurrenceSnapshotResponse { return OccurrenceSnapshotResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): OccurrenceSnapshotResponse { const message = createBaseOccurrenceSnapshotResponse(); message.Id = object.Id ?? ""; message.Trigger = object.Trigger ?? ""; message.Kind = object.Kind ?? 0; message.Payload = object.Payload ?? ""; message.SchemaRevision = (object.SchemaRevision !== undefined && object.SchemaRevision !== null) ? BigInt(object.SchemaRevision) : 0n; message.RecordedAt = (object.RecordedAt !== undefined && object.RecordedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.RecordedAt) : undefined; message.Due = (object.Due !== undefined && object.Due !== null) ? SerializableDateTimeOffset.fromPartial(object.Due) : undefined; message.State = object.State ?? 0; message.Attempts = object.Attempts ?? 0; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.Owner = object.Owner ?? ""; message.LeaseExpiry = (object.LeaseExpiry !== undefined && object.LeaseExpiry !== null) ? SerializableDateTimeOffset.fromPartial(object.LeaseExpiry) : undefined; message.LastError = object.LastError ?? ""; message.NextAttempt = (object.NextAttempt !== undefined && object.NextAttempt !== null) ? SerializableDateTimeOffset.fromPartial(object.NextAttempt) : undefined; message.RetriedBy = object.RetriedBy ?? ""; message.RetriedAt = (object.RetriedAt !== undefined && object.RetriedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.RetriedAt) : undefined; message.Receipts = object.Receipts?.map((e) => OccurrenceEffectReceipt.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultEffectReceiptRecordResponse(): QueryResultEffectReceiptRecordResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultEffectReceiptRecordResponse: MessageFns = { encode(message: QueryResultEffectReceiptRecordResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.Data !== undefined) { EffectReceiptRecordResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultEffectReceiptRecordResponse { 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 = createBaseQueryResultEffectReceiptRecordResponse(); 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 = EffectReceiptRecordResponse.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): QueryResultEffectReceiptRecordResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: isSet(object.Data) ? EffectReceiptRecordResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultEffectReceiptRecordResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data !== undefined) { obj.Data = EffectReceiptRecordResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultEffectReceiptRecordResponse { return QueryResultEffectReceiptRecordResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultEffectReceiptRecordResponse { const message = createBaseQueryResultEffectReceiptRecordResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = (object.Data !== undefined && object.Data !== null) ? EffectReceiptRecordResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseQueryResultIEnumerableOccurrenceSnapshotResponse(): QueryResultIEnumerableOccurrenceSnapshotResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableOccurrenceSnapshotResponse: MessageFns< QueryResultIEnumerableOccurrenceSnapshotResponse > = { encode( message: QueryResultIEnumerableOccurrenceSnapshotResponse, 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) { OccurrenceSnapshotResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableOccurrenceSnapshotResponse { 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 = createBaseQueryResultIEnumerableOccurrenceSnapshotResponse(); 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(OccurrenceSnapshotResponse.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): QueryResultIEnumerableOccurrenceSnapshotResponse { 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) => OccurrenceSnapshotResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableOccurrenceSnapshotResponse): 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) => OccurrenceSnapshotResponse.toJSON(e)); } return obj; }, create( base?: DeepPartial, ): QueryResultIEnumerableOccurrenceSnapshotResponse { return QueryResultIEnumerableOccurrenceSnapshotResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableOccurrenceSnapshotResponse { const message = createBaseQueryResultIEnumerableOccurrenceSnapshotResponse(); 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) => OccurrenceSnapshotResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultOccurrenceSnapshotResponse(): QueryResultOccurrenceSnapshotResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultOccurrenceSnapshotResponse: MessageFns = { encode(message: QueryResultOccurrenceSnapshotResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.Data !== undefined) { OccurrenceSnapshotResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultOccurrenceSnapshotResponse { 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 = createBaseQueryResultOccurrenceSnapshotResponse(); 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 = OccurrenceSnapshotResponse.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): QueryResultOccurrenceSnapshotResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: isSet(object.Data) ? OccurrenceSnapshotResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultOccurrenceSnapshotResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data !== undefined) { obj.Data = OccurrenceSnapshotResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultOccurrenceSnapshotResponse { return QueryResultOccurrenceSnapshotResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultOccurrenceSnapshotResponse { const message = createBaseQueryResultOccurrenceSnapshotResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = (object.Data !== undefined && object.Data !== null) ? OccurrenceSnapshotResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseRecordEffectReceiptRequest(): RecordEffectReceiptRequest { return { EventStore: "", Namespace: "", EffectReceipt: undefined, Outcome: 0, Reasons: [] }; } export const RecordEffectReceiptRequest: MessageFns = { encode(message: RecordEffectReceiptRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.EffectReceipt !== undefined) { EffectReceipt.encode(message.EffectReceipt, writer.uint32(26).fork()).join(); } if (message.Outcome !== 0) { writer.uint32(32).int32(message.Outcome); } for (const v of message.Reasons) { writer.uint32(42).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RecordEffectReceiptRequest { 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 = createBaseRecordEffectReceiptRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.EffectReceipt = EffectReceipt.decode(reader, reader.uint32()); continue; } case 4: { if (tag !== 32) { break; } message.Outcome = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.Reasons.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): RecordEffectReceiptRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", EffectReceipt: isSet(object.EffectReceipt) ? EffectReceipt.fromJSON(object.EffectReceipt) : undefined, Outcome: isSet(object.Outcome) ? effectOutcomeFromJSON(object.Outcome) : 0, Reasons: globalThis.Array.isArray(object?.Reasons) ? object.Reasons.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: RecordEffectReceiptRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.EffectReceipt !== undefined) { obj.EffectReceipt = EffectReceipt.toJSON(message.EffectReceipt); } if (message.Outcome !== 0) { obj.Outcome = effectOutcomeToJSON(message.Outcome); } if (message.Reasons?.length) { obj.Reasons = message.Reasons; } return obj; }, create(base?: DeepPartial): RecordEffectReceiptRequest { return RecordEffectReceiptRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RecordEffectReceiptRequest { const message = createBaseRecordEffectReceiptRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.EffectReceipt = (object.EffectReceipt !== undefined && object.EffectReceipt !== null) ? EffectReceipt.fromPartial(object.EffectReceipt) : undefined; message.Outcome = object.Outcome ?? 0; message.Reasons = object.Reasons?.map((e) => e) || []; return message; }, }; function createBaseRecordEffectReceiptResponse(): RecordEffectReceiptResponse { return { Status: 0, Receipt: undefined }; } export const RecordEffectReceiptResponse: MessageFns = { encode(message: RecordEffectReceiptResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Status !== 0) { writer.uint32(8).int32(message.Status); } if (message.Receipt !== undefined) { EffectReceiptDetails.encode(message.Receipt, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RecordEffectReceiptResponse { 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 = createBaseRecordEffectReceiptResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Status = reader.int32() as any; continue; } case 2: { if (tag !== 18) { break; } message.Receipt = EffectReceiptDetails.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): RecordEffectReceiptResponse { return { Status: isSet(object.Status) ? effectReceiptStatusFromJSON(object.Status) : 0, Receipt: isSet(object.Receipt) ? EffectReceiptDetails.fromJSON(object.Receipt) : undefined, }; }, toJSON(message: RecordEffectReceiptResponse): unknown { const obj: any = {}; if (message.Status !== 0) { obj.Status = effectReceiptStatusToJSON(message.Status); } if (message.Receipt !== undefined) { obj.Receipt = EffectReceiptDetails.toJSON(message.Receipt); } return obj; }, create(base?: DeepPartial): RecordEffectReceiptResponse { return RecordEffectReceiptResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RecordEffectReceiptResponse { const message = createBaseRecordEffectReceiptResponse(); message.Status = object.Status ?? 0; message.Receipt = (object.Receipt !== undefined && object.Receipt !== null) ? EffectReceiptDetails.fromPartial(object.Receipt) : undefined; return message; }, }; function createBaseRecordLifecycleOccurrenceRequest(): RecordLifecycleOccurrenceRequest { return { EventStore: "", ActivationId: "", Kind: 0, AllNamespaces: false }; } export const RecordLifecycleOccurrenceRequest: MessageFns = { encode(message: RecordLifecycleOccurrenceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.ActivationId !== "") { writer.uint32(18).string(message.ActivationId); } if (message.Kind !== 0) { writer.uint32(24).int32(message.Kind); } if (message.AllNamespaces !== false) { writer.uint32(32).bool(message.AllNamespaces); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RecordLifecycleOccurrenceRequest { 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 = createBaseRecordLifecycleOccurrenceRequest(); 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.ActivationId = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Kind = reader.int32() as any; continue; } case 4: { if (tag !== 32) { break; } message.AllNamespaces = 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): RecordLifecycleOccurrenceRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", ActivationId: isSet(object.ActivationId) ? globalThis.String(object.ActivationId) : "", Kind: isSet(object.Kind) ? occurrenceKindFromJSON(object.Kind) : 0, AllNamespaces: isSet(object.AllNamespaces) ? globalThis.Boolean(object.AllNamespaces) : false, }; }, toJSON(message: RecordLifecycleOccurrenceRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.ActivationId !== "") { obj.ActivationId = message.ActivationId; } if (message.Kind !== 0) { obj.Kind = occurrenceKindToJSON(message.Kind); } if (message.AllNamespaces !== false) { obj.AllNamespaces = message.AllNamespaces; } return obj; }, create(base?: DeepPartial): RecordLifecycleOccurrenceRequest { return RecordLifecycleOccurrenceRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RecordLifecycleOccurrenceRequest { const message = createBaseRecordLifecycleOccurrenceRequest(); message.EventStore = object.EventStore ?? ""; message.ActivationId = object.ActivationId ?? ""; message.Kind = object.Kind ?? 0; message.AllNamespaces = object.AllNamespaces ?? false; return message; }, }; function createBaseRecordLifecycleOccurrenceResponse(): RecordLifecycleOccurrenceResponse { return { Id: "", Status: 0, Namespaces: [] }; } export const RecordLifecycleOccurrenceResponse: MessageFns = { encode(message: RecordLifecycleOccurrenceResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Status !== 0) { writer.uint32(16).int32(message.Status); } for (const v of message.Namespaces) { writer.uint32(26).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RecordLifecycleOccurrenceResponse { 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 = createBaseRecordLifecycleOccurrenceResponse(); 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.Status = reader.int32() as any; continue; } case 3: { if (tag !== 26) { break; } message.Namespaces.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): RecordLifecycleOccurrenceResponse { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Status: isSet(object.Status) ? occurrenceIngressStatusFromJSON(object.Status) : 0, Namespaces: globalThis.Array.isArray(object?.Namespaces) ? object.Namespaces.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: RecordLifecycleOccurrenceResponse): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Status !== 0) { obj.Status = occurrenceIngressStatusToJSON(message.Status); } if (message.Namespaces?.length) { obj.Namespaces = message.Namespaces; } return obj; }, create(base?: DeepPartial): RecordLifecycleOccurrenceResponse { return RecordLifecycleOccurrenceResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RecordLifecycleOccurrenceResponse { const message = createBaseRecordLifecycleOccurrenceResponse(); message.Id = object.Id ?? ""; message.Status = object.Status ?? 0; message.Namespaces = object.Namespaces?.map((e) => e) || []; return message; }, }; function createBaseRecordOccurrenceRequest(): RecordOccurrenceRequest { return { EventStore: "", Namespace: "", Trigger: "", IdempotencyId: "", Payload: "", Kind: 0, ApplicationScope: false, }; } export const RecordOccurrenceRequest: MessageFns = { encode(message: RecordOccurrenceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.Trigger !== "") { writer.uint32(26).string(message.Trigger); } if (message.IdempotencyId !== "") { writer.uint32(34).string(message.IdempotencyId); } if (message.Payload !== "") { writer.uint32(42).string(message.Payload); } if (message.Kind !== 0) { writer.uint32(48).int32(message.Kind); } if (message.ApplicationScope !== false) { writer.uint32(56).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RecordOccurrenceRequest { 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 = createBaseRecordOccurrenceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Trigger = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.IdempotencyId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Payload = reader.string(); continue; } case 6: { if (tag !== 48) { break; } message.Kind = reader.int32() as any; continue; } case 7: { if (tag !== 56) { break; } message.ApplicationScope = 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): RecordOccurrenceRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", IdempotencyId: isSet(object.IdempotencyId) ? globalThis.String(object.IdempotencyId) : "", Payload: isSet(object.Payload) ? globalThis.String(object.Payload) : "", Kind: isSet(object.Kind) ? occurrenceKindFromJSON(object.Kind) : 0, ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: RecordOccurrenceRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.IdempotencyId !== "") { obj.IdempotencyId = message.IdempotencyId; } if (message.Payload !== "") { obj.Payload = message.Payload; } if (message.Kind !== 0) { obj.Kind = occurrenceKindToJSON(message.Kind); } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): RecordOccurrenceRequest { return RecordOccurrenceRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RecordOccurrenceRequest { const message = createBaseRecordOccurrenceRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.Trigger = object.Trigger ?? ""; message.IdempotencyId = object.IdempotencyId ?? ""; message.Payload = object.Payload ?? ""; message.Kind = object.Kind ?? 0; message.ApplicationScope = object.ApplicationScope ?? false; return message; }, }; function createBaseRecordOccurrenceResponse(): RecordOccurrenceResponse { return { Id: "", Status: 0 }; } export const RecordOccurrenceResponse: MessageFns = { encode(message: RecordOccurrenceResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== "") { writer.uint32(10).string(message.Id); } if (message.Status !== 0) { writer.uint32(16).int32(message.Status); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RecordOccurrenceResponse { 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 = createBaseRecordOccurrenceResponse(); 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.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): RecordOccurrenceResponse { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Status: isSet(object.Status) ? occurrenceIngressStatusFromJSON(object.Status) : 0, }; }, toJSON(message: RecordOccurrenceResponse): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Status !== 0) { obj.Status = occurrenceIngressStatusToJSON(message.Status); } return obj; }, create(base?: DeepPartial): RecordOccurrenceResponse { return RecordOccurrenceResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RecordOccurrenceResponse { const message = createBaseRecordOccurrenceResponse(); message.Id = object.Id ?? ""; message.Status = object.Status ?? 0; return message; }, }; function createBaseRegisterTriggersRequest(): RegisterTriggersRequest { return { EventStore: "", Triggers: [] }; } export const RegisterTriggersRequest: MessageFns = { encode(message: RegisterTriggersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } for (const v of message.Triggers) { TriggerRegistration.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RegisterTriggersRequest { 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 = createBaseRegisterTriggersRequest(); 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.Triggers.push(TriggerRegistration.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): RegisterTriggersRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Triggers: globalThis.Array.isArray(object?.Triggers) ? object.Triggers.map((e: any) => TriggerRegistration.fromJSON(e)) : [], }; }, toJSON(message: RegisterTriggersRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Triggers?.length) { obj.Triggers = message.Triggers.map((e) => TriggerRegistration.toJSON(e)); } return obj; }, create(base?: DeepPartial): RegisterTriggersRequest { return RegisterTriggersRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RegisterTriggersRequest { const message = createBaseRegisterTriggersRequest(); message.EventStore = object.EventStore ?? ""; message.Triggers = object.Triggers?.map((e) => TriggerRegistration.fromPartial(e)) || []; return message; }, }; function createBaseRegisterTriggersResponse(): RegisterTriggersResponse { return { Registered: false, Errors: [] }; } export const RegisterTriggersResponse: MessageFns = { encode(message: RegisterTriggersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Registered !== false) { writer.uint32(8).bool(message.Registered); } for (const v of message.Errors) { writer.uint32(18).string(v!); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RegisterTriggersResponse { 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 = createBaseRegisterTriggersResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Registered = reader.bool(); continue; } case 2: { if (tag !== 18) { break; } message.Errors.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): RegisterTriggersResponse { return { Registered: isSet(object.Registered) ? globalThis.Boolean(object.Registered) : false, Errors: globalThis.Array.isArray(object?.Errors) ? object.Errors.map((e: any) => globalThis.String(e)) : [], }; }, toJSON(message: RegisterTriggersResponse): unknown { const obj: any = {}; if (message.Registered !== false) { obj.Registered = message.Registered; } if (message.Errors?.length) { obj.Errors = message.Errors; } return obj; }, create(base?: DeepPartial): RegisterTriggersResponse { return RegisterTriggersResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RegisterTriggersResponse { const message = createBaseRegisterTriggersResponse(); message.Registered = object.Registered ?? false; message.Errors = object.Errors?.map((e) => e) || []; return message; }, }; function createBaseRenewOccurrenceLeaseRequest(): RenewOccurrenceLeaseRequest { return { EventStore: "", Namespace: "", Trigger: "", OccurrenceId: "", Epoch: 0n, LeaseSeconds: 0, ApplicationScope: false, }; } export const RenewOccurrenceLeaseRequest: MessageFns = { encode(message: RenewOccurrenceLeaseRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.Trigger !== "") { writer.uint32(26).string(message.Trigger); } if (message.OccurrenceId !== "") { writer.uint32(34).string(message.OccurrenceId); } if (message.Epoch !== 0n) { if (BigInt.asIntN(64, message.Epoch) !== message.Epoch) { throw new globalThis.Error("value provided for field message.Epoch of type int64 too large"); } writer.uint32(40).int64(message.Epoch); } if (message.LeaseSeconds !== 0) { writer.uint32(48).int32(message.LeaseSeconds); } if (message.ApplicationScope !== false) { writer.uint32(56).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RenewOccurrenceLeaseRequest { 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 = createBaseRenewOccurrenceLeaseRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Trigger = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.OccurrenceId = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.Epoch = reader.int64() as bigint; continue; } case 6: { if (tag !== 48) { break; } message.LeaseSeconds = reader.int32(); continue; } case 7: { if (tag !== 56) { break; } message.ApplicationScope = 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): RenewOccurrenceLeaseRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", Epoch: isSet(object.Epoch) ? BigInt(object.Epoch) : 0n, LeaseSeconds: isSet(object.LeaseSeconds) ? globalThis.Number(object.LeaseSeconds) : 0, ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: RenewOccurrenceLeaseRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.Epoch !== 0n) { obj.Epoch = message.Epoch.toString(); } if (message.LeaseSeconds !== 0) { obj.LeaseSeconds = Math.round(message.LeaseSeconds); } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): RenewOccurrenceLeaseRequest { return RenewOccurrenceLeaseRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RenewOccurrenceLeaseRequest { const message = createBaseRenewOccurrenceLeaseRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.Trigger = object.Trigger ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.Epoch = (object.Epoch !== undefined && object.Epoch !== null) ? BigInt(object.Epoch) : 0n; message.LeaseSeconds = object.LeaseSeconds ?? 0; message.ApplicationScope = object.ApplicationScope ?? false; return message; }, }; function createBaseRetryQuarantinedOccurrenceRequest(): RetryQuarantinedOccurrenceRequest { return { EventStore: "", Namespace: "", Trigger: "", OccurrenceId: "", ApplicationScope: false }; } export const RetryQuarantinedOccurrenceRequest: MessageFns = { encode(message: RetryQuarantinedOccurrenceRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } if (message.Trigger !== "") { writer.uint32(26).string(message.Trigger); } if (message.OccurrenceId !== "") { writer.uint32(34).string(message.OccurrenceId); } if (message.ApplicationScope !== false) { writer.uint32(40).bool(message.ApplicationScope); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RetryQuarantinedOccurrenceRequest { 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 = createBaseRetryQuarantinedOccurrenceRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Trigger = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.OccurrenceId = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.ApplicationScope = 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): RetryQuarantinedOccurrenceRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Trigger: isSet(object.Trigger) ? globalThis.String(object.Trigger) : "", OccurrenceId: isSet(object.OccurrenceId) ? globalThis.String(object.OccurrenceId) : "", ApplicationScope: isSet(object.ApplicationScope) ? globalThis.Boolean(object.ApplicationScope) : false, }; }, toJSON(message: RetryQuarantinedOccurrenceRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Trigger !== "") { obj.Trigger = message.Trigger; } if (message.OccurrenceId !== "") { obj.OccurrenceId = message.OccurrenceId; } if (message.ApplicationScope !== false) { obj.ApplicationScope = message.ApplicationScope; } return obj; }, create(base?: DeepPartial): RetryQuarantinedOccurrenceRequest { return RetryQuarantinedOccurrenceRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RetryQuarantinedOccurrenceRequest { const message = createBaseRetryQuarantinedOccurrenceRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.Trigger = object.Trigger ?? ""; message.OccurrenceId = object.OccurrenceId ?? ""; message.ApplicationScope = object.ApplicationScope ?? false; 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 createBaseTriggerRegistration(): TriggerRegistration { return { Id: "", Name: "", Schema: "" }; } export const TriggerRegistration: MessageFns = { encode(message: TriggerRegistration, 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.Schema !== "") { writer.uint32(26).string(message.Schema); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): TriggerRegistration { 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 = createBaseTriggerRegistration(); 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.Schema = 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): TriggerRegistration { return { Id: isSet(object.Id) ? globalThis.String(object.Id) : "", Name: isSet(object.Name) ? globalThis.String(object.Name) : "", Schema: isSet(object.Schema) ? globalThis.String(object.Schema) : "", }; }, toJSON(message: TriggerRegistration): unknown { const obj: any = {}; if (message.Id !== "") { obj.Id = message.Id; } if (message.Name !== "") { obj.Name = message.Name; } if (message.Schema !== "") { obj.Schema = message.Schema; } return obj; }, create(base?: DeepPartial): TriggerRegistration { return TriggerRegistration.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): TriggerRegistration { const message = createBaseTriggerRegistration(); message.Id = object.Id ?? ""; message.Name = object.Name ?? ""; message.Schema = object.Schema ?? ""; 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 OccurrencesDefinition = typeof OccurrencesDefinition; export const OccurrencesDefinition = { name: "Occurrences", fullName: "Cratis.Chronicle.Contracts.Occurrences.Occurrences", methods: { claimOccurrences: { name: "ClaimOccurrences", requestType: ClaimOccurrencesRequest as typeof ClaimOccurrencesRequest, requestStream: false, responseType: CommandResultClaimOccurrencesResponse as typeof CommandResultClaimOccurrencesResponse, responseStream: false, options: {}, }, completeOccurrence: { name: "CompleteOccurrence", requestType: CompleteOccurrenceRequest as typeof CompleteOccurrenceRequest, requestStream: false, responseType: CommandResultCompleteOccurrenceResponse as typeof CommandResultCompleteOccurrenceResponse, responseStream: false, options: {}, }, failOccurrence: { name: "FailOccurrence", requestType: FailOccurrenceRequest as typeof FailOccurrenceRequest, requestStream: false, responseType: CommandResultCompleteOccurrenceResponse as typeof CommandResultCompleteOccurrenceResponse, responseStream: false, options: {}, }, getEffectReceipt: { name: "GetEffectReceipt", requestType: GetEffectReceiptRequest as typeof GetEffectReceiptRequest, requestStream: false, responseType: QueryResultEffectReceiptRecordResponse as typeof QueryResultEffectReceiptRecordResponse, responseStream: false, options: {}, }, getOccurrence: { name: "GetOccurrence", requestType: GetOccurrenceRequest as typeof GetOccurrenceRequest, requestStream: false, responseType: QueryResultOccurrenceSnapshotResponse as typeof QueryResultOccurrenceSnapshotResponse, responseStream: false, options: {}, }, observeOccurrences: { name: "ObserveOccurrences", requestType: ObserveOccurrencesRequest as typeof ObserveOccurrencesRequest, requestStream: false, responseType: QueryResultIEnumerableOccurrenceSnapshotResponse as typeof QueryResultIEnumerableOccurrenceSnapshotResponse, responseStream: true, options: {}, }, recordEffectReceipt: { name: "RecordEffectReceipt", requestType: RecordEffectReceiptRequest as typeof RecordEffectReceiptRequest, requestStream: false, responseType: CommandResultRecordEffectReceiptResponse as typeof CommandResultRecordEffectReceiptResponse, responseStream: false, options: {}, }, recordLifecycleOccurrence: { name: "RecordLifecycleOccurrence", requestType: RecordLifecycleOccurrenceRequest as typeof RecordLifecycleOccurrenceRequest, requestStream: false, responseType: CommandResultRecordLifecycleOccurrenceResponse as typeof CommandResultRecordLifecycleOccurrenceResponse, responseStream: false, options: {}, }, recordOccurrence: { name: "RecordOccurrence", requestType: RecordOccurrenceRequest as typeof RecordOccurrenceRequest, requestStream: false, responseType: CommandResultRecordOccurrenceResponse as typeof CommandResultRecordOccurrenceResponse, responseStream: false, options: {}, }, registerTriggers: { name: "RegisterTriggers", requestType: RegisterTriggersRequest as typeof RegisterTriggersRequest, requestStream: false, responseType: CommandResultRegisterTriggersResponse as typeof CommandResultRegisterTriggersResponse, responseStream: false, options: {}, }, renewOccurrenceLease: { name: "RenewOccurrenceLease", requestType: RenewOccurrenceLeaseRequest as typeof RenewOccurrenceLeaseRequest, requestStream: false, responseType: CommandResultCompleteOccurrenceResponse as typeof CommandResultCompleteOccurrenceResponse, responseStream: false, options: {}, }, retryQuarantinedOccurrence: { name: "RetryQuarantinedOccurrence", requestType: RetryQuarantinedOccurrenceRequest as typeof RetryQuarantinedOccurrenceRequest, requestStream: false, responseType: CommandResultBoolean as typeof CommandResultBoolean, responseStream: false, options: {}, }, }, } as const; export interface OccurrencesServiceImplementation { claimOccurrences( request: ClaimOccurrencesRequest, context: CallContext & CallContextExt, ): Promise>; completeOccurrence( request: CompleteOccurrenceRequest, context: CallContext & CallContextExt, ): Promise>; failOccurrence( request: FailOccurrenceRequest, context: CallContext & CallContextExt, ): Promise>; getEffectReceipt( request: GetEffectReceiptRequest, context: CallContext & CallContextExt, ): Promise>; getOccurrence( request: GetOccurrenceRequest, context: CallContext & CallContextExt, ): Promise>; observeOccurrences( request: ObserveOccurrencesRequest, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; recordEffectReceipt( request: RecordEffectReceiptRequest, context: CallContext & CallContextExt, ): Promise>; recordLifecycleOccurrence( request: RecordLifecycleOccurrenceRequest, context: CallContext & CallContextExt, ): Promise>; recordOccurrence( request: RecordOccurrenceRequest, context: CallContext & CallContextExt, ): Promise>; registerTriggers( request: RegisterTriggersRequest, context: CallContext & CallContextExt, ): Promise>; renewOccurrenceLease( request: RenewOccurrenceLeaseRequest, context: CallContext & CallContextExt, ): Promise>; retryQuarantinedOccurrence( request: RetryQuarantinedOccurrenceRequest, context: CallContext & CallContextExt, ): Promise>; } export interface OccurrencesClient { claimOccurrences( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; completeOccurrence( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; failOccurrence( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getEffectReceipt( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getOccurrence( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; observeOccurrences( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; recordEffectReceipt( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; recordLifecycleOccurrence( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; recordOccurrence( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; registerTriggers( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; renewOccurrenceLease( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; retryQuarantinedOccurrence( 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 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; }