|
| 1 | +using Newtonsoft.Json; |
| 2 | +using Newtonsoft.Json.Linq; |
| 3 | + |
| 4 | +namespace Amino.Objects |
| 5 | +{ |
| 6 | + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] |
| 7 | + public class ChatTip |
| 8 | + { |
| 9 | + public int _type { get; } |
| 10 | + public int alertOption { get; } |
| 11 | + public int membershipStatus { get; } |
| 12 | + public int communityId { get; } |
| 13 | + |
| 14 | + public string chatId { get; } |
| 15 | + public int mediaType { get; } |
| 16 | + public int clientRefId { get; } |
| 17 | + public string messageId { get; } |
| 18 | + public string userId { get; } |
| 19 | + public string createdTime { get; } |
| 20 | + public int type { get; } |
| 21 | + public bool isHidden { get; } |
| 22 | + public bool includedInSummary { get; } |
| 23 | + public string json { get; } |
| 24 | + public _Author Author { get; } |
| 25 | + public _Extensions Extensions { get; } |
| 26 | + |
| 27 | + |
| 28 | + public ChatTip(JObject _json) |
| 29 | + { |
| 30 | + dynamic jsonObj = (JObject)JsonConvert.DeserializeObject(_json.ToString()); |
| 31 | + _type = (int)jsonObj["t"]; |
| 32 | + alertOption = (int)jsonObj["o"]["alertOption"]; |
| 33 | + membershipStatus = (int)jsonObj["o"]["membershipStatus"]; |
| 34 | + communityId = (int)jsonObj["o"]["ndcId"]; |
| 35 | + |
| 36 | + chatId = (string)jsonObj["o"]["chatMessage"]["threadId"]; |
| 37 | + mediaType = (int)jsonObj["o"]["chatMessage"]["mediaType"]; |
| 38 | + clientRefId = (int)jsonObj["o"]["chatMessage"]["clientRefId"]; |
| 39 | + messageId = (string)jsonObj["o"]["chatMessage"]["messageId"]; |
| 40 | + userId = (string)jsonObj["o"]["chatMessage"]["uid"]; |
| 41 | + createdTime = (string)jsonObj["o"]["chatMessage"]["createdTime"]; |
| 42 | + type = (int)jsonObj["o"]["chatMessage"]["type"]; |
| 43 | + isHidden = (bool)jsonObj["o"]["chatMessage"]["isHidden"]; |
| 44 | + includedInSummary = (bool)jsonObj["o"]["chatMessage"]["includedInSummary"]; |
| 45 | + json = _json.ToString(); |
| 46 | + Author = new _Author(_json); |
| 47 | + Extensions = new _Extensions(_json); |
| 48 | + |
| 49 | + } |
| 50 | + |
| 51 | + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] |
| 52 | + public class _Author |
| 53 | + { |
| 54 | + public string userId { get; } |
| 55 | + public int status { get; } |
| 56 | + public string iconUrl { get; } |
| 57 | + public int reputation { get; } |
| 58 | + public int role { get; } |
| 59 | + public string nickname { get; } |
| 60 | + public int level { get; } |
| 61 | + public int accountMembershipStatus { get; } |
| 62 | + public string avatarFrameId { get; } |
| 63 | + public _AvatarFrame AvatarFrame { get; } |
| 64 | + public _InfluencerInfo InfluencerInfo { get; } |
| 65 | + |
| 66 | + public _Author(JObject _json) |
| 67 | + { |
| 68 | + dynamic jsonObj = (JObject)JsonConvert.DeserializeObject(_json.ToString()); |
| 69 | + userId = (string)jsonObj["o"]["chatMessage"]["author"]["uid"]; |
| 70 | + status = (int)jsonObj["o"]["chatMessage"]["author"]["status"]; |
| 71 | + if(jsonObj["o"]["chatMessage"]["author"]["icon"] != null) { iconUrl = (string)jsonObj["o"]["chatMessage"]["author"]["icon"]; } |
| 72 | + reputation = (int)jsonObj["o"]["chatMessage"]["author"]["reputation"]; |
| 73 | + role = (int)jsonObj["o"]["chatMessage"]["author"]["role"]; |
| 74 | + nickname = (string)jsonObj["o"]["chatMessage"]["author"]["nickname"]; |
| 75 | + level = (int)jsonObj["o"]["chatMessage"]["author"]["level"]; |
| 76 | + accountMembershipStatus = (int)jsonObj["o"]["chatMessage"]["author"]["accountMembershipStatus"]; |
| 77 | + avatarFrameId = (string)jsonObj["o"]["chatMessage"]["author"]["avatarFrameId"]; |
| 78 | + if(jsonObj["o"]["chatMessage"]["author"]["avatarFrame"] != null) { AvatarFrame = new _AvatarFrame(_json); } |
| 79 | + if(jsonObj["o"]["chatMessage"]["author"]["influencerInfo"] != null) { InfluencerInfo = new _InfluencerInfo(_json); } |
| 80 | + } |
| 81 | + |
| 82 | + |
| 83 | + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] |
| 84 | + public class _AvatarFrame |
| 85 | + { |
| 86 | + public int status { get; } |
| 87 | + public int version { get; } |
| 88 | + public string resourceUrl { get; } |
| 89 | + public string name { get; } |
| 90 | + public string iconUrl { get; } |
| 91 | + public int frameType { get; } |
| 92 | + public string frameId { get; } |
| 93 | + |
| 94 | + public _AvatarFrame(JObject _json) |
| 95 | + { |
| 96 | + dynamic jsonObj = (JObject)JsonConvert.DeserializeObject(_json.ToString()); |
| 97 | + status = (int)jsonObj["o"]["chatMessage"]["author"]["avatarFrame"]["status"]; |
| 98 | + version = (int)jsonObj["o"]["chatMessage"]["author"]["avatarFrame"]["version"]; |
| 99 | + resourceUrl = (string)jsonObj["o"]["chatMessage"]["author"]["avatarFrame"]["resourceUrl"]; |
| 100 | + name = (string)jsonObj["o"]["chatMessage"]["author"]["avatarFrame"]["name"]; |
| 101 | + iconUrl = (string)jsonObj["o"]["chatMessage"]["author"]["avatarFrame"]["icon"]; |
| 102 | + frameType = (int)jsonObj["o"]["chatMessage"]["author"]["avatarFrame"]["frameType"]; |
| 103 | + frameId = (string)jsonObj["o"]["chatMessage"]["author"]["avatarFrame"]["frameId"]; |
| 104 | + } |
| 105 | + } |
| 106 | + |
| 107 | + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] |
| 108 | + public class _InfluencerInfo |
| 109 | + { |
| 110 | + public int fansCount { get; } |
| 111 | + public int monthlyFee { get; } |
| 112 | + |
| 113 | + public _InfluencerInfo(JObject _json) |
| 114 | + { |
| 115 | + dynamic jsonObj = (JObject)JsonConvert.DeserializeObject(_json.ToString()); |
| 116 | + fansCount = (int)jsonObj["o"]["chatMessage"]["author"]["influencerInfo"]["fansCount"]; |
| 117 | + monthlyFee = (int)jsonObj["o"]["chatMessage"]["author"]["influencerInfo"]["monthlyFee"]; |
| 118 | + } |
| 119 | + } |
| 120 | + } |
| 121 | + |
| 122 | + [JsonObject(ItemNullValueHandling = NullValueHandling.Ignore)] |
| 123 | + public class _Extensions |
| 124 | + { |
| 125 | + public int tippedCoins { get; } |
| 126 | + |
| 127 | + public _Extensions(JObject _json) |
| 128 | + { |
| 129 | + dynamic jsonObj = (JObject)JsonConvert.DeserializeObject(_json.ToString()); |
| 130 | + tippedCoins = (int)jsonObj["o"]["chatMessage"]["extensions"]["tippingCoins"]; |
| 131 | + } |
| 132 | + } |
| 133 | + } |
| 134 | +} |
0 commit comments