// Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v2.12.4 // protoc v5.28.3 // source: security.proto /* eslint-disable */ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import type { CallContext, CallOptions } from "nice-grpc-common"; import { Empty } from "./google/protobuf/empty"; import { Guid } from "./protobuf-net/bcl"; export const protobufPackage = "Cratis.Chronicle.Contracts.Security"; 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 AddApplicationRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; ClientId: string; ClientSecret: string; } export interface AddUserRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ UserId: Guid | undefined; Username: string; Email: string; Password: string; } export interface AdminPasswordStatusResponse { IsRequired: boolean; AdminUserId: Guid | undefined; AdminUsername: string; } export interface ApplicationResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; ClientId: string; IsActive: boolean; CreatedAt: SerializableDateTimeOffset | undefined; LastModifiedAt: SerializableDateTimeOffset | undefined; } export interface ChangeApplicationSecretRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; ClientSecret: string; } export interface ChangeUserPasswordRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ UserId: Guid | undefined; OldPassword: string; Password: string; ConfirmedPassword: 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 QueryResultAdminPasswordStatusResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: AdminPasswordStatusResponse | undefined; } export interface QueryResultIEnumerableApplicationResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: ApplicationResponse[]; } export interface QueryResultIEnumerableUserResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ CorrelationId: Guid | undefined; IsAuthorized: boolean; ValidationResults: ValidationResult[]; ExceptionMessages: string[]; ExceptionStackTrace: string; Data: UserResponse[]; } export interface RemoveApplicationRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; } export interface RemoveUserRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ UserId: Guid | undefined; } export interface RequirePasswordChangeRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ UserId: 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 SetInitialAdminPasswordRequest { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ UserId: Guid | undefined; Password: string; ConfirmedPassword: string; } export interface UserResponse { /** default value could not be applied: 00000000-0000-0000-0000-000000000000 */ Id: Guid | undefined; Username: string; Email: string; IsActive: boolean; CreatedAt: SerializableDateTimeOffset | undefined; LastModifiedAt: SerializableDateTimeOffset | undefined; HasLoggedIn: boolean; } export interface ValidationResult { /** default value could not be applied: Error */ Severity: ValidationResultSeverity; Message: string; Members: string[]; } function createBaseAddApplicationRequest(): AddApplicationRequest { return { Id: undefined, ClientId: "", ClientSecret: "" }; } export const AddApplicationRequest: MessageFns = { encode(message: AddApplicationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.ClientId !== "") { writer.uint32(18).string(message.ClientId); } if (message.ClientSecret !== "") { writer.uint32(26).string(message.ClientSecret); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AddApplicationRequest { 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 = createBaseAddApplicationRequest(); 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.ClientId = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.ClientSecret = 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): AddApplicationRequest { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, ClientId: isSet(object.ClientId) ? globalThis.String(object.ClientId) : "", ClientSecret: isSet(object.ClientSecret) ? globalThis.String(object.ClientSecret) : "", }; }, toJSON(message: AddApplicationRequest): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.ClientId !== "") { obj.ClientId = message.ClientId; } if (message.ClientSecret !== "") { obj.ClientSecret = message.ClientSecret; } return obj; }, create(base?: DeepPartial): AddApplicationRequest { return AddApplicationRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AddApplicationRequest { const message = createBaseAddApplicationRequest(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.ClientId = object.ClientId ?? ""; message.ClientSecret = object.ClientSecret ?? ""; return message; }, }; function createBaseAddUserRequest(): AddUserRequest { return { UserId: undefined, Username: "", Email: "", Password: "" }; } export const AddUserRequest: MessageFns = { encode(message: AddUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.UserId !== undefined) { Guid.encode(message.UserId, writer.uint32(10).fork()).join(); } if (message.Username !== "") { writer.uint32(18).string(message.Username); } if (message.Email !== "") { writer.uint32(26).string(message.Email); } if (message.Password !== "") { writer.uint32(34).string(message.Password); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AddUserRequest { 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 = createBaseAddUserRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.UserId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Username = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Email = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.Password = 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): AddUserRequest { return { UserId: isSet(object.UserId) ? Guid.fromJSON(object.UserId) : undefined, Username: isSet(object.Username) ? globalThis.String(object.Username) : "", Email: isSet(object.Email) ? globalThis.String(object.Email) : "", Password: isSet(object.Password) ? globalThis.String(object.Password) : "", }; }, toJSON(message: AddUserRequest): unknown { const obj: any = {}; if (message.UserId !== undefined) { obj.UserId = Guid.toJSON(message.UserId); } if (message.Username !== "") { obj.Username = message.Username; } if (message.Email !== "") { obj.Email = message.Email; } if (message.Password !== "") { obj.Password = message.Password; } return obj; }, create(base?: DeepPartial): AddUserRequest { return AddUserRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AddUserRequest { const message = createBaseAddUserRequest(); message.UserId = (object.UserId !== undefined && object.UserId !== null) ? Guid.fromPartial(object.UserId) : undefined; message.Username = object.Username ?? ""; message.Email = object.Email ?? ""; message.Password = object.Password ?? ""; return message; }, }; function createBaseAdminPasswordStatusResponse(): AdminPasswordStatusResponse { return { IsRequired: false, AdminUserId: undefined, AdminUsername: "" }; } export const AdminPasswordStatusResponse: MessageFns = { encode(message: AdminPasswordStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.IsRequired !== false) { writer.uint32(8).bool(message.IsRequired); } if (message.AdminUserId !== undefined) { Guid.encode(message.AdminUserId, writer.uint32(18).fork()).join(); } if (message.AdminUsername !== "") { writer.uint32(26).string(message.AdminUsername); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): AdminPasswordStatusResponse { 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 = createBaseAdminPasswordStatusResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.IsRequired = reader.bool(); continue; } case 2: { if (tag !== 18) { break; } message.AdminUserId = Guid.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.AdminUsername = 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): AdminPasswordStatusResponse { return { IsRequired: isSet(object.IsRequired) ? globalThis.Boolean(object.IsRequired) : false, AdminUserId: isSet(object.AdminUserId) ? Guid.fromJSON(object.AdminUserId) : undefined, AdminUsername: isSet(object.AdminUsername) ? globalThis.String(object.AdminUsername) : "", }; }, toJSON(message: AdminPasswordStatusResponse): unknown { const obj: any = {}; if (message.IsRequired !== false) { obj.IsRequired = message.IsRequired; } if (message.AdminUserId !== undefined) { obj.AdminUserId = Guid.toJSON(message.AdminUserId); } if (message.AdminUsername !== "") { obj.AdminUsername = message.AdminUsername; } return obj; }, create(base?: DeepPartial): AdminPasswordStatusResponse { return AdminPasswordStatusResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): AdminPasswordStatusResponse { const message = createBaseAdminPasswordStatusResponse(); message.IsRequired = object.IsRequired ?? false; message.AdminUserId = (object.AdminUserId !== undefined && object.AdminUserId !== null) ? Guid.fromPartial(object.AdminUserId) : undefined; message.AdminUsername = object.AdminUsername ?? ""; return message; }, }; function createBaseApplicationResponse(): ApplicationResponse { return { Id: undefined, ClientId: "", IsActive: false, CreatedAt: undefined, LastModifiedAt: undefined }; } export const ApplicationResponse: MessageFns = { encode(message: ApplicationResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.ClientId !== "") { writer.uint32(18).string(message.ClientId); } if (message.IsActive !== false) { writer.uint32(24).bool(message.IsActive); } if (message.CreatedAt !== undefined) { SerializableDateTimeOffset.encode(message.CreatedAt, writer.uint32(34).fork()).join(); } if (message.LastModifiedAt !== undefined) { SerializableDateTimeOffset.encode(message.LastModifiedAt, writer.uint32(42).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ApplicationResponse { 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 = createBaseApplicationResponse(); 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.ClientId = reader.string(); continue; } case 3: { if (tag !== 24) { break; } message.IsActive = reader.bool(); continue; } case 4: { if (tag !== 34) { break; } message.CreatedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 5: { if (tag !== 42) { break; } message.LastModifiedAt = 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): ApplicationResponse { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, ClientId: isSet(object.ClientId) ? globalThis.String(object.ClientId) : "", IsActive: isSet(object.IsActive) ? globalThis.Boolean(object.IsActive) : false, CreatedAt: isSet(object.CreatedAt) ? SerializableDateTimeOffset.fromJSON(object.CreatedAt) : undefined, LastModifiedAt: isSet(object.LastModifiedAt) ? SerializableDateTimeOffset.fromJSON(object.LastModifiedAt) : undefined, }; }, toJSON(message: ApplicationResponse): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.ClientId !== "") { obj.ClientId = message.ClientId; } if (message.IsActive !== false) { obj.IsActive = message.IsActive; } if (message.CreatedAt !== undefined) { obj.CreatedAt = SerializableDateTimeOffset.toJSON(message.CreatedAt); } if (message.LastModifiedAt !== undefined) { obj.LastModifiedAt = SerializableDateTimeOffset.toJSON(message.LastModifiedAt); } return obj; }, create(base?: DeepPartial): ApplicationResponse { return ApplicationResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ApplicationResponse { const message = createBaseApplicationResponse(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.ClientId = object.ClientId ?? ""; message.IsActive = object.IsActive ?? false; message.CreatedAt = (object.CreatedAt !== undefined && object.CreatedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.CreatedAt) : undefined; message.LastModifiedAt = (object.LastModifiedAt !== undefined && object.LastModifiedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.LastModifiedAt) : undefined; return message; }, }; function createBaseChangeApplicationSecretRequest(): ChangeApplicationSecretRequest { return { Id: undefined, ClientSecret: "" }; } export const ChangeApplicationSecretRequest: MessageFns = { encode(message: ChangeApplicationSecretRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.ClientSecret !== "") { writer.uint32(18).string(message.ClientSecret); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ChangeApplicationSecretRequest { 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 = createBaseChangeApplicationSecretRequest(); 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.ClientSecret = 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): ChangeApplicationSecretRequest { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, ClientSecret: isSet(object.ClientSecret) ? globalThis.String(object.ClientSecret) : "", }; }, toJSON(message: ChangeApplicationSecretRequest): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.ClientSecret !== "") { obj.ClientSecret = message.ClientSecret; } return obj; }, create(base?: DeepPartial): ChangeApplicationSecretRequest { return ChangeApplicationSecretRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ChangeApplicationSecretRequest { const message = createBaseChangeApplicationSecretRequest(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.ClientSecret = object.ClientSecret ?? ""; return message; }, }; function createBaseChangeUserPasswordRequest(): ChangeUserPasswordRequest { return { UserId: undefined, OldPassword: "", Password: "", ConfirmedPassword: "" }; } export const ChangeUserPasswordRequest: MessageFns = { encode(message: ChangeUserPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.UserId !== undefined) { Guid.encode(message.UserId, writer.uint32(10).fork()).join(); } if (message.OldPassword !== "") { writer.uint32(18).string(message.OldPassword); } if (message.Password !== "") { writer.uint32(26).string(message.Password); } if (message.ConfirmedPassword !== "") { writer.uint32(34).string(message.ConfirmedPassword); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): ChangeUserPasswordRequest { 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 = createBaseChangeUserPasswordRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.UserId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.OldPassword = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Password = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.ConfirmedPassword = 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): ChangeUserPasswordRequest { return { UserId: isSet(object.UserId) ? Guid.fromJSON(object.UserId) : undefined, OldPassword: isSet(object.OldPassword) ? globalThis.String(object.OldPassword) : "", Password: isSet(object.Password) ? globalThis.String(object.Password) : "", ConfirmedPassword: isSet(object.ConfirmedPassword) ? globalThis.String(object.ConfirmedPassword) : "", }; }, toJSON(message: ChangeUserPasswordRequest): unknown { const obj: any = {}; if (message.UserId !== undefined) { obj.UserId = Guid.toJSON(message.UserId); } if (message.OldPassword !== "") { obj.OldPassword = message.OldPassword; } if (message.Password !== "") { obj.Password = message.Password; } if (message.ConfirmedPassword !== "") { obj.ConfirmedPassword = message.ConfirmedPassword; } return obj; }, create(base?: DeepPartial): ChangeUserPasswordRequest { return ChangeUserPasswordRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): ChangeUserPasswordRequest { const message = createBaseChangeUserPasswordRequest(); message.UserId = (object.UserId !== undefined && object.UserId !== null) ? Guid.fromPartial(object.UserId) : undefined; message.OldPassword = object.OldPassword ?? ""; message.Password = object.Password ?? ""; message.ConfirmedPassword = object.ConfirmedPassword ?? ""; 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 createBaseQueryResultAdminPasswordStatusResponse(): QueryResultAdminPasswordStatusResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: undefined, }; } export const QueryResultAdminPasswordStatusResponse: MessageFns = { encode(message: QueryResultAdminPasswordStatusResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.CorrelationId !== undefined) { Guid.encode(message.CorrelationId, writer.uint32(10).fork()).join(); } if (message.IsAuthorized !== false) { writer.uint32(16).bool(message.IsAuthorized); } for (const v of message.ValidationResults) { ValidationResult.encode(v!, writer.uint32(26).fork()).join(); } for (const v of message.ExceptionMessages) { writer.uint32(34).string(v!); } if (message.ExceptionStackTrace !== "") { writer.uint32(42).string(message.ExceptionStackTrace); } if (message.Data !== undefined) { AdminPasswordStatusResponse.encode(message.Data, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultAdminPasswordStatusResponse { 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 = createBaseQueryResultAdminPasswordStatusResponse(); 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 = AdminPasswordStatusResponse.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): QueryResultAdminPasswordStatusResponse { return { CorrelationId: isSet(object.CorrelationId) ? Guid.fromJSON(object.CorrelationId) : undefined, IsAuthorized: isSet(object.IsAuthorized) ? globalThis.Boolean(object.IsAuthorized) : false, ValidationResults: globalThis.Array.isArray(object?.ValidationResults) ? object.ValidationResults.map((e: any) => ValidationResult.fromJSON(e)) : [], ExceptionMessages: globalThis.Array.isArray(object?.ExceptionMessages) ? object.ExceptionMessages.map((e: any) => globalThis.String(e)) : [], ExceptionStackTrace: isSet(object.ExceptionStackTrace) ? globalThis.String(object.ExceptionStackTrace) : "", Data: isSet(object.Data) ? AdminPasswordStatusResponse.fromJSON(object.Data) : undefined, }; }, toJSON(message: QueryResultAdminPasswordStatusResponse): unknown { const obj: any = {}; if (message.CorrelationId !== undefined) { obj.CorrelationId = Guid.toJSON(message.CorrelationId); } if (message.IsAuthorized !== false) { obj.IsAuthorized = message.IsAuthorized; } if (message.ValidationResults?.length) { obj.ValidationResults = message.ValidationResults.map((e) => ValidationResult.toJSON(e)); } if (message.ExceptionMessages?.length) { obj.ExceptionMessages = message.ExceptionMessages; } if (message.ExceptionStackTrace !== "") { obj.ExceptionStackTrace = message.ExceptionStackTrace; } if (message.Data !== undefined) { obj.Data = AdminPasswordStatusResponse.toJSON(message.Data); } return obj; }, create(base?: DeepPartial): QueryResultAdminPasswordStatusResponse { return QueryResultAdminPasswordStatusResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultAdminPasswordStatusResponse { const message = createBaseQueryResultAdminPasswordStatusResponse(); message.CorrelationId = (object.CorrelationId !== undefined && object.CorrelationId !== null) ? Guid.fromPartial(object.CorrelationId) : undefined; message.IsAuthorized = object.IsAuthorized ?? false; message.ValidationResults = object.ValidationResults?.map((e) => ValidationResult.fromPartial(e)) || []; message.ExceptionMessages = object.ExceptionMessages?.map((e) => e) || []; message.ExceptionStackTrace = object.ExceptionStackTrace ?? ""; message.Data = (object.Data !== undefined && object.Data !== null) ? AdminPasswordStatusResponse.fromPartial(object.Data) : undefined; return message; }, }; function createBaseQueryResultIEnumerableApplicationResponse(): QueryResultIEnumerableApplicationResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableApplicationResponse: MessageFns = { encode(message: QueryResultIEnumerableApplicationResponse, 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) { ApplicationResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableApplicationResponse { 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 = createBaseQueryResultIEnumerableApplicationResponse(); 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(ApplicationResponse.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): QueryResultIEnumerableApplicationResponse { 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) => ApplicationResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableApplicationResponse): 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) => ApplicationResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableApplicationResponse { return QueryResultIEnumerableApplicationResponse.fromPartial(base ?? {}); }, fromPartial( object: DeepPartial, ): QueryResultIEnumerableApplicationResponse { const message = createBaseQueryResultIEnumerableApplicationResponse(); 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) => ApplicationResponse.fromPartial(e)) || []; return message; }, }; function createBaseQueryResultIEnumerableUserResponse(): QueryResultIEnumerableUserResponse { return { CorrelationId: undefined, IsAuthorized: false, ValidationResults: [], ExceptionMessages: [], ExceptionStackTrace: "", Data: [], }; } export const QueryResultIEnumerableUserResponse: MessageFns = { encode(message: QueryResultIEnumerableUserResponse, 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) { UserResponse.encode(v!, writer.uint32(50).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): QueryResultIEnumerableUserResponse { 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 = createBaseQueryResultIEnumerableUserResponse(); 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(UserResponse.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): QueryResultIEnumerableUserResponse { 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) => UserResponse.fromJSON(e)) : [], }; }, toJSON(message: QueryResultIEnumerableUserResponse): 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) => UserResponse.toJSON(e)); } return obj; }, create(base?: DeepPartial): QueryResultIEnumerableUserResponse { return QueryResultIEnumerableUserResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): QueryResultIEnumerableUserResponse { const message = createBaseQueryResultIEnumerableUserResponse(); 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) => UserResponse.fromPartial(e)) || []; return message; }, }; function createBaseRemoveApplicationRequest(): RemoveApplicationRequest { return { Id: undefined }; } export const RemoveApplicationRequest: MessageFns = { encode(message: RemoveApplicationRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RemoveApplicationRequest { 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 = createBaseRemoveApplicationRequest(); 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; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): RemoveApplicationRequest { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined }; }, toJSON(message: RemoveApplicationRequest): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } return obj; }, create(base?: DeepPartial): RemoveApplicationRequest { return RemoveApplicationRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RemoveApplicationRequest { const message = createBaseRemoveApplicationRequest(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; return message; }, }; function createBaseRemoveUserRequest(): RemoveUserRequest { return { UserId: undefined }; } export const RemoveUserRequest: MessageFns = { encode(message: RemoveUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.UserId !== undefined) { Guid.encode(message.UserId, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RemoveUserRequest { 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 = createBaseRemoveUserRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.UserId = 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): RemoveUserRequest { return { UserId: isSet(object.UserId) ? Guid.fromJSON(object.UserId) : undefined }; }, toJSON(message: RemoveUserRequest): unknown { const obj: any = {}; if (message.UserId !== undefined) { obj.UserId = Guid.toJSON(message.UserId); } return obj; }, create(base?: DeepPartial): RemoveUserRequest { return RemoveUserRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RemoveUserRequest { const message = createBaseRemoveUserRequest(); message.UserId = (object.UserId !== undefined && object.UserId !== null) ? Guid.fromPartial(object.UserId) : undefined; return message; }, }; function createBaseRequirePasswordChangeRequest(): RequirePasswordChangeRequest { return { UserId: undefined }; } export const RequirePasswordChangeRequest: MessageFns = { encode(message: RequirePasswordChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.UserId !== undefined) { Guid.encode(message.UserId, writer.uint32(10).fork()).join(); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): RequirePasswordChangeRequest { 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 = createBaseRequirePasswordChangeRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.UserId = 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): RequirePasswordChangeRequest { return { UserId: isSet(object.UserId) ? Guid.fromJSON(object.UserId) : undefined }; }, toJSON(message: RequirePasswordChangeRequest): unknown { const obj: any = {}; if (message.UserId !== undefined) { obj.UserId = Guid.toJSON(message.UserId); } return obj; }, create(base?: DeepPartial): RequirePasswordChangeRequest { return RequirePasswordChangeRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): RequirePasswordChangeRequest { const message = createBaseRequirePasswordChangeRequest(); message.UserId = (object.UserId !== undefined && object.UserId !== null) ? Guid.fromPartial(object.UserId) : 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 createBaseSetInitialAdminPasswordRequest(): SetInitialAdminPasswordRequest { return { UserId: undefined, Password: "", ConfirmedPassword: "" }; } export const SetInitialAdminPasswordRequest: MessageFns = { encode(message: SetInitialAdminPasswordRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.UserId !== undefined) { Guid.encode(message.UserId, writer.uint32(10).fork()).join(); } if (message.Password !== "") { writer.uint32(18).string(message.Password); } if (message.ConfirmedPassword !== "") { writer.uint32(26).string(message.ConfirmedPassword); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): SetInitialAdminPasswordRequest { 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 = createBaseSetInitialAdminPasswordRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.UserId = Guid.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.Password = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.ConfirmedPassword = 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): SetInitialAdminPasswordRequest { return { UserId: isSet(object.UserId) ? Guid.fromJSON(object.UserId) : undefined, Password: isSet(object.Password) ? globalThis.String(object.Password) : "", ConfirmedPassword: isSet(object.ConfirmedPassword) ? globalThis.String(object.ConfirmedPassword) : "", }; }, toJSON(message: SetInitialAdminPasswordRequest): unknown { const obj: any = {}; if (message.UserId !== undefined) { obj.UserId = Guid.toJSON(message.UserId); } if (message.Password !== "") { obj.Password = message.Password; } if (message.ConfirmedPassword !== "") { obj.ConfirmedPassword = message.ConfirmedPassword; } return obj; }, create(base?: DeepPartial): SetInitialAdminPasswordRequest { return SetInitialAdminPasswordRequest.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): SetInitialAdminPasswordRequest { const message = createBaseSetInitialAdminPasswordRequest(); message.UserId = (object.UserId !== undefined && object.UserId !== null) ? Guid.fromPartial(object.UserId) : undefined; message.Password = object.Password ?? ""; message.ConfirmedPassword = object.ConfirmedPassword ?? ""; return message; }, }; function createBaseUserResponse(): UserResponse { return { Id: undefined, Username: "", Email: "", IsActive: false, CreatedAt: undefined, LastModifiedAt: undefined, HasLoggedIn: false, }; } export const UserResponse: MessageFns = { encode(message: UserResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.Id !== undefined) { Guid.encode(message.Id, writer.uint32(10).fork()).join(); } if (message.Username !== "") { writer.uint32(18).string(message.Username); } if (message.Email !== "") { writer.uint32(26).string(message.Email); } if (message.IsActive !== false) { writer.uint32(32).bool(message.IsActive); } if (message.CreatedAt !== undefined) { SerializableDateTimeOffset.encode(message.CreatedAt, writer.uint32(42).fork()).join(); } if (message.LastModifiedAt !== undefined) { SerializableDateTimeOffset.encode(message.LastModifiedAt, writer.uint32(50).fork()).join(); } if (message.HasLoggedIn !== false) { writer.uint32(56).bool(message.HasLoggedIn); } return writer; }, decode(input: BinaryReader | Uint8Array, length?: number): UserResponse { 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 = createBaseUserResponse(); 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.Username = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.Email = reader.string(); continue; } case 4: { if (tag !== 32) { break; } message.IsActive = reader.bool(); continue; } case 5: { if (tag !== 42) { break; } message.CreatedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 6: { if (tag !== 50) { break; } message.LastModifiedAt = SerializableDateTimeOffset.decode(reader, reader.uint32()); continue; } case 7: { if (tag !== 56) { break; } message.HasLoggedIn = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; } finally { (reader as any).__tsProtoDecodeDepth = previousRecursionDepth; } }, fromJSON(object: any): UserResponse { return { Id: isSet(object.Id) ? Guid.fromJSON(object.Id) : undefined, Username: isSet(object.Username) ? globalThis.String(object.Username) : "", Email: isSet(object.Email) ? globalThis.String(object.Email) : "", IsActive: isSet(object.IsActive) ? globalThis.Boolean(object.IsActive) : false, CreatedAt: isSet(object.CreatedAt) ? SerializableDateTimeOffset.fromJSON(object.CreatedAt) : undefined, LastModifiedAt: isSet(object.LastModifiedAt) ? SerializableDateTimeOffset.fromJSON(object.LastModifiedAt) : undefined, HasLoggedIn: isSet(object.HasLoggedIn) ? globalThis.Boolean(object.HasLoggedIn) : false, }; }, toJSON(message: UserResponse): unknown { const obj: any = {}; if (message.Id !== undefined) { obj.Id = Guid.toJSON(message.Id); } if (message.Username !== "") { obj.Username = message.Username; } if (message.Email !== "") { obj.Email = message.Email; } if (message.IsActive !== false) { obj.IsActive = message.IsActive; } if (message.CreatedAt !== undefined) { obj.CreatedAt = SerializableDateTimeOffset.toJSON(message.CreatedAt); } if (message.LastModifiedAt !== undefined) { obj.LastModifiedAt = SerializableDateTimeOffset.toJSON(message.LastModifiedAt); } if (message.HasLoggedIn !== false) { obj.HasLoggedIn = message.HasLoggedIn; } return obj; }, create(base?: DeepPartial): UserResponse { return UserResponse.fromPartial(base ?? {}); }, fromPartial(object: DeepPartial): UserResponse { const message = createBaseUserResponse(); message.Id = (object.Id !== undefined && object.Id !== null) ? Guid.fromPartial(object.Id) : undefined; message.Username = object.Username ?? ""; message.Email = object.Email ?? ""; message.IsActive = object.IsActive ?? false; message.CreatedAt = (object.CreatedAt !== undefined && object.CreatedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.CreatedAt) : undefined; message.LastModifiedAt = (object.LastModifiedAt !== undefined && object.LastModifiedAt !== null) ? SerializableDateTimeOffset.fromPartial(object.LastModifiedAt) : undefined; message.HasLoggedIn = object.HasLoggedIn ?? false; 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 ApplicationsDefinition = typeof ApplicationsDefinition; export const ApplicationsDefinition = { name: "Applications", fullName: "Cratis.Chronicle.Contracts.Security.Applications", methods: { addApplication: { name: "AddApplication", requestType: AddApplicationRequest as typeof AddApplicationRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, allApplications: { name: "AllApplications", requestType: Empty as typeof Empty, requestStream: false, responseType: QueryResultIEnumerableApplicationResponse as typeof QueryResultIEnumerableApplicationResponse, responseStream: true, options: {}, }, changeApplicationSecret: { name: "ChangeApplicationSecret", requestType: ChangeApplicationSecretRequest as typeof ChangeApplicationSecretRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, removeApplication: { name: "RemoveApplication", requestType: RemoveApplicationRequest as typeof RemoveApplicationRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, }, } as const; export interface ApplicationsServiceImplementation { addApplication( request: AddApplicationRequest, context: CallContext & CallContextExt, ): Promise>; allApplications( request: Empty, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; changeApplicationSecret( request: ChangeApplicationSecretRequest, context: CallContext & CallContextExt, ): Promise>; removeApplication( request: RemoveApplicationRequest, context: CallContext & CallContextExt, ): Promise>; } export interface ApplicationsClient { addApplication( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; allApplications( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; changeApplicationSecret( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; removeApplication( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; } export type UsersDefinition = typeof UsersDefinition; export const UsersDefinition = { name: "Users", fullName: "Cratis.Chronicle.Contracts.Security.Users", methods: { addUser: { name: "AddUser", requestType: AddUserRequest as typeof AddUserRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, allUsers: { name: "AllUsers", requestType: Empty as typeof Empty, requestStream: false, responseType: QueryResultIEnumerableUserResponse as typeof QueryResultIEnumerableUserResponse, responseStream: true, options: {}, }, changeUserPassword: { name: "ChangeUserPassword", requestType: ChangeUserPasswordRequest as typeof ChangeUserPasswordRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, getStatus: { name: "GetStatus", requestType: Empty as typeof Empty, requestStream: false, responseType: QueryResultAdminPasswordStatusResponse as typeof QueryResultAdminPasswordStatusResponse, responseStream: false, options: {}, }, removeUser: { name: "RemoveUser", requestType: RemoveUserRequest as typeof RemoveUserRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, requirePasswordChange: { name: "RequirePasswordChange", requestType: RequirePasswordChangeRequest as typeof RequirePasswordChangeRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, setInitialAdminPassword: { name: "SetInitialAdminPassword", requestType: SetInitialAdminPasswordRequest as typeof SetInitialAdminPasswordRequest, requestStream: false, responseType: CommandResult as typeof CommandResult, responseStream: false, options: {}, }, }, } as const; export interface UsersServiceImplementation { addUser(request: AddUserRequest, context: CallContext & CallContextExt): Promise>; allUsers( request: Empty, context: CallContext & CallContextExt, ): ServerStreamingMethodResult>; changeUserPassword( request: ChangeUserPasswordRequest, context: CallContext & CallContextExt, ): Promise>; getStatus( request: Empty, context: CallContext & CallContextExt, ): Promise>; removeUser(request: RemoveUserRequest, context: CallContext & CallContextExt): Promise>; requirePasswordChange( request: RequirePasswordChangeRequest, context: CallContext & CallContextExt, ): Promise>; setInitialAdminPassword( request: SetInitialAdminPasswordRequest, context: CallContext & CallContextExt, ): Promise>; } export interface UsersClient { addUser(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; allUsers( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): AsyncIterable; changeUserPassword( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; getStatus( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; removeUser(request: DeepPartial, options?: CallOptions & CallOptionsExt): Promise; requirePasswordChange( request: DeepPartial, options?: CallOptions & CallOptionsExt, ): Promise; setInitialAdminPassword( 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; }