// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: recommendations.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.Recommendations"; export enum ValidationResultSeverity { Unknown = 0, Information = 1, Warning = 2, Error = 3, UNRECOGNIZED = -1, } export function validationResultSeverityFromJSON(object: any): ValidationResultSeverity { switch (object) { case 0: case "Unknown": return ValidationResultSeverity.Unknown; case 1: case "Information": return ValidationResultSeverity.Information; case 2: case "Warning": return ValidationResultSeverity.Warning; case 3: case "Error": return ValidationResultSeverity.Error; case -1: case "UNRECOGNIZED": default: return ValidationResultSeverity.UNRECOGNIZED; } } export function validationResultSeverityToJSON(object: ValidationResultSeverity): string { switch (object) { case ValidationResultSeverity.Unknown: return "Unknown"; case ValidationResultSeverity.Information: return "Information"; case ValidationResultSeverity.Warning: return "Warning"; case ValidationResultSeverity.Error: return "Error"; case ValidationResultSeverity.UNRECOGNIZED: default: return "UNRECOGNIZED"; } } export interface AllRecommendationsRequest { 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 GetRecommendationsRequest { EventStore: string; Namespace: string; } export interface IgnoreRecommendationRequest { EventStore: string; Namespace: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ RecommendationId: Guid | undefined; } export interface PerformRecommendationRequest { EventStore: string; Namespace: string; /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ RecommendationId: Guid | undefined; } export interface QueryResultIEnumerableRecommendationDetailsResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: RecommendationDetailsResponse[]; } export interface RecommendationDetailsResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; Name: string; Description: string; Type: string; Occurred: SerializableDateTimeOffset | undefined; } /** Represents a DateTimeOffset value as an ISO 8601 string (e.g., "2024-01-15T12:30:00.0000000+02:00"). */ export interface SerializableDateTimeOffset { Value: string; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseAllRecommendationsRequest(): AllRecommendationsRequest { return { EventStore: "", Namespace: "" }; } export const AllRecommendationsRequest: MessageFns = { encode(message: AllRecommendationsRequest, 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): AllRecommendationsRequest { 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 = createBaseAllRecommendationsRequest(); 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): AllRecommendationsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: AllRecommendationsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): AllRecommendationsRequest { return AllRecommendationsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AllRecommendationsRequest { const message = createBaseAllRecommendationsRequest(); 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 createBaseGetRecommendationsRequest(): GetRecommendationsRequest { return { EventStore: "", Namespace: "" }; } export const GetRecommendationsRequest: MessageFns = { encode(message: GetRecommendationsRequest, 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): GetRecommendationsRequest { 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 = createBaseGetRecommendationsRequest(); 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): GetRecommendationsRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", }; }, toJSON(message: GetRecommendationsRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } return obj; }, create(base?: DeepPartial): GetRecommendationsRequest { return GetRecommendationsRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): GetRecommendationsRequest { const message = createBaseGetRecommendationsRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; return message; }, }; function createBaseIgnoreRecommendationRequest(): IgnoreRecommendationRequest { return { EventStore: "", Namespace: "", RecommendationId: undefined }; } export const IgnoreRecommendationRequest: MessageFns = { encode(message: IgnoreRecommendationRequest, 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.RecommendationId !== undefined) { Guid.encode(message.RecommendationId, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): IgnoreRecommendationRequest { 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 = createBaseIgnoreRecommendationRequest(); 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.RecommendationId = 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): IgnoreRecommendationRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", RecommendationId: isSet(object.RecommendationId) ? Guid.fromJSON(object.RecommendationId) : undefined, }; }, toJSON(message: IgnoreRecommendationRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.RecommendationId !== undefined) { obj.RecommendationId = Guid.toJSON(message.RecommendationId); } return obj; }, create(base?: DeepPartial): IgnoreRecommendationRequest { return IgnoreRecommendationRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): IgnoreRecommendationRequest { const message = createBaseIgnoreRecommendationRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.RecommendationId = (object.RecommendationId !== undefined && object.RecommendationId !== null) ? Guid.fromPartial(object.RecommendationId) : undefined; return message; }, }; function createBasePerformRecommendationRequest(): PerformRecommendationRequest { return { EventStore: "", Namespace: "", RecommendationId: undefined }; } export const PerformRecommendationRequest: MessageFns = { encode(message: PerformRecommendationRequest, 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.RecommendationId !== undefined) { Guid.encode(message.RecommendationId, writer.uint32(26).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): PerformRecommendationRequest { 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 = createBasePerformRecommendationRequest(); 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.RecommendationId = 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): PerformRecommendationRequest { return { EventStore: isSet(object.EventStore) ? globalThis.String(object.EventStore) : "", Namespace: isSet(object.Namespace) ? globalThis.String(object.Namespace) : "", RecommendationId: isSet(object.RecommendationId) ? Guid.fromJSON(object.RecommendationId) : undefined, }; }, toJSON(message: PerformRecommendationRequest): unknown { const obj: any = {}; if (message.EventStore !== "") { obj.EventStore = message.EventStore; } if (message.Namespace !== "") { obj.Namespace = message.Namespace; } if (message.RecommendationId !== undefined) { obj.RecommendationId = Guid.toJSON(message.RecommendationId); } return obj; }, create(base?: DeepPartial): PerformRecommendationRequest { return PerformRecommendationRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): PerformRecommendationRequest { const message = createBasePerformRecommendationRequest(); message.EventStore = object.EventStore ?? ""; message.Namespace = object.Namespace ?? ""; message.RecommendationId = (object.RecommendationId !== undefined && object.RecommendationId !== null) ? Guid.fromPartial(object.RecommendationId) : undefined; return message; }, }; function createBaseQueryResultIEnumerableRecommendationDetailsResponse(): QueryResultIEnumerableRecommendationDetailsResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableRecommendationDetailsResponse: MessageFns< QueryResultIEnumerableRecommendationDetailsResponse > = { encode( message: QueryResultIEnumerableRecommendationDetailsResponse, 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) { RecommendationDetailsResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableRecommendationDetailsResponse { 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 = createBaseQueryResultIEnumerableRecommendationDetailsResponse(); 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(RecommendationDetailsResponse.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): QueryResultIEnumerableRecommendationDetailsResponse { 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) => RecommendationDetailsResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableRecommendationDetailsResponse): 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) => RecommendationDetailsResponse.toJSON(e)); } return obj; }, create( base?: DeepPartial, ): QueryResultIEnumerableRecommendationDetailsResponse { return QueryResultIEnumerableRecommendationDetailsResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableRecommendationDetailsResponse { const message = createBaseQueryResultIEnumerableRecommendationDetailsResponse(); 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) => RecommendationDetailsResponse.fromPartial(e)) || []; return message; }, }; function createBaseRecommendationDetailsResponse(): RecommendationDetailsResponse { return { Id: undefined, Name: "", Description: "", Type: "", Occurred: undefined }; } export const RecommendationDetailsResponse: MessageFns = { encode(message: RecommendationDetailsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.Name !== "") { writer.uint32(18).string(message.Name); } if (message.Description !== "") { writer.uint32(26).string(message.Description); } if (message.Type !== "") { writer.uint32(34).string(message.Type); } if (message.Occurred !== undefined) { SerializableDateTimeOffset.encode(message.Occurred, writer.uint32(42).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RecommendationDetailsResponse { 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 = createBaseRecommendationDetailsResponse(); 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.Name = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Description = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.Type = reader.string(); continue; } case 5: { if (tag !== 42) { break; } message.Occurred = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): RecommendationDetailsResponse { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, Name: isSet(object.Name) ? globalThis.String(object.Name) : "", Description: isSet(object.Description) ? globalThis.String(object.Description) : "", Type: isSet(object.Type) ? globalThis.String(object.Type) : "", Occurred: isSet(object.Occurred) ? SerializableDateTimeOffset.fromJSON(object.Occurred) : undefined, }; }, toJSON(message: RecommendationDetailsResponse): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.Name !== "") { obj.Name = message.Name; } if (message.Description !== "") { obj.Description = message.Description; } if (message.Type !== "") { obj.Type = message.Type; } if (message.Occurred !== undefined) { obj.Occurred = SerializableDateTimeOffset.toJSON(message.Occurred); } return obj; }, create(base?: DeepPartial): RecommendationDetailsResponse { return RecommendationDetailsResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RecommendationDetailsResponse { const message = createBaseRecommendationDetailsResponse(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.Name = object.Name ?? ""; message.Description = object.Description ?? ""; message.Type = object.Type ?? ""; message.Occurred = (object.Occurred !== undefined && object.Occurred !== null) ? SerializableDateTimeOffset.fromPartial(object.Occurred) : 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 RecommendationsDefinition = typeof RecommendationsDefinition; export const RecommendationsDefinition = { name: "Recommendations", fullName: "Cratis.Chronicle.Contracts.Recommendations.Recommendations", methods: { allRecommendations: { name: "AllRecommendations", requestType: AllRecommendationsRequest as typeof AllRecommendationsRequest, requestStream: false, responseType: QueryResultIEnumerableRecommendationDetailsResponse as typeof QueryResultIEnumerableRecommendationDetailsResponse, responseStream: true, options: {}, }, getRecommendations: { name: "GetRecommendations", requestType: GetRecommendationsRequest as typeof GetRecommendationsRequest, requestStream: false, responseType: QueryResultIEnumerableRecommendationDetailsResponse as typeof QueryResultIEnumerableRecommendationDetailsResponse, responseStream: false, options: {}, }, ignoreRecommendation: { name: "IgnoreRecommendation", requestType: IgnoreRecommendationRequest as typeof IgnoreRecommendationRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, performRecommendation: { name: "PerformRecommendation", requestType: PerformRecommendationRequest as typeof PerformRecommendationRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, }, } as const; export interface RecommendationsServiceImplementation { allRecommendations( request: AllRecommendationsRequest, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; getRecommendations( request: GetRecommendationsRequest, context: CallContext & CallContextExt, ): Promise>; ignoreRecommendation( request: IgnoreRecommendationRequest, context: CallContext & CallContextExt, ): Promise>; performRecommendation( request: PerformRecommendationRequest, context: CallContext & CallContextExt, ): Promise>; } export interface RecommendationsClient { allRecommendations( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; getRecommendations( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; ignoreRecommendation( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; performRecommendation( 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; }