|
1 |
| -using Newtonsoft.Json; |
| 1 | +using System.Text.Json.Serialization; |
2 | 2 |
|
3 | 3 | namespace AutoClaimStickers;
|
| 4 | + |
4 | 5 | #pragma warning disable CA1812
|
5 | 6 | internal sealed record CanClaimItemData {
|
6 |
| - [JsonProperty("response", Required = Required.Always)] |
7 |
| - public CanClaimItemResponse? Response { get; set; } |
| 7 | + [JsonPropertyName("response"), JsonRequired] |
| 8 | + public CanClaimItemResponse? Response { get; init; } |
8 | 9 | }
|
9 | 10 | internal sealed record CanClaimItemResponse {
|
10 |
| - [JsonProperty("can_claim")] |
11 |
| - public bool? CanClaim { get; set; } |
12 |
| - [JsonProperty("next_claim_time")] |
13 |
| - public int? NextClaimTime { get; set; } |
14 |
| - [JsonProperty("reward_item")] |
15 |
| - public RewardItem? RewardItem { get; set; } |
| 11 | + [JsonPropertyName("can_claim")] |
| 12 | + public bool? CanClaim { get; init; } |
| 13 | + [JsonPropertyName("next_claim_time")] |
| 14 | + public int? NextClaimTime { get; init; } |
| 15 | + [JsonPropertyName("reward_item")] |
| 16 | + public RewardItem? RewardItem { get; init; } |
16 | 17 | }
|
17 | 18 | internal sealed record ClaimItemData {
|
18 |
| - [JsonProperty("response", Required = Required.Always)] |
19 |
| - public ClaimItemResponse? Response { get; set; } |
| 19 | + [JsonPropertyName("response"), JsonRequired] |
| 20 | + public ClaimItemResponse? Response { get; init; } |
20 | 21 | }
|
21 | 22 | internal sealed record ClaimItemResponse {
|
22 |
| - [JsonProperty("communityitemid")] |
23 |
| - public long? CommunityItemId { get; set; } |
24 |
| - [JsonProperty("next_claim_time")] |
25 |
| - public int? NextClaimTime { get; set; } |
26 |
| - [JsonProperty("reward_item")] |
27 |
| - public RewardItem? RewardItem { get; set; } |
| 23 | + [JsonPropertyName("communityitemid")] |
| 24 | + public long? CommunityItemId { get; init; } |
| 25 | + [JsonPropertyName("next_claim_time")] |
| 26 | + public int? NextClaimTime { get; init; } |
| 27 | + [JsonPropertyName("reward_item")] |
| 28 | + public RewardItem? RewardItem { get; init; } |
28 | 29 | }
|
29 | 30 | #pragma warning disable IDE1006
|
30 | 31 | internal sealed record RewardItem {
|
31 |
| - public int? appid { get; set; } |
32 |
| - public int? defid { get; set; } |
33 |
| - public int? type { get; set; } |
34 |
| - public int? community_item_class { get; set; } |
35 |
| - public int? community_item_type { get; set; } |
36 |
| - public string? point_cost { get; set; } |
37 |
| - public int? timestamp_created { get; set; } |
38 |
| - public int? timestamp_updated { get; set; } |
39 |
| - public int? timestamp_available { get; set; } |
40 |
| - public int? timestamp_available_end { get; set; } |
41 |
| - public string? quantity { get; set; } |
42 |
| - public string? internal_description { get; set; } |
43 |
| - public bool? active { get; set; } |
44 |
| - public CommunityItemData? community_item_data { get; set; } |
45 |
| - public int? usable_duration { get; set; } |
46 |
| - public int? bundle_discount { get; set; } |
| 32 | + public int? appid { get; init; } |
| 33 | + public int? defid { get; init; } |
| 34 | + public int? type { get; init; } |
| 35 | + public int? community_item_class { get; init; } |
| 36 | + public int? community_item_type { get; init; } |
| 37 | + public string? point_cost { get; init; } |
| 38 | + public int? timestamp_created { get; init; } |
| 39 | + public int? timestamp_updated { get; init; } |
| 40 | + public int? timestamp_available { get; init; } |
| 41 | + public int? timestamp_available_end { get; init; } |
| 42 | + public string? quantity { get; init; } |
| 43 | + public string? internal_description { get; init; } |
| 44 | + public bool? active { get; init; } |
| 45 | + public CommunityItemData? community_item_data { get; init; } |
| 46 | + public int? usable_duration { get; init; } |
| 47 | + public int? bundle_discount { get; init; } |
47 | 48 | }
|
48 | 49 | internal sealed record CommunityItemData {
|
49 |
| - public string? item_name { get; set; } |
50 |
| - public string? item_title { get; set; } |
51 |
| - public string? item_description { get; set; } |
52 |
| - public string? item_image_small { get; set; } |
53 |
| - public string? item_image_large { get; set; } |
54 |
| - public bool? animated { get; set; } |
| 50 | + public string? item_name { get; init; } |
| 51 | + public string? item_title { get; init; } |
| 52 | + public string? item_description { get; init; } |
| 53 | + public string? item_image_small { get; init; } |
| 54 | + public string? item_image_large { get; init; } |
| 55 | + public bool? animated { get; init; } |
55 | 56 | }
|
56 |
| -#pragma warning restore IDE1006 |
57 | 57 | #pragma warning restore CA1812
|
0 commit comments