nitai/projects
rblxtool / src / ui / RblxTool / Models / Contracts.cs
246 lines · 5.7 KB Raw
1using System.Text.Json.Serialization;
2
3namespace RblxTool.Models;
4
5public sealed class AccountSummary
6{
7 [JsonPropertyName("id")]
8 public string Id { get; set; } = string.Empty;
9
10 [JsonPropertyName("label")]
11 public string Label { get; set; } = string.Empty;
12
13 [JsonPropertyName("user_id")]
14 public ulong UserId { get; set; }
15
16 [JsonPropertyName("username")]
17 public string Username { get; set; } = string.Empty;
18
19 [JsonPropertyName("display_name")]
20 public string DisplayName { get; set; } = string.Empty;
21
22 [JsonPropertyName("method")]
23 public string Method { get; set; } = "Cookie";
24
25 [JsonPropertyName("added_at")]
26 public ulong AddedAt { get; set; }
27
28 [JsonPropertyName("last_used")]
29 public ulong LastUsed { get; set; }
30
31 [JsonPropertyName("authenticated")]
32 public bool Authenticated { get; set; }
33}
34
35public sealed class AccountOverview
36{
37 [JsonPropertyName("user_id")]
38 public ulong UserId { get; set; }
39
40 [JsonPropertyName("username")]
41 public string Username { get; set; } = string.Empty;
42
43 [JsonPropertyName("robux")]
44 public long Robux { get; set; }
45
46 [JsonPropertyName("friends")]
47 public ulong Friends { get; set; }
48
49 [JsonPropertyName("followers")]
50 public ulong Followers { get; set; }
51
52 [JsonPropertyName("collectibles")]
53 public ulong Collectibles { get; set; }
54
55 [JsonPropertyName("total_rap")]
56 public ulong TotalRap { get; set; }
57}
58
59public sealed class EngineMetrics
60{
61 [JsonPropertyName("requests")]
62 public ulong Requests { get; set; }
63
64 [JsonPropertyName("retries")]
65 public ulong Retries { get; set; }
66
67 [JsonPropertyName("rate_limited")]
68 public ulong RateLimited { get; set; }
69
70 [JsonPropertyName("failures")]
71 public ulong Failures { get; set; }
72
73 [JsonPropertyName("bytes_in")]
74 public ulong BytesIn { get; set; }
75
76 [JsonPropertyName("avg_latency_ms")]
77 public double AverageLatencyMs { get; set; }
78}
79
80public sealed class JobEvent
81{
82 [JsonPropertyName("type")]
83 public string Type { get; set; } = string.Empty;
84
85 [JsonPropertyName("level")]
86 public string? Level { get; set; }
87
88 [JsonPropertyName("message")]
89 public string? Message { get; set; }
90
91 [JsonPropertyName("job")]
92 public string? Job { get; set; }
93
94 [JsonPropertyName("scanned")]
95 public ulong Scanned { get; set; }
96
97 [JsonPropertyName("matched")]
98 public ulong Matched { get; set; }
99
100 [JsonPropertyName("purchased")]
101 public ulong Purchased { get; set; }
102
103 [JsonPropertyName("elapsed_ms")]
104 public ulong ElapsedMs { get; set; }
105
106 [JsonPropertyName("done")]
107 public bool Done { get; set; }
108
109 [JsonPropertyName("id")]
110 public ulong Id { get; set; }
111
112 [JsonPropertyName("name")]
113 public string? Name { get; set; }
114
115 [JsonPropertyName("price")]
116 public ulong Price { get; set; }
117
118 [JsonPropertyName("creator")]
119 public string? Creator { get; set; }
120
121 [JsonPropertyName("collectible")]
122 public bool Collectible { get; set; }
123
124 [JsonPropertyName("success")]
125 public bool Success { get; set; }
126
127 [JsonPropertyName("detail")]
128 public string? Detail { get; set; }
129
130 [JsonPropertyName("members")]
131 public ulong Members { get; set; }
132
133 [JsonPropertyName("public_entry")]
134 public bool PublicEntry { get; set; }
135}
136
137public sealed class JobPoll
138{
139 [JsonPropertyName("ok")]
140 public bool Ok { get; set; }
141
142 [JsonPropertyName("events")]
143 public List<JobEvent> Events { get; set; } = new();
144
145 [JsonPropertyName("done")]
146 public bool Done { get; set; }
147}
148
149public sealed class LoginResult
150{
151 [JsonPropertyName("ok")]
152 public bool Ok { get; set; }
153
154 [JsonPropertyName("state")]
155 public string? State { get; set; }
156
157 [JsonPropertyName("error")]
158 public string? Error { get; set; }
159
160 [JsonPropertyName("pendingId")]
161 public string? PendingId { get; set; }
162
163 [JsonPropertyName("mediaType")]
164 public string? MediaType { get; set; }
165
166 [JsonPropertyName("challengeId")]
167 public string? ChallengeId { get; set; }
168
169 [JsonPropertyName("challengeType")]
170 public string? ChallengeType { get; set; }
171
172 [JsonPropertyName("arkoseKey")]
173 public string? ArkoseKey { get; set; }
174
175 [JsonPropertyName("blob")]
176 public string? Blob { get; set; }
177
178 [JsonPropertyName("account")]
179 public AccountSummary? Account { get; set; }
180}
181
182public sealed class OauthUrlResult
183{
184 [JsonPropertyName("ok")]
185 public bool Ok { get; set; }
186
187 [JsonPropertyName("url")]
188 public string? Url { get; set; }
189
190 [JsonPropertyName("verifier")]
191 public string? Verifier { get; set; }
192
193 [JsonPropertyName("state")]
194 public string? State { get; set; }
195
196 [JsonPropertyName("error")]
197 public string? Error { get; set; }
198}
199
200public sealed class Envelope<T>
201{
202 [JsonPropertyName("ok")]
203 public bool Ok { get; set; }
204
205 [JsonPropertyName("data")]
206 public T? Data { get; set; }
207
208 [JsonPropertyName("error")]
209 public string? Error { get; set; }
210}
211
212public sealed class SweepReport
213{
214 [JsonPropertyName("scanned")]
215 public ulong Scanned { get; set; }
216
217 [JsonPropertyName("matched")]
218 public ulong Matched { get; set; }
219
220 [JsonPropertyName("purchased")]
221 public ulong Purchased { get; set; }
222
223 [JsonPropertyName("failed")]
224 public ulong Failed { get; set; }
225
226 [JsonPropertyName("elapsed_ms")]
227 public ulong ElapsedMs { get; set; }
228}
229
230public sealed class HuntReport
231{
232 [JsonPropertyName("scanned")]
233 public ulong Scanned { get; set; }
234
235 [JsonPropertyName("ownerless")]
236 public ulong Ownerless { get; set; }
237
238 [JsonPropertyName("claimable")]
239 public ulong Claimable { get; set; }
240
241 [JsonPropertyName("claimed")]
242 public ulong Claimed { get; set; }
243
244 [JsonPropertyName("elapsed_ms")]
245 public ulong ElapsedMs { get; set; }
246}