// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: jobs.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.Jobs"; export enum JobStatus { None = 0, PreparingJob = 1, PreparingSteps = 2, StartingSteps = 3, JOB_STATUS_Running = 4, JOB_STATUS_CompletedSuccessfully = 5, CompletedWithFailures = 6, JOB_STATUS_Stopped = 7, JOB_STATUS_Failed = 8, JOB_STATUS_Removing = 9, UNRECOGNIZED = -1, } export function jobStatusFromJSON(object: any): JobStatus { switch (object) { case 0: case "None": return JobStatus.None; case 1: case "PreparingJob": return JobStatus.PreparingJob; case 2: case "PreparingSteps": return JobStatus.PreparingSteps; case 3: case "StartingSteps": return JobStatus.StartingSteps; case 4: case "JOB_STATUS_Running": return JobStatus.JOB_STATUS_Running; case 5: case "JOB_STATUS_CompletedSuccessfully": return JobStatus.JOB_STATUS_CompletedSuccessfully; case 6: case "CompletedWithFailures": return JobStatus.CompletedWithFailures; case 7: case "JOB_STATUS_Stopped": return JobStatus.JOB_STATUS_Stopped; case 8: case "JOB_STATUS_Failed": return JobStatus.JOB_STATUS_Failed; case 9: case "JOB_STATUS_Removing": return JobStatus.JOB_STATUS_Removing; case -1: case "UNRECOGNIZED": default: return JobStatus.UNRECOGNIZED; } } export function jobStatusToJSON(object: JobStatus): string { switch (object) { case JobStatus.None: return "None"; case JobStatus.PreparingJob: return "PreparingJob"; case JobStatus.PreparingSteps: return "PreparingSteps"; case JobStatus.StartingSteps: return "StartingSteps"; case JobStatus.JOB_STATUS_Running: return "JOB_STATUS_Running"; case JobStatus.JOB_STATUS_CompletedSuccessfully: return "JOB_STATUS_CompletedSuccessfully"; case JobStatus.CompletedWithFailures: return "CompletedWithFailures"; case JobStatus.JOB_STATUS_Stopped: return "JOB_STATUS_Stopped"; case JobStatus.JOB_STATUS_Failed: return "JOB_STATUS_Failed"; case JobStatus.JOB_STATUS_Removing: return "JOB_STATUS_Removing"; case JobStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum JobStepStatus { JOB_STEP_STATUS_Unknown = 0, Scheduled = 1, JOB_STEP_STATUS_Running = 2, JOB_STEP_STATUS_CompletedSuccessfully = 3, CompletedWithFailure = 4, JOB_STEP_STATUS_Stopped = 5, JOB_STEP_STATUS_Failed = 6, JOB_STEP_STATUS_Removing = 7, UNRECOGNIZED = -1, } export function jobStepStatusFromJSON(object: any): JobStepStatus { switch (object) { case 0: case "JOB_STEP_STATUS_Unknown": return JobStepStatus.JOB_STEP_STATUS_Unknown; case 1: case "Scheduled": return JobStepStatus.Scheduled; case 2: case "JOB_STEP_STATUS_Running": return JobStepStatus.JOB_STEP_STATUS_Running; case 3: case "JOB_STEP_STATUS_CompletedSuccessfully": return JobStepStatus.JOB_STEP_STATUS_CompletedSuccessfully; case 4: case "CompletedWithFailure": return JobStepStatus.CompletedWithFailure; case 5: case "JOB_STEP_STATUS_Stopped": return JobStepStatus.JOB_STEP_STATUS_Stopped; case 6: case "JOB_STEP_STATUS_Failed": return JobStepStatus.JOB_STEP_STATUS_Failed; case 7: case "JOB_STEP_STATUS_Removing": return JobStepStatus.JOB_STEP_STATUS_Removing; case -1: case "UNRECOGNIZED": default: return JobStepStatus.UNRECOGNIZED; } } export function jobStepStatusToJSON(object: JobStepStatus): string { switch (object) { case JobStepStatus.JOB_STEP_STATUS_Unknown: return "JOB_STEP_STATUS_Unknown"; case JobStepStatus.Scheduled: return "Scheduled"; case JobStepStatus.JOB_STEP_STATUS_Running: return "JOB_STEP_STATUS_Running"; case JobStepStatus.JOB_STEP_STATUS_CompletedSuccessfully: return "JOB_STEP_STATUS_CompletedSuccessfully"; case JobStepStatus.CompletedWithFailure: return "CompletedWithFailure"; case JobStepStatus.JOB_STEP_STATUS_Stopped: return "JOB_STEP_STATUS_Stopped"; case JobStepStatus.JOB_STEP_STATUS_Failed: return "JOB_STEP_STATUS_Failed"; case JobStepStatus.JOB_STEP_STATUS_Removing: return "JOB_STEP_STATUS_Removing"; case JobStepStatus.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export enum ValidationResultSeverity { VALIDATION_RESULT_SEVERITY_Unknown = 0, Information = 1, Warning = 2, Error = 3, UNRECOGNIZED = -1, } export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity { switch (object) { case 0: case "VALIDATION_RESULT_SEVERITY_Unknown": return ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown; case 1: case "Information": return ValidationResultSeverity.Information; case 2: case "Warning": return ValidationResultSeverity.Warning; case 3: case "Error": return ValidationResultSeverity.Error; case -1: case "UNRECOGNIZED": default: return ValidationResultSeverity.UNRECOGNIZED; } } export function validationResultSeverityToJSON(object: ValidationResultSeverity): string { switch (object) { case ValidationResultSeverity.VALIDATION_RESULT_SEVERITY_Unknown: return "VALIDATION_RESULT_SEVERITY_Unknown"; case ValidationResultSeverity.Information: return "Information"; case ValidationResultSeverity.Warning: return "Warning"; case ValidationResultSeverity.Error: return "Error"; case ValidationResultSeverity.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface AllJobsRequest { EventStore: string; Namespace: string; } export interface CommandResult { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; AuthorizationFailureReason: string; } export interface DeleteJobRequest { EventStore: string; Namespace: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ JobId: Guid | undefined; } export interface GetJobStepsRequest { EventStore: string; Namespace: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ JobId: Guid | undefined; } export interface JobProgress { TotalSteps: number; SuccessfulSteps: number; FailedSteps: number; StoppedSteps: number; IsCompleted: boolean; IsStopped: boolean; Message: string; } export interface JobStatusChanged { Status: JobStatus; Occurred: SerializableDateTimeOffset | undefined; ExceptionMessages: string[]; ExceptionStackTrace: string; } export interface JobStepProgress { Percentage: number; Message: string; } export interface JobStepStatusChanged { Status: JobStepStatus; Occurred: SerializableDateTimeOffset | undefined; ExceptionMessages: string[]; ExceptionStackTrace: string; } export interface JobStepSummaryResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; Type: string; Name: string; Status: JobStepStatus; StatusChanges: JobStepStatusChanged[]; Progress: JobStepProgress | undefined; } export interface JobSummaryResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; Details: string; Type: string; Status: JobStatus; Created: SerializableDateTimeOffset | undefined; StatusChanges: JobStatusChanged[]; Progress: JobProgress | undefined; } export interface ObserveJobsRequest { EventStore: string; Namespace: string; } export interface QueryResultIEnumerableJobStepSummaryResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: JobStepSummaryResponse[]; } export interface QueryResultIEnumerableJobSummaryResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: JobSummaryResponse[]; } export interface ResumeJobRequest { EventStore: string; Namespace: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ JobId: Guid | 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 StopJobRequest { EventStore: string; Namespace: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ JobId: Guid | undefined; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseAllJobsRequest(): AllJobsRequest { return { EventStore: "", Namespace: "" }; } export const AllJobsRequest: MessageFns = { encode(message: AllJobsRequest, 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): AllJobsRequest { 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 = createBaseAllJobsRequest(); 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): AllJobsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: AllJobsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): AllJobsRequest { return AllJobsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AllJobsRequest { const message = createBaseAllJobsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; return message; }, }; function createBaseCommandResult(): CommandResult { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", AuthorizationFailureReason: "", }; } export const CommandResult: MessageFns = { encode(message: CommandResult, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.AuthorizationFailureReason !== "") { writer.uint32(50).string(message.AuthorizationFailureReason); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): CommandResult { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0; if (previousRecursionDepth >= 100) { throw new globalThis.Error("protobuf decode recursion limit exceeded"); } (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1; try { const end = length === undefined ? reader.len : reader.pos + length; const message = createBaseCommandResult(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.CorrelationId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.IsAuthorized = reader.bool(); continue; } case 3: { if (tag !== 26) { break; } message.ValidationResults.push(ValidationResult.decode(reader, reader.uint32())); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 5: { if (tag !== 42) { break; } message.ExceptionStackTrace = reader.string(); continue; } case 6: { if (tag !== 50) { break; } message.AuthorizationFailureReason = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): CommandResult { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", AuthorizationFailureReason: isSet(object.AuthorizationFailureReason) ? globalThis.String(object.AuthorizationFailureReason) : "", }; }, toJSON(message: CommandResult): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.AuthorizationFailureReason !== "") { obj.AuthorizationFailureReason = message.AuthorizationFailureReason; } return obj; }, create(base?: DeepPartial): CommandResult { return CommandResult.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): CommandResult { const message = createBaseCommandResult(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.AuthorizationFailureReason = object.AuthorizationFailureReason ?? ""; return message; }, }; function createBaseDeleteJobRequest(): DeleteJobRequest { return { EventStore: "", Namespace: "", JobId: undefined }; } export const DeleteJobRequest: MessageFns = { encode(message: DeleteJobRequest, 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.JobId !== undefined) { Guid.encode(message.JobId, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): DeleteJobRequest { 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 = createBaseDeleteJobRequest(); 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.JobId = 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): DeleteJobRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", JobId: isSet(object.JobId) ? Guid.fromJSON(object.JobId) : undefined, }; }, toJSON(message: DeleteJobRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.JobId !== undefined) { obj.JobId = Guid.toJSON(message.JobId); } return obj; }, create(base?: DeepPartial): DeleteJobRequest { return DeleteJobRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): DeleteJobRequest { const message = createBaseDeleteJobRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.JobId = (object.JobId !== undefined && object.JobId !== null) ? Guid.fromPartial(object.JobId) : undefined; return message; }, }; function createBaseGetJobStepsRequest(): GetJobStepsRequest { return { EventStore: "", Namespace: "", JobId: undefined }; } export const GetJobStepsRequest: MessageFns = { encode(message: GetJobStepsRequest, 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.JobId !== undefined) { Guid.encode(message.JobId, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): GetJobStepsRequest { 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 = createBaseGetJobStepsRequest(); 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.JobId = 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): GetJobStepsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", JobId: isSet(object.JobId) ? Guid.fromJSON(object.JobId) : undefined, }; }, toJSON(message: GetJobStepsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.JobId !== undefined) { obj.JobId = Guid.toJSON(message.JobId); } return obj; }, create(base?: DeepPartial): GetJobStepsRequest { return GetJobStepsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetJobStepsRequest { const message = createBaseGetJobStepsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.JobId = (object.JobId !== undefined && object.JobId !== null) ? Guid.fromPartial(object.JobId) : undefined; return message; }, }; function createBaseJobProgress(): JobProgress { return { TotalSteps: 0, SuccessfulSteps: 0, FailedSteps: 0, StoppedSteps: 0, IsCompleted: false, IsStopped: false, Message: "", }; } export const JobProgress: MessageFns = { encode(message: JobProgress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.TotalSteps !== 0) { writer.uint32(8).int32(message.TotalSteps); } if (message.SuccessfulSteps !== 0) { writer.uint32(16).int32(message.SuccessfulSteps); } if (message.FailedSteps !== 0) { writer.uint32(24).int32(message.FailedSteps); } if (message.StoppedSteps !== 0) { writer.uint32(32).int32(message.StoppedSteps); } if (message.IsCompleted !== false) { writer.uint32(40).bool(message.IsCompleted); } if (message.IsStopped !== false) { writer.uint32(48).bool(message.IsStopped); } if (message.Message !== "") { writer.uint32(58).string(message.Message); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): JobProgress { 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 = createBaseJobProgress(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.TotalSteps = reader.int32(); continue; } case 2: { if (tag !== 16) { break; } message.SuccessfulSteps = reader.int32(); continue; } case 3: { if (tag !== 24) { break; } message.FailedSteps = reader.int32(); continue; } case 4: { if (tag !== 32) { break; } message.StoppedSteps = reader.int32(); continue; } case 5: { if (tag !== 40) { break; } message.IsCompleted = reader.bool(); continue; } case 6: { if (tag !== 48) { break; } message.IsStopped = reader.bool(); continue; } case 7: { if (tag !== 58) { 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): JobProgress { return { TotalSteps: isSet(object.TotalSteps) ? globalThis.Number(object.TotalSteps) : 0, SuccessfulSteps: isSet(object.SuccessfulSteps) ? globalThis.Number(object.SuccessfulSteps) : 0, FailedSteps: isSet(object.FailedSteps) ? globalThis.Number(object.FailedSteps) : 0, StoppedSteps: isSet(object.StoppedSteps) ? globalThis.Number(object.StoppedSteps) : 0, IsCompleted: isSet(object.IsCompleted) ? globalThis.Boolean(object.IsCompleted) : false, IsStopped: isSet(object.IsStopped) ? globalThis.Boolean(object.IsStopped) : false, Message: isSet(object.Message) ? globalThis.String(object.Message) : "", }; }, toJSON(message: JobProgress): unknown { const obj: any = {}; if (message.TotalSteps !== 0) { obj.TotalSteps = Math.round(message.TotalSteps); } if (message.SuccessfulSteps !== 0) { obj.SuccessfulSteps = Math.round(message.SuccessfulSteps); } if (message.FailedSteps !== 0) { obj.FailedSteps = Math.round(message.FailedSteps); } if (message.StoppedSteps !== 0) { obj.StoppedSteps = Math.round(message.StoppedSteps); } if (message.IsCompleted !== false) { obj.IsCompleted = message.IsCompleted; } if (message.IsStopped !== false) { obj.IsStopped = message.IsStopped; } if (message.Message !== "") { obj.Message = message.Message; } return obj; }, create(base?: DeepPartial): JobProgress { return JobProgress.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): JobProgress { const message = createBaseJobProgress(); message.TotalSteps = object.TotalSteps ?? 0; message.SuccessfulSteps = object.SuccessfulSteps ?? 0; message.FailedSteps = object.FailedSteps ?? 0; message.StoppedSteps = object.StoppedSteps ?? 0; message.IsCompleted = object.IsCompleted ?? false; message.IsStopped = object.IsStopped ?? false; message.Message = object.Message ?? ""; return message; }, }; function createBaseJobStatusChanged(): JobStatusChanged { return { Status: 0, Occurred: undefined, ExceptionMessages: [], ExceptionStackTrace: "" }; } export const JobStatusChanged: MessageFns = { encode(message: JobStatusChanged, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Status !== 0) { writer.uint32(8).int32(message.Status); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(18).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(26).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(34).string(message.ExceptionStackTrace); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): JobStatusChanged { 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 = createBaseJobStatusChanged(); 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.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionStackTrace = 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): JobStatusChanged { return { Status: isSet(object.Status) ? jobStatusFromJSON(object.Status) : 0, Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", }; }, toJSON(message: JobStatusChanged): unknown { const obj: any = {}; if (message.Status !== 0) { obj.Status = jobStatusToJSON(message.Status); } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } return obj; }, create(base?: DeepPartial): JobStatusChanged { return JobStatusChanged.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): JobStatusChanged { const message = createBaseJobStatusChanged(); message.Status = object.Status ?? 0; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; return message; }, }; function createBaseJobStepProgress(): JobStepProgress { return { Percentage: 0, Message: "" }; } export const JobStepProgress: MessageFns = { encode(message: JobStepProgress, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Percentage !== 0) { writer.uint32(8).int32(message.Percentage); } if (message.Message !== "") { writer.uint32(18).string(message.Message); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): JobStepProgress { 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 = createBaseJobStepProgress(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.Percentage = reader.int32(); continue; } case 2: { if (tag !== 18) { 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): JobStepProgress { return { Percentage: isSet(object.Percentage) ? globalThis.Number(object.Percentage) : 0, Message: isSet(object.Message) ? globalThis.String(object.Message) : "", }; }, toJSON(message: JobStepProgress): unknown { const obj: any = {}; if (message.Percentage !== 0) { obj.Percentage = Math.round(message.Percentage); } if (message.Message !== "") { obj.Message = message.Message; } return obj; }, create(base?: DeepPartial): JobStepProgress { return JobStepProgress.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): JobStepProgress { const message = createBaseJobStepProgress(); message.Percentage = object.Percentage ?? 0; message.Message = object.Message ?? ""; return message; }, }; function createBaseJobStepStatusChanged(): JobStepStatusChanged { return { Status: 0, Occurred: undefined, ExceptionMessages: [], ExceptionStackTrace: "" }; } export const JobStepStatusChanged: MessageFns = { encode(message: JobStepStatusChanged, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Status !== 0) { writer.uint32(8).int32(message.Status); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(18).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(26).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(34).string(message.ExceptionStackTrace); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): JobStepStatusChanged { 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 = createBaseJobStepStatusChanged(); 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.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.ExceptionMessages.push(reader.string()); continue; } case 4: { if (tag !== 34) { break; } message.ExceptionStackTrace = 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): JobStepStatusChanged { return { Status: isSet(object.Status) ? jobStepStatusFromJSON(object.Status) : 0, Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", }; }, toJSON(message: JobStepStatusChanged): unknown { const obj: any = {}; if (message.Status !== 0) { obj.Status = jobStepStatusToJSON(message.Status); } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } return obj; }, create(base?: DeepPartial): JobStepStatusChanged { return JobStepStatusChanged.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): JobStepStatusChanged { const message = createBaseJobStepStatusChanged(); message.Status = object.Status ?? 0; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : undefined; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; return message; }, }; function createBaseJobStepSummaryResponse(): JobStepSummaryResponse { return { Id: undefined, Type: "", Name: "", Status: 0, StatusChanges: [], Progress: undefined }; } export const JobStepSummaryResponse: MessageFns = { encode(message: JobStepSummaryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.Type !== "") { writer.uint32(18).string(message.Type); } if (message.Name !== "") { writer.uint32(26).string(message.Name); } if (message.Status !== 0) { writer.uint32(32).int32(message.Status); } for (const v of message.StatusChanges) { JobStepStatusChanged.encode(v!, writer.uint32(42).fork()).join(); } if (message.Progress !== undefined) { JobStepProgress.encode(message.Progress, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): JobStepSummaryResponse { 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 = createBaseJobStepSummaryResponse(); 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.Type = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Name = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.Status = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.StatusChanges.push(JobStepStatusChanged.decode(reader, reader.uint32())); continue; } case 6: { if (tag !== 50) { break; } message.Progress = JobStepProgress.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): JobStepSummaryResponse { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, Type: isSet(object.Type) ? globalThis.String(object.Type) : "", Name: isSet(object.Name) ? globalThis.String(object.Name) : "", Status: isSet(object.Status) ? jobStepStatusFromJSON(object.Status) : 0, StatusChanges: globalThis.Array.isArray(object?.StatusChanges) ? object.StatusChanges.map((e: any) => JobStepStatusChanged.fromJSON(e)) : [], Progress: isSet(object.Progress) ? JobStepProgress.fromJSON(object.Progress) : undefined, }; }, toJSON(message: JobStepSummaryResponse): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.Type !== "") { obj.Type = message.Type; } if (message.Name !== "") { obj.Name = message.Name; } if (message.Status !== 0) { obj.Status = jobStepStatusToJSON(message.Status); } if (message.StatusChanges?.length) { obj.StatusChanges = message.StatusChanges.map((e) => JobStepStatusChanged.toJSON(e)); } if (message.Progress !== undefined) { obj.Progress = JobStepProgress.toJSON(message.Progress); } return obj; }, create(base?: DeepPartial): JobStepSummaryResponse { return JobStepSummaryResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): JobStepSummaryResponse { const message = createBaseJobStepSummaryResponse(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.Type = object.Type ?? ""; message.Name = object.Name ?? ""; message.Status = object.Status ?? 0; message.StatusChanges = object.StatusChanges?.map((e) => JobStepStatusChanged.fromPartial(e)) || []; message.Progress = (object.Progress !== undefined && object.Progress !== null) ? JobStepProgress.fromPartial(object.Progress) : undefined; return message; }, }; function createBaseJobSummaryResponse(): JobSummaryResponse { return { Id: undefined, Details: "", Type: "", Status: 0, Created: undefined, StatusChanges: [], Progress: undefined, }; } export const JobSummaryResponse: MessageFns = { encode(message: JobSummaryResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.Details !== "") { writer.uint32(18).string(message.Details); } if (message.Type !== "") { writer.uint32(26).string(message.Type); } if (message.Status !== 0) { writer.uint32(32).int32(message.Status); } if (message.Created !== undefined) { SerializableDateTimeOffset.encode(message.Created, writer.uint32(42).fork()).join(); } for (const v of message.StatusChanges) { JobStatusChanged.encode(v!, writer.uint32(50).fork()).join(); } if (message.Progress !== undefined) { JobProgress.encode(message.Progress, writer.uint32(58).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): JobSummaryResponse { 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 = createBaseJobSummaryResponse(); 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.Details = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Type = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.Status = reader.int32() as any; continue; } case 5: { if (tag !== 42) { break; } message.Created = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 6: { if (tag !== 50) { break; } message.StatusChanges.push(JobStatusChanged.decode(reader, reader.uint32())); continue; } case 7: { if (tag !== 58) { break; } message.Progress = JobProgress.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): JobSummaryResponse { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, Details: isSet(object.Details) ? globalThis.String(object.Details) : "", Type: isSet(object.Type) ? globalThis.String(object.Type) : "", Status: isSet(object.Status) ? jobStatusFromJSON(object.Status) : 0, Created: isSet(object.Created) ? SerializableDateTimeOffset.fromJSON(object.Created) : undefined, StatusChanges: globalThis.Array.isArray(object?.StatusChanges) ? object.StatusChanges.map((e: any) => JobStatusChanged.fromJSON(e)) : [], Progress: isSet(object.Progress) ? JobProgress.fromJSON(object.Progress) : undefined, }; }, toJSON(message: JobSummaryResponse): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.Details !== "") { obj.Details = message.Details; } if (message.Type !== "") { obj.Type = message.Type; } if (message.Status !== 0) { obj.Status = jobStatusToJSON(message.Status); } if (message.Created !== undefined) { obj.Created = SerializableDateTimeOffset.toJSON(message.Created); } if (message.StatusChanges?.length) { obj.StatusChanges = message.StatusChanges.map((e) => JobStatusChanged.toJSON(e)); } if (message.Progress !== undefined) { obj.Progress = JobProgress.toJSON(message.Progress); } return obj; }, create(base?: DeepPartial): JobSummaryResponse { return JobSummaryResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): JobSummaryResponse { const message = createBaseJobSummaryResponse(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.Details = object.Details ?? ""; message.Type = object.Type ?? ""; message.Status = object.Status ?? 0; message.Created = (object.Created !== undefined && object.Created !== null) ? SerializableDateTimeOffset.fromPartial(object.Created) : undefined; message.StatusChanges = object.StatusChanges?.map((e) => JobStatusChanged.fromPartial(e)) || []; message.Progress = (object.Progress !== undefined && object.Progress !== null) ? JobProgress.fromPartial(object.Progress) : undefined; return message; }, }; function createBaseObserveJobsRequest(): ObserveJobsRequest { return { EventStore: "", Namespace: "" }; } export const ObserveJobsRequest: MessageFns = { encode(message: ObserveJobsRequest, 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): ObserveJobsRequest { 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 = createBaseObserveJobsRequest(); 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): ObserveJobsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: ObserveJobsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): ObserveJobsRequest { return ObserveJobsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ObserveJobsRequest { const message = createBaseObserveJobsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; return message; }, }; function createBaseQueryResultIEnumerableJobStepSummaryResponse(): QueryResultIEnumerableJobStepSummaryResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableJobStepSummaryResponse: MessageFns = { encode( message: QueryResultIEnumerableJobStepSummaryResponse, 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) { JobStepSummaryResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableJobStepSummaryResponse { 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 = createBaseQueryResultIEnumerableJobStepSummaryResponse(); 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(JobStepSummaryResponse.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): QueryResultIEnumerableJobStepSummaryResponse { 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) => JobStepSummaryResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableJobStepSummaryResponse): 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) => JobStepSummaryResponse.toJSON(e)); } return obj; }, create( base?: DeepPartial, ): QueryResultIEnumerableJobStepSummaryResponse { return QueryResultIEnumerableJobStepSummaryResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableJobStepSummaryResponse { const message = createBaseQueryResultIEnumerableJobStepSummaryResponse(); 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) => JobStepSummaryResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultIEnumerableJobSummaryResponse(): QueryResultIEnumerableJobSummaryResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableJobSummaryResponse: MessageFns = { encode(message: QueryResultIEnumerableJobSummaryResponse, 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) { JobSummaryResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableJobSummaryResponse { 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 = createBaseQueryResultIEnumerableJobSummaryResponse(); 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(JobSummaryResponse.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): QueryResultIEnumerableJobSummaryResponse { 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) => JobSummaryResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableJobSummaryResponse): 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) => JobSummaryResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableJobSummaryResponse { return QueryResultIEnumerableJobSummaryResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultIEnumerableJobSummaryResponse { const message = createBaseQueryResultIEnumerableJobSummaryResponse(); 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) => JobSummaryResponse.fromPartial(e)) || []; return message; }, }; function createBaseResumeJobRequest(): ResumeJobRequest { return { EventStore: "", Namespace: "", JobId: undefined }; } export const ResumeJobRequest: MessageFns = { encode(message: ResumeJobRequest, 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.JobId !== undefined) { Guid.encode(message.JobId, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ResumeJobRequest { 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 = createBaseResumeJobRequest(); 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.JobId = 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): ResumeJobRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", JobId: isSet(object.JobId) ? Guid.fromJSON(object.JobId) : undefined, }; }, toJSON(message: ResumeJobRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.JobId !== undefined) { obj.JobId = Guid.toJSON(message.JobId); } return obj; }, create(base?: DeepPartial): ResumeJobRequest { return ResumeJobRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ResumeJobRequest { const message = createBaseResumeJobRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.JobId = (object.JobId !== undefined && object.JobId !== null) ? Guid.fromPartial(object.JobId) : 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 createBaseStopJobRequest(): StopJobRequest { return { EventStore: "", Namespace: "", JobId: undefined }; } export const StopJobRequest: MessageFns = { encode(message: StopJobRequest, 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.JobId !== undefined) { Guid.encode(message.JobId, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): StopJobRequest { 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 = createBaseStopJobRequest(); 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.JobId = 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): StopJobRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", JobId: isSet(object.JobId) ? Guid.fromJSON(object.JobId) : undefined, }; }, toJSON(message: StopJobRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.JobId !== undefined) { obj.JobId = Guid.toJSON(message.JobId); } return obj; }, create(base?: DeepPartial): StopJobRequest { return StopJobRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): StopJobRequest { const message = createBaseStopJobRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.JobId = (object.JobId !== undefined && object.JobId !== null) ? Guid.fromPartial(object.JobId) : undefined; 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 JobsDefinition = typeof JobsDefinition; export const JobsDefinition = { name: "Jobs", fullName: "Cratis.Chronicle.Contracts.Jobs.Jobs", methods: { allJobs: { name: "AllJobs", requestType: AllJobsRequest as typeof AllJobsRequest, requestStream: false, responseType: QueryResultIEnumerableJobSummaryResponse as typeof QueryResultIEnumerableJobSummaryResponse, responseStream: false, options: {}, }, deleteJob: { name: "DeleteJob", requestType: DeleteJobRequest as typeof DeleteJobRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, getJobSteps: { name: "GetJobSteps", requestType: GetJobStepsRequest as typeof GetJobStepsRequest, requestStream: false, responseType: QueryResultIEnumerableJobStepSummaryResponse as typeof QueryResultIEnumerableJobStepSummaryResponse, responseStream: false, options: {}, }, observeJobs: { name: "ObserveJobs", requestType: ObserveJobsRequest as typeof ObserveJobsRequest, requestStream: false, responseType: QueryResultIEnumerableJobSummaryResponse as typeof QueryResultIEnumerableJobSummaryResponse, responseStream: true, options: {}, }, resumeJob: { name: "ResumeJob", requestType: ResumeJobRequest as typeof ResumeJobRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, stopJob: { name: "StopJob", requestType: StopJobRequest as typeof StopJobRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, }, } as const; export interface JobsServiceImplementation { allJobs( request: AllJobsRequest, context: CallContext & CallContextExt, ): Promise>; deleteJob(request: DeleteJobRequest, context: CallContext & CallContextExt): Promise>; getJobSteps( request: GetJobStepsRequest, context: CallContext & CallContextExt, ): Promise>; observeJobs( request: ObserveJobsRequest, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; resumeJob(request: ResumeJobRequest, context: CallContext & CallContextExt): Promise>; stopJob(request: StopJobRequest, context: CallContext & CallContextExt): Promise>; } export interface JobsClient { allJobs( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; deleteJob(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; getJobSteps( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; observeJobs( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; resumeJob(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; stopJob(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; }