using System.Text.Json; using System.Text.Json.Serialization; using Kafka.Lib.Auth.Model; namespace Kafka.Lib.Auth; public class UserChangeClaimsMessageType : IMessageType { private string? _userId; private List? _claimChages; private string? _id; private bool _isSuccess = false; private Dictionary _errors = new (); public string? UserId { get => _userId; set => _userId = value; } public List? ClaimChages { get => _claimChages; set => _claimChages = value; } public string? Id { get => _id; set => _id = value; } public string? EventType { get; } = "UserChangeClaims"; public bool IsSuccess { get => _isSuccess; set => _isSuccess = value; } public Dictionary Errors { get => _errors; set => _errors = value; } [JsonIgnore] public string Text { get => JsonSerializer.Serialize(this); set { if (!string.IsNullOrEmpty(value)) { var obj = JsonSerializer.Deserialize(value); if (obj != null) { UserId = obj.UserId; ClaimChages = obj.ClaimChages; } } } } }