// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.15.3 // protoc v5.28.3 // source: alerts.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.Alerts"; export enum AlertIncidentsReadinessState { CatchingUp = 0, Ready = 1, Degraded = 2, UNRECOGNIZED = -1, } export function alertIncidentsReadinessStateFromJSON(object: any): AlertIncidentsReadinessState { switch (object) { case 0: case "CatchingUp": return AlertIncidentsReadinessState.CatchingUp; case 1: case "Ready": return AlertIncidentsReadinessState.Ready; case 2: case "Degraded": return AlertIncidentsReadinessState.Degraded; case -1: case "UNRECOGNIZED": default: return AlertIncidentsReadinessState.UNRECOGNIZED; } } export function alertIncidentsReadinessStateToJSON(object: AlertIncidentsReadinessState): string { switch (object) { case AlertIncidentsReadinessState.CatchingUp: return "CatchingUp"; case AlertIncidentsReadinessState.Ready: return "Ready"; case AlertIncidentsReadinessState.Degraded: return "Degraded"; case AlertIncidentsReadinessState.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum AlertSeverity { ALERT_SEVERITY_Warning = 0, Critical = 1, UNRECOGNIZED = -1, } export function alertSeverityFromJSON(object: any): AlertSeverity { switch (object) { case 0: case "ALERT_SEVERITY_Warning": return AlertSeverity.ALERT_SEVERITY_Warning; case 1: case "Critical": return AlertSeverity.Critical; case -1: case "UNRECOGNIZED": default: return AlertSeverity.UNRECOGNIZED; } } export function alertSeverityToJSON(object: AlertSeverity): string { switch (object) { case AlertSeverity.ALERT_SEVERITY_Warning: return "ALERT_SEVERITY_Warning"; case AlertSeverity.Critical: return "Critical"; case AlertSeverity.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum FailureKind { FAILURE_KIND_Unknown = 0, Handling = 1, Timeout = 2, Disconnected = 3, UNRECOGNIZED = -1, } export function failureKindFromJSON(object: any): FailureKind { switch (object) { case 0: case "FAILURE_KIND_Unknown": return FailureKind.FAILURE_KIND_Unknown; case 1: case "Handling": return FailureKind.Handling; case 2: case "Timeout": return FailureKind.Timeout; case 3: case "Disconnected": return FailureKind.Disconnected; case -1: case "UNRECOGNIZED": default: return FailureKind.UNRECOGNIZED; } } export function failureKindToJSON(object: FailureKind): string { switch (object) { case FailureKind.FAILURE_KIND_Unknown: return "FAILURE_KIND_Unknown"; case FailureKind.Handling: return "Handling"; case FailureKind.Timeout: return "Timeout"; case FailureKind.Disconnected: return "Disconnected"; case FailureKind.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ValidationResultSeverity { VALIDATION_RESULT_SEVERITY_Unknown = 0, Information = 1, VALIDATION_RESULT_SEVERITY_Warning = 2, Error = 3, UNRECOGNIZED = -1, } export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity { switch (object) { case 0: case "VALIDATION_RESULT_SEVERITY_Unknown": return ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown; case 1: case "Information": return ValidationResultSeverity.Information; case 2: case "VALIDATION_RESULT_SEVERITY_Warning": return ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Warning; case 3: case "Error": return ValidationResultSeverity.Error; case -1: case "UNRECOGNIZED": default: return ValidationResultSeverity.UNRECOGNIZED; } } export function validationResultSeverityToJSON(object: ValidationResultSeverity): string { switch (object) { case ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown: return "VALIDATION_RESULT_SEVERITY_Unknown"; case ValidationResultSeverity.Information: return "Information"; case ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Warning: return "VALIDATION_RESULT_SEVERITY_Warning"; case ValidationResultSeverity.Error: return "Error"; case ValidationResultSeverity.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface AlertEvidence { AttemptCount: number; FirstFailure: SerializableDateTimeOffset | undefined; LastFailure: SerializableDateTimeOffset | undefined; FailureKind: FailureKind; Message: string; } export interface AlertIncidentContinuation { RaisedSequenceNumber: bigint; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ IncidentId: Guid | undefined; } export interface AlertIncidentCountDetails { Namespace: string; Condition: string; Severity: AlertSeverity; Count: bigint; } export interface AlertIncidentDetails { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; Target: AlertTarget | undefined; Condition: string; Severity: AlertSeverity; Evidence: AlertEvidence | undefined; RaisedAt: SerializableDateTimeOffset | undefined; LastChangedAt: SerializableDateTimeOffset | undefined; RaisedSequenceNumber: bigint; LastTransitionSequenceNumber: bigint; } export interface AlertIncidentLookupResponse { Status: AlertIncidentsReadinessState; Incident: AlertIncidentDetails | undefined; } export interface AlertIncidentPageResponse { Status: AlertIncidentsReadinessState; Items: AlertIncidentDetails[]; Next: AlertIncidentContinuation | undefined; } export interface AlertIncidentSummaryResponse { Status: AlertIncidentsReadinessState; Counts: AlertIncidentCountDetails[]; } export interface AlertTarget { EventStore: string; Namespace: string; ObserverId: string; EventSequenceId: string; Partition: string; } export interface GetOpenIncidentCountsRequest { EventStore: string; Namespace: string; } export interface GetOpenIncidentRequest { EventStore: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ IncidentId: Guid | undefined; Namespace: string; } export interface GetOpenIncidentsRequest { EventStore: string; Namespace: string; ObserverId: string; Condition: string; MinimumSeverity: AlertSeverity; Limit: number; AfterRaisedSequenceNumber: bigint; AfterIncidentId: Guid | undefined; } export interface QueryResultAlertIncidentLookupResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: AlertIncidentLookupResponse | undefined; } export interface QueryResultAlertIncidentPageResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: AlertIncidentPageResponse | undefined; } export interface QueryResultAlertIncidentSummaryResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: AlertIncidentSummaryResponse | undefined; } /** Represents a DateTimeOffset value as an ISO 8601 string (e.g., "2024-01-15T12:30:00.0000000+02:00"). */ export interface SerializableDateTimeOffset { Value: string; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseAlertEvidence(): AlertEvidence { return { AttemptCount: 0, FirstFailure: undefined, LastFailure: undefined, FailureKind: 0, Message: "" }; } export const AlertEvidence: MessageFns = { encode(message: AlertEvidence, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.AttemptCount !== 0) { writer.uint32(8).int32(message.AttemptCount); } if (message.FirstFailure !== undefined) { SerializableDateTimeOffset.encode(message.FirstFailure, writer.uint32(18).fork()).join(); } if (message.LastFailure !== undefined) { SerializableDateTimeOffset.encode(message.LastFailure, writer.uint32(26).fork()).join(); } if (message.FailureKind !== 0) { writer.uint32(32).int32(message.FailureKind); } if (message.Message !== "") { writer.uint32(42).string(message.Message); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertEvidence { 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 = createBaseAlertEvidence(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.AttemptCount = reader.int32(); continue; } case 2: { if (tag !== 18) { break; } message.FirstFailure = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.LastFailure = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 4: { if (tag !== 32) { break; } message.FailureKind = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.Message = 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): AlertEvidence { return { AttemptCount: isSet(object.AttemptCount) ? globalThis.Number(object.AttemptCount) : 0, FirstFailure: isSet(object.FirstFailure) ? SerializableDateTimeOffset.fromJSON(object.FirstFailure) : undefined, LastFailure: isSet(object.LastFailure) ? SerializableDateTimeOffset.fromJSON(object.LastFailure) : undefined, FailureKind: isSet(object.FailureKind) ? failureKindFromJSON(object.FailureKind) : 0, Message: isSet(object.Message) ? globalThis.String(object.Message) : "", }; }, toJSON(message: AlertEvidence): unknown { const obj: any = {}; if (message.AttemptCount !== 0) { obj.AttemptCount = Math.round(message.AttemptCount); } if (message.FirstFailure !== undefined) { obj.FirstFailure = SerializableDateTimeOffset.toJSON(message.FirstFailure); } if (message.LastFailure !== undefined) { obj.LastFailure = SerializableDateTimeOffset.toJSON(message.LastFailure); } if (message.FailureKind !== 0) { obj.FailureKind = failureKindToJSON(message.FailureKind); } if (message.Message !== "") { obj.Message = message.Message; } return obj; }, create(base?: DeepPartial): AlertEvidence { return AlertEvidence.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertEvidence { const message = createBaseAlertEvidence(); message.AttemptCount = object.AttemptCount ?? 0; message.FirstFailure = (object.FirstFailure !== undefined && object.FirstFailure !== null) ? SerializableDateTimeOffset.fromPartial(object.FirstFailure) : undefined; message.LastFailure = (object.LastFailure !== undefined && object.LastFailure !== null) ? SerializableDateTimeOffset.fromPartial(object.LastFailure) : undefined; message.FailureKind = object.FailureKind ?? 0; message.Message = object.Message ?? ""; return message; }, }; function createBaseAlertIncidentContinuation(): AlertIncidentContinuation { return { RaisedSequenceNumber: 0n, IncidentId: undefined }; } export const AlertIncidentContinuation: MessageFns = { encode(message: AlertIncidentContinuation, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.RaisedSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.RaisedSequenceNumber) !== message.RaisedSequenceNumber) { throw new globalThis.Error("value provided for field message.RaisedSequenceNumber of type uint64 too large"); } writer.uint32(8).uint64(message.RaisedSequenceNumber); } if (message.IncidentId !== undefined) { Guid.encode(message.IncidentId, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertIncidentContinuation { 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 = createBaseAlertIncidentContinuation(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.RaisedSequenceNumber = reader.uint64() as bigint; continue; } case 2: { if (tag !== 18) { break; } message.IncidentId = Guid.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AlertIncidentContinuation { return { RaisedSequenceNumber: isSet(object.RaisedSequenceNumber) ? BigInt(object.RaisedSequenceNumber) : 0n, IncidentId: isSet(object.IncidentId) ? Guid.fromJSON(object.IncidentId) : undefined, }; }, toJSON(message: AlertIncidentContinuation): unknown { const obj: any = {}; if (message.RaisedSequenceNumber !== 0n) { obj.RaisedSequenceNumber = message.RaisedSequenceNumber.toString(); } if (message.IncidentId !== undefined) { obj.IncidentId = Guid.toJSON(message.IncidentId); } return obj; }, create(base?: DeepPartial): AlertIncidentContinuation { return AlertIncidentContinuation.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertIncidentContinuation { const message = createBaseAlertIncidentContinuation(); message.RaisedSequenceNumber = (object.RaisedSequenceNumber !== undefined && object.RaisedSequenceNumber !== null) ? BigInt(object.RaisedSequenceNumber) : 0n; message.IncidentId = (object.IncidentId !== undefined && object.IncidentId !== null) ? Guid.fromPartial(object.IncidentId) : undefined; return message; }, }; function createBaseAlertIncidentCountDetails(): AlertIncidentCountDetails { return { Namespace: "", Condition: "", Severity: 0, Count: 0n }; } export const AlertIncidentCountDetails: MessageFns = { encode(message: AlertIncidentCountDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Namespace !== "") { writer.uint32(10).string(message.Namespace); } if (message.Condition !== "") { writer.uint32(18).string(message.Condition); } if (message.Severity !== 0) { writer.uint32(24).int32(message.Severity); } if (message.Count !== 0n) { if (BigInt.asIntN(64, message.Count) !== message.Count) { throw new globalThis.Error("value provided for field message.Count of type int64 too large"); } writer.uint32(32).int64(message.Count); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertIncidentCountDetails { 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 = createBaseAlertIncidentCountDetails(); 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.Condition = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.Severity = reader.int32() as any; continue; } case 4: { if (tag !== 32) { break; } message.Count = reader.int64() as bigint; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AlertIncidentCountDetails { return { Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", Condition: isSet(object.Condition) ? globalThis.String(object.Condition) : "", Severity: isSet(object.Severity) ? alertSeverityFromJSON(object.Severity) : 0, Count: isSet(object.Count) ? BigInt(object.Count) : 0n, }; }, toJSON(message: AlertIncidentCountDetails): unknown { const obj: any = {}; if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.Condition !== "") { obj.Condition = message.Condition; } if (message.Severity !== 0) { obj.Severity = alertSeverityToJSON(message.Severity); } if (message.Count !== 0n) { obj.Count = message.Count.toString(); } return obj; }, create(base?: DeepPartial): AlertIncidentCountDetails { return AlertIncidentCountDetails.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertIncidentCountDetails { const message = createBaseAlertIncidentCountDetails(); message.Namespace = object.Namespace ?? ""; message.Condition = object.Condition ?? ""; message.Severity = object.Severity ?? 0; message.Count = (object.Count !== undefined && object.Count !== null) ? BigInt(object.Count) : 0n; return message; }, }; function createBaseAlertIncidentDetails(): AlertIncidentDetails { return { Id: undefined, Target: undefined, Condition: "", Severity: 0, Evidence: undefined, RaisedAt: undefined, LastChangedAt: undefined, RaisedSequenceNumber: 0n, LastTransitionSequenceNumber: 0n, }; } export const AlertIncidentDetails: MessageFns = { encode(message: AlertIncidentDetails, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.Target !== undefined) { AlertTarget.encode(message.Target, writer.uint32(18).fork()).join(); } if (message.Condition !== "") { writer.uint32(26).string(message.Condition); } if (message.Severity !== 0) { writer.uint32(32).int32(message.Severity); } if (message.Evidence !== undefined) { AlertEvidence.encode(message.Evidence, writer.uint32(42).fork()).join(); } if (message.RaisedAt !== undefined) { SerializableDateTimeOffset.encode(message.RaisedAt, writer.uint32(50).fork()).join(); } if (message.LastChangedAt !== undefined) { SerializableDateTimeOffset.encode(message.LastChangedAt, writer.uint32(58).fork()).join(); } if (message.RaisedSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.RaisedSequenceNumber) !== message.RaisedSequenceNumber) { throw new globalThis.Error("value provided for field message.RaisedSequenceNumber of type uint64 too large"); } writer.uint32(64).uint64(message.RaisedSequenceNumber); } if (message.LastTransitionSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.LastTransitionSequenceNumber) !== message.LastTransitionSequenceNumber) { throw new globalThis.Error( "value provided for field message.LastTransitionSequenceNumber of type uint64 too large", ); } writer.uint32(72).uint64(message.LastTransitionSequenceNumber); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertIncidentDetails { 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 = createBaseAlertIncidentDetails(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Id = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Target = AlertTarget.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.Condition = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.Severity = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.Evidence = AlertEvidence.decode(reader, reader.uint32()); continue; } case 6: { if (tag !== 50) { break; } message.RaisedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 7: { if (tag !== 58) { break; } message.LastChangedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 8: { if (tag !== 64) { break; } message.RaisedSequenceNumber = reader.uint64() as bigint; continue; } case 9: { if (tag !== 72) { break; } message.LastTransitionSequenceNumber = reader.uint64() as bigint; continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): AlertIncidentDetails { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, Target: isSet(object.Target) ? AlertTarget.fromJSON(object.Target) : undefined, Condition: isSet(object.Condition) ? globalThis.String(object.Condition) : "", Severity: isSet(object.Severity) ? alertSeverityFromJSON(object.Severity) : 0, Evidence: isSet(object.Evidence) ? AlertEvidence.fromJSON(object.Evidence) : undefined, RaisedAt: isSet(object.RaisedAt) ? SerializableDateTimeOffset.fromJSON(object.RaisedAt) : undefined, LastChangedAt: isSet(object.LastChangedAt) ? SerializableDateTimeOffset.fromJSON(object.LastChangedAt) : undefined, RaisedSequenceNumber: isSet(object.RaisedSequenceNumber) ? BigInt(object.RaisedSequenceNumber) : 0n, LastTransitionSequenceNumber: isSet(object.LastTransitionSequenceNumber) ? BigInt(object.LastTransitionSequenceNumber) : 0n, }; }, toJSON(message: AlertIncidentDetails): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.Target !== undefined) { obj.Target = AlertTarget.toJSON(message.Target); } if (message.Condition !== "") { obj.Condition = message.Condition; } if (message.Severity !== 0) { obj.Severity = alertSeverityToJSON(message.Severity); } if (message.Evidence !== undefined) { obj.Evidence = AlertEvidence.toJSON(message.Evidence); } if (message.RaisedAt !== undefined) { obj.RaisedAt = SerializableDateTimeOffset.toJSON(message.RaisedAt); } if (message.LastChangedAt !== undefined) { obj.LastChangedAt = SerializableDateTimeOffset.toJSON(message.LastChangedAt); } if (message.RaisedSequenceNumber !== 0n) { obj.RaisedSequenceNumber = message.RaisedSequenceNumber.toString(); } if (message.LastTransitionSequenceNumber !== 0n) { obj.LastTransitionSequenceNumber = message.LastTransitionSequenceNumber.toString(); } return obj; }, create(base?: DeepPartial): AlertIncidentDetails { return AlertIncidentDetails.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertIncidentDetails { const message = createBaseAlertIncidentDetails(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.Target = (object.Target !== undefined && object.Target !== null) ? AlertTarget.fromPartial(object.Target) : undefined; message.Condition = object.Condition ?? ""; message.Severity = object.Severity ?? 0; message.Evidence = (object.Evidence !== undefined && object.Evidence !== null) ? AlertEvidence.fromPartial(object.Evidence) : undefined; message.RaisedAt = (object.RaisedAt !== undefined && object.RaisedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.RaisedAt) : undefined; message.LastChangedAt = (object.LastChangedAt !== undefined && object.LastChangedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.LastChangedAt) : undefined; message.RaisedSequenceNumber = (object.RaisedSequenceNumber !== undefined && object.RaisedSequenceNumber !== null) ? BigInt(object.RaisedSequenceNumber) : 0n; message.LastTransitionSequenceNumber = (object.LastTransitionSequenceNumber !== undefined && object.LastTransitionSequenceNumber !== null) ? BigInt(object.LastTransitionSequenceNumber) : 0n; return message; }, }; function createBaseAlertIncidentLookupResponse(): AlertIncidentLookupResponse { return { Status: 0, Incident: undefined }; } export const AlertIncidentLookupResponse: MessageFns = { encode(message: AlertIncidentLookupResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Status !== 0) { writer.uint32(8).int32(message.Status); } if (message.Incident !== undefined) { AlertIncidentDetails.encode(message.Incident, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertIncidentLookupResponse { 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 = createBaseAlertIncidentLookupResponse(); 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.Incident = AlertIncidentDetails.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): AlertIncidentLookupResponse { return { Status: isSet(object.Status) ? alertIncidentsReadinessStateFromJSON(object.Status) : 0, Incident: isSet(object.Incident) ? AlertIncidentDetails.fromJSON(object.Incident) : undefined, }; }, toJSON(message: AlertIncidentLookupResponse): unknown { const obj: any = {}; if (message.Status !== 0) { obj.Status = alertIncidentsReadinessStateToJSON(message.Status); } if (message.Incident !== undefined) { obj.Incident = AlertIncidentDetails.toJSON(message.Incident); } return obj; }, create(base?: DeepPartial): AlertIncidentLookupResponse { return AlertIncidentLookupResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertIncidentLookupResponse { const message = createBaseAlertIncidentLookupResponse(); message.Status = object.Status ?? 0; message.Incident = (object.Incident !== undefined && object.Incident !== null) ? AlertIncidentDetails.fromPartial(object.Incident) : undefined; return message; }, }; function createBaseAlertIncidentPageResponse(): AlertIncidentPageResponse { return { Status: 0, Items: [], Next: undefined }; } export const AlertIncidentPageResponse: MessageFns = { encode(message: AlertIncidentPageResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Status !== 0) { writer.uint32(8).int32(message.Status); } for (const v of message.Items) { AlertIncidentDetails.encode(v!, writer.uint32(18).fork()).join(); } if (message.Next !== undefined) { AlertIncidentContinuation.encode(message.Next, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertIncidentPageResponse { 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 = createBaseAlertIncidentPageResponse(); 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.Items.push(AlertIncidentDetails.decode(reader, reader.uint32())); continue; } case 3: { if (tag !== 26) { break; } message.Next = AlertIncidentContinuation.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): AlertIncidentPageResponse { return { Status: isSet(object.Status) ? alertIncidentsReadinessStateFromJSON(object.Status) : 0, Items: globalThis.Array.isArray(object?.Items) ? object.Items.map((e: any) => AlertIncidentDetails.fromJSON(e)) : [], Next: isSet(object.Next) ? AlertIncidentContinuation.fromJSON(object.Next) : undefined, }; }, toJSON(message: AlertIncidentPageResponse): unknown { const obj: any = {}; if (message.Status !== 0) { obj.Status = alertIncidentsReadinessStateToJSON(message.Status); } if (message.Items?.length) { obj.Items = message.Items.map((e) => AlertIncidentDetails.toJSON(e)); } if (message.Next !== undefined) { obj.Next = AlertIncidentContinuation.toJSON(message.Next); } return obj; }, create(base?: DeepPartial): AlertIncidentPageResponse { return AlertIncidentPageResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertIncidentPageResponse { const message = createBaseAlertIncidentPageResponse(); message.Status = object.Status ?? 0; message.Items = object.Items?.map((e) => AlertIncidentDetails.fromPartial(e)) || []; message.Next = (object.Next !== undefined && object.Next !== null) ? AlertIncidentContinuation.fromPartial(object.Next) : undefined; return message; }, }; function createBaseAlertIncidentSummaryResponse(): AlertIncidentSummaryResponse { return { Status: 0, Counts: [] }; } export const AlertIncidentSummaryResponse: MessageFns = { encode(message: AlertIncidentSummaryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Status !== 0) { writer.uint32(8).int32(message.Status); } for (const v of message.Counts) { AlertIncidentCountDetails.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertIncidentSummaryResponse { 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 = createBaseAlertIncidentSummaryResponse(); 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.Counts.push(AlertIncidentCountDetails.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): AlertIncidentSummaryResponse { return { Status: isSet(object.Status) ? alertIncidentsReadinessStateFromJSON(object.Status) : 0, Counts: globalThis.Array.isArray(object?.Counts) ? object.Counts.map((e: any) => AlertIncidentCountDetails.fromJSON(e)) : [], }; }, toJSON(message: AlertIncidentSummaryResponse): unknown { const obj: any = {}; if (message.Status !== 0) { obj.Status = alertIncidentsReadinessStateToJSON(message.Status); } if (message.Counts?.length) { obj.Counts = message.Counts.map((e) => AlertIncidentCountDetails.toJSON(e)); } return obj; }, create(base?: DeepPartial): AlertIncidentSummaryResponse { return AlertIncidentSummaryResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertIncidentSummaryResponse { const message = createBaseAlertIncidentSummaryResponse(); message.Status = object.Status ?? 0; message.Counts = object.Counts?.map((e) => AlertIncidentCountDetails.fromPartial(e)) || []; return message; }, }; function createBaseAlertTarget(): AlertTarget { return { EventStore: "", Namespace: "", ObserverId: "", EventSequenceId: "", Partition: "" }; } export const AlertTarget: MessageFns = { encode(message: AlertTarget, 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.ObserverId !== "") { writer.uint32(26).string(message.ObserverId); } if (message.EventSequenceId !== "") { writer.uint32(34).string(message.EventSequenceId); } if (message.Partition !== "") { writer.uint32(42).string(message.Partition); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AlertTarget { 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 = createBaseAlertTarget(); 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.ObserverId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.EventSequenceId = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Partition = 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): AlertTarget { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", ObserverId: isSet(object.ObserverId) ? globalThis.String(object.ObserverId) : "", EventSequenceId: isSet(object.EventSequenceId) ? globalThis.String(object.EventSequenceId) : "", Partition: isSet(object.Partition) ? globalThis.String(object.Partition) : "", }; }, toJSON(message: AlertTarget): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.ObserverId !== "") { obj.ObserverId = message.ObserverId; } if (message.EventSequenceId !== "") { obj.EventSequenceId = message.EventSequenceId; } if (message.Partition !== "") { obj.Partition = message.Partition; } return obj; }, create(base?: DeepPartial): AlertTarget { return AlertTarget.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AlertTarget { const message = createBaseAlertTarget(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.ObserverId = object.ObserverId ?? ""; message.EventSequenceId = object.EventSequenceId ?? ""; message.Partition = object.Partition ?? ""; return message; }, }; function createBaseGetOpenIncidentCountsRequest(): GetOpenIncidentCountsRequest { return { EventStore: "", Namespace: "" }; } export const GetOpenIncidentCountsRequest: MessageFns = { encode(message: GetOpenIncidentCountsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.Namespace !== "") { writer.uint32(18).string(message.Namespace); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetOpenIncidentCountsRequest { 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 = createBaseGetOpenIncidentCountsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.EventStore = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.Namespace = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): GetOpenIncidentCountsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: GetOpenIncidentCountsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): GetOpenIncidentCountsRequest { return GetOpenIncidentCountsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetOpenIncidentCountsRequest { const message = createBaseGetOpenIncidentCountsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; return message; }, }; function createBaseGetOpenIncidentRequest(): GetOpenIncidentRequest { return { EventStore: "", IncidentId: undefined, Namespace: "" }; } export const GetOpenIncidentRequest: MessageFns = { encode(message: GetOpenIncidentRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.EventStore !== "") { writer.uint32(10).string(message.EventStore); } if (message.IncidentId !== undefined) { Guid.encode(message.IncidentId, writer.uint32(18).fork()).join(); } if (message.Namespace !== "") { writer.uint32(26).string(message.Namespace); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetOpenIncidentRequest { 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 = createBaseGetOpenIncidentRequest(); 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.IncidentId = Guid.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.Namespace = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): GetOpenIncidentRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", IncidentId: isSet(object.IncidentId) ? Guid.fromJSON(object.IncidentId) : undefined, Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: GetOpenIncidentRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.IncidentId !== undefined) { obj.IncidentId = Guid.toJSON(message.IncidentId); } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): GetOpenIncidentRequest { return GetOpenIncidentRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetOpenIncidentRequest { const message = createBaseGetOpenIncidentRequest(); message.EventStore = object.EventStore ?? ""; message.IncidentId = (object.IncidentId !== undefined && object.IncidentId !== null) ? Guid.fromPartial(object.IncidentId) : undefined; message.Namespace = object.Namespace ?? ""; return message; }, }; function createBaseGetOpenIncidentsRequest(): GetOpenIncidentsRequest { return { EventStore: "", Namespace: "", ObserverId: "", Condition: "", MinimumSeverity: 0, Limit: 0, AfterRaisedSequenceNumber: 0n, AfterIncidentId: undefined, }; } export const GetOpenIncidentsRequest: MessageFns = { encode(message: GetOpenIncidentsRequest, 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.ObserverId !== "") { writer.uint32(26).string(message.ObserverId); } if (message.Condition !== "") { writer.uint32(34).string(message.Condition); } if (message.MinimumSeverity !== 0) { writer.uint32(40).int32(message.MinimumSeverity); } if (message.Limit !== 0) { writer.uint32(48).int32(message.Limit); } if (message.AfterRaisedSequenceNumber !== 0n) { if (BigInt.asUintN(64, message.AfterRaisedSequenceNumber) !== message.AfterRaisedSequenceNumber) { throw new globalThis.Error( "value provided for field message.AfterRaisedSequenceNumber of type uint64 too large", ); } writer.uint32(56).uint64(message.AfterRaisedSequenceNumber); } if (message.AfterIncidentId !== undefined) { Guid.encode(message.AfterIncidentId, writer.uint32(66).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetOpenIncidentsRequest { 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 = createBaseGetOpenIncidentsRequest(); 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.ObserverId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.Condition = reader.string(); continue; } case 5: { if (tag !== 40) { break; } message.MinimumSeverity = reader.int32() as any; continue; } case 6: { if (tag !== 48) { break; } message.Limit = reader.int32(); continue; } case 7: { if (tag !== 56) { break; } message.AfterRaisedSequenceNumber = reader.uint64() as bigint; continue; } case 8: { if (tag !== 66) { break; } message.AfterIncidentId = Guid.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): GetOpenIncidentsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", ObserverId: isSet(object.ObserverId) ? globalThis.String(object.ObserverId) : "", Condition: isSet(object.Condition) ? globalThis.String(object.Condition) : "", MinimumSeverity: isSet(object.MinimumSeverity) ? alertSeverityFromJSON(object.MinimumSeverity) : 0, Limit: isSet(object.Limit) ? globalThis.Number(object.Limit) : 0, AfterRaisedSequenceNumber: isSet(object.AfterRaisedSequenceNumber) ? BigInt(object.AfterRaisedSequenceNumber) : 0n, AfterIncidentId: isSet(object.AfterIncidentId) ? Guid.fromJSON(object.AfterIncidentId) : undefined, }; }, toJSON(message: GetOpenIncidentsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.ObserverId !== "") { obj.ObserverId = message.ObserverId; } if (message.Condition !== "") { obj.Condition = message.Condition; } if (message.MinimumSeverity !== 0) { obj.MinimumSeverity = alertSeverityToJSON(message.MinimumSeverity); } if (message.Limit !== 0) { obj.Limit = Math.round(message.Limit); } if (message.AfterRaisedSequenceNumber !== 0n) { obj.AfterRaisedSequenceNumber = message.AfterRaisedSequenceNumber.toString(); } if (message.AfterIncidentId !== undefined) { obj.AfterIncidentId = Guid.toJSON(message.AfterIncidentId); } return obj; }, create(base?: DeepPartial): GetOpenIncidentsRequest { return GetOpenIncidentsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetOpenIncidentsRequest { const message = createBaseGetOpenIncidentsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.ObserverId = object.ObserverId ?? ""; message.Condition = object.Condition ?? ""; message.MinimumSeverity = object.MinimumSeverity ?? 0; message.Limit = object.Limit ?? 0; message.AfterRaisedSequenceNumber = (object.AfterRaisedSequenceNumber !== undefined && object.AfterRaisedSequenceNumber !== null) ? BigInt(object.AfterRaisedSequenceNumber) : 0n; message.AfterIncidentId = (object.AfterIncidentId !== undefined && object.AfterIncidentId !== null) ? Guid.fromPartial(object.AfterIncidentId) : undefined; return message; }, }; function createBaseQueryResultAlertIncidentLookupResponse(): QueryResultAlertIncidentLookupResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultAlertIncidentLookupResponse: MessageFns = { encode(message: QueryResultAlertIncidentLookupResponse, 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) { AlertIncidentLookupResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultAlertIncidentLookupResponse { 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 = createBaseQueryResultAlertIncidentLookupResponse(); 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 = AlertIncidentLookupResponse.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): QueryResultAlertIncidentLookupResponse { 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) ? AlertIncidentLookupResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultAlertIncidentLookupResponse): 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 = AlertIncidentLookupResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultAlertIncidentLookupResponse { return QueryResultAlertIncidentLookupResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultAlertIncidentLookupResponse { const message = createBaseQueryResultAlertIncidentLookupResponse(); 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) ? AlertIncidentLookupResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseQueryResultAlertIncidentPageResponse(): QueryResultAlertIncidentPageResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultAlertIncidentPageResponse: MessageFns = { encode(message: QueryResultAlertIncidentPageResponse, 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) { AlertIncidentPageResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultAlertIncidentPageResponse { 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 = createBaseQueryResultAlertIncidentPageResponse(); 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 = AlertIncidentPageResponse.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): QueryResultAlertIncidentPageResponse { 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) ? AlertIncidentPageResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultAlertIncidentPageResponse): 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 = AlertIncidentPageResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultAlertIncidentPageResponse { return QueryResultAlertIncidentPageResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultAlertIncidentPageResponse { const message = createBaseQueryResultAlertIncidentPageResponse(); 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) ? AlertIncidentPageResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseQueryResultAlertIncidentSummaryResponse(): QueryResultAlertIncidentSummaryResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultAlertIncidentSummaryResponse: MessageFns = { encode(message: QueryResultAlertIncidentSummaryResponse, 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) { AlertIncidentSummaryResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultAlertIncidentSummaryResponse { 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 = createBaseQueryResultAlertIncidentSummaryResponse(); 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 = AlertIncidentSummaryResponse.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): QueryResultAlertIncidentSummaryResponse { 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) ? AlertIncidentSummaryResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultAlertIncidentSummaryResponse): 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 = AlertIncidentSummaryResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultAlertIncidentSummaryResponse { return QueryResultAlertIncidentSummaryResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultAlertIncidentSummaryResponse { const message = createBaseQueryResultAlertIncidentSummaryResponse(); 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) ? AlertIncidentSummaryResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseSerializableDateTimeOffset(): SerializableDateTimeOffset { return { Value: "" }; } export const SerializableDateTimeOffset: MessageFns = { encode(message: SerializableDateTimeOffset, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Value !== "") { writer.uint32(10).string(message.Value); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SerializableDateTimeOffset { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseSerializableDateTimeOffset(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.Value = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): SerializableDateTimeOffset { return { Value: isSet(object.Value) ? globalThis.String(object.Value) : "" }; }, toJSON(message: SerializableDateTimeOffset): unknown { const obj: any = {}; if (message.Value !== "") { obj.Value = message.Value; } return obj; }, create(base?: DeepPartial): SerializableDateTimeOffset { return SerializableDateTimeOffset.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SerializableDateTimeOffset { const message = createBaseSerializableDateTimeOffset(); message.Value = object.Value ?? ""; return message; }, }; function 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 AlertsDefinition = typeof AlertsDefinition; export const AlertsDefinition = { name: "Alerts", fullName: "Cratis.Chronicle.Contracts.Alerts.Alerts", methods: { getOpenIncident: { name: "GetOpenIncident", requestType: GetOpenIncidentRequest as typeof GetOpenIncidentRequest, requestStream: false, responseType: QueryResultAlertIncidentLookupResponse as typeof QueryResultAlertIncidentLookupResponse, responseStream: false, options: {}, }, getOpenIncidentCounts: { name: "GetOpenIncidentCounts", requestType: GetOpenIncidentCountsRequest as typeof GetOpenIncidentCountsRequest, requestStream: false, responseType: QueryResultAlertIncidentSummaryResponse as typeof QueryResultAlertIncidentSummaryResponse, responseStream: false, options: {}, }, getOpenIncidents: { name: "GetOpenIncidents", requestType: GetOpenIncidentsRequest as typeof GetOpenIncidentsRequest, requestStream: false, responseType: QueryResultAlertIncidentPageResponse as typeof QueryResultAlertIncidentPageResponse, responseStream: false, options: {}, }, }, } as const; export interface AlertsServiceImplementation { getOpenIncident( request: GetOpenIncidentRequest, context: CallContext & CallContextExt, ): Promise>; getOpenIncidentCounts( request: GetOpenIncidentCountsRequest, context: CallContext & CallContextExt, ): Promise>; getOpenIncidents( request: GetOpenIncidentsRequest, context: CallContext & CallContextExt, ): Promise>; } export interface AlertsClient { getOpenIncident( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getOpenIncidentCounts( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getOpenIncidents( 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 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; }