sharp-chat/SharpChat.DataProvider.Misuzu/Users/MisuzuUserAuthRequest.cs

27 lines
793 B
C#
Raw Normal View History

2022-08-30 15:05:29 +00:00
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);
}
}
}