-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathConfirmation.cs
99 lines (88 loc) · 3.01 KB
/
Confirmation.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SteamAuth
{
public class GetListJson
{
public bool success { get; set; }
public bool needauth { get; set; }
public List<Conf> conf { get; set; }
public class Conf
{
public int type { get; set; }
public string type_name { get; set; }
public string id { get; set; }
public string creator_id { get; set; }
public string nonce { get; set; }
public long creation_time { get; set; }
public string cancel { get; set; }
public string accept { get; set; }
public string icon { get; set; }
public bool multi { get; set; }
public string headline { get; set; }
public List<string> summary { get; set; }
public object warn { get; set; }
}
}
public class Confirmation
{
public string type_name { get; set; }
public string icon { get; set; }
public string headline { get; set; }
public List<string> summary { get; set; }
public long creation_time { get; set; }
/// <summary>
/// The ID of this confirmation
/// </summary>
public ulong ID;
/// <summary>
/// The unique key used to act upon this confirmation.
/// </summary>
public ulong Key;
/// <summary>
/// The value of the data-type HTML attribute returned for this contribution.
/// </summary>
public int IntType;
/// <summary>
/// Represents either the Trade Offer ID or market transaction ID that caused this confirmation to be created.
/// </summary>
public ulong Creator;
/// <summary>
/// The type of this confirmation.
/// </summary>
public ConfirmationType ConfType;
public Confirmation(ulong id, ulong key, int type, ulong creator)
{
this.ID = id;
this.Key = key;
this.IntType = type;
this.Creator = creator;
//Do a switch simply because we're not 100% certain of all the possible types.
switch (type)
{
case 1:
this.ConfType = ConfirmationType.GenericConfirmation;
break;
case 2:
this.ConfType = ConfirmationType.Trade;
break;
case 3:
this.ConfType = ConfirmationType.MarketSellTransaction;
break;
default:
this.ConfType = ConfirmationType.Unknown;
break;
}
}
public enum ConfirmationType
{
GenericConfirmation,
Trade,
MarketSellTransaction,
Unknown
}
}
}