sharp-chat/SharpChat.DataProvider.Misuzu/Users/MisuzuUserAuthRequest.cs
2022-08-30 17:05:29 +02:00

27 lines
793 B
C#

using SharpChat.Users.Remote;
using System;
using System.Text.Json.Serialization;
namespace SharpChat.DataProvider.Misuzu.Users {
internal class MisuzuUserAuthRequest {
[JsonPropertyName(@"user_id")]
public long UserId => AuthRequest.UserId;
[JsonPropertyName(@"token")]
public string Token => AuthRequest.Token;
[JsonPropertyName(@"ip")]
public string IPAddress => AuthRequest.RemoteAddress.ToString();
private UserAuthRequest AuthRequest { get; }
public MisuzuUserAuthRequest(UserAuthRequest uar) {
AuthRequest = uar ?? throw new ArgumentNullException(nameof(uar));
}
public override string ToString() {
return string.Join(@"#", UserId, Token, IPAddress);
}
}
}