2019-10-07 13:48:05 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Online.API.Requests.Responses
|
|
|
|
|
{
|
|
|
|
|
public class Comment
|
|
|
|
|
{
|
|
|
|
|
[JsonProperty(@"id")]
|
|
|
|
|
public long Id { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"parent_id")]
|
2019-10-14 21:26:31 +00:00
|
|
|
|
public long? ParentId { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
2022-09-27 19:45:05 +00:00
|
|
|
|
public Comment? ParentComment { get; set; }
|
2019-10-08 16:09:02 +00:00
|
|
|
|
|
2019-10-07 13:48:05 +00:00
|
|
|
|
[JsonProperty(@"user_id")]
|
2019-10-08 19:46:42 +00:00
|
|
|
|
public long? UserId { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
2022-09-27 19:45:05 +00:00
|
|
|
|
public APIUser? User { get; set; }
|
2019-10-08 10:45:13 +00:00
|
|
|
|
|
2019-10-07 13:48:05 +00:00
|
|
|
|
[JsonProperty(@"message")]
|
2022-09-27 19:45:05 +00:00
|
|
|
|
public string Message { get; set; } = null!;
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty(@"message_html")]
|
2022-09-27 19:45:05 +00:00
|
|
|
|
public string? MessageHtml { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty(@"replies_count")]
|
|
|
|
|
public int RepliesCount { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"votes_count")]
|
|
|
|
|
public int VotesCount { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"commenatble_type")]
|
2022-09-27 19:45:05 +00:00
|
|
|
|
public string CommentableType { get; set; } = null!;
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty(@"commentable_id")]
|
|
|
|
|
public int CommentableId { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"legacy_name")]
|
2022-09-27 19:45:05 +00:00
|
|
|
|
public string? LegacyName { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty(@"created_at")]
|
|
|
|
|
public DateTimeOffset CreatedAt { get; set; }
|
|
|
|
|
|
|
|
|
|
[JsonProperty(@"updated_at")]
|
2019-10-07 15:26:07 +00:00
|
|
|
|
public DateTimeOffset? UpdatedAt { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty(@"deleted_at")]
|
2019-10-14 21:26:31 +00:00
|
|
|
|
public DateTimeOffset? DeletedAt { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty(@"edited_at")]
|
2019-10-07 15:26:07 +00:00
|
|
|
|
public DateTimeOffset? EditedAt { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
|
|
|
|
|
[JsonProperty(@"edited_by_id")]
|
2019-10-07 15:26:07 +00:00
|
|
|
|
public long? EditedById { get; set; }
|
2019-10-07 13:58:24 +00:00
|
|
|
|
|
2021-08-08 10:20:46 +00:00
|
|
|
|
[JsonProperty(@"pinned")]
|
|
|
|
|
public bool Pinned { get; set; }
|
|
|
|
|
|
2022-09-27 19:45:05 +00:00
|
|
|
|
public APIUser? EditedUser { get; set; }
|
2019-10-09 08:32:17 +00:00
|
|
|
|
|
2019-10-14 21:26:31 +00:00
|
|
|
|
public bool IsTopLevel => !ParentId.HasValue;
|
2019-10-07 15:45:22 +00:00
|
|
|
|
|
2019-10-14 21:26:31 +00:00
|
|
|
|
public bool IsDeleted => DeletedAt.HasValue;
|
2019-10-08 10:31:49 +00:00
|
|
|
|
|
2020-01-29 03:44:39 +00:00
|
|
|
|
public bool HasMessage => !string.IsNullOrEmpty(Message);
|
2019-10-14 13:43:43 +00:00
|
|
|
|
|
2019-10-17 09:35:12 +00:00
|
|
|
|
public bool IsVoted { get; set; }
|
2019-10-07 13:48:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|