1#![allow(non_camel_case_types)]
2#![allow(non_upper_case_globals)]
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
4#[repr(i32)]
5pub enum EResult {
6 Invalid = 0,
7 OK = 1,
8 Fail = 2,
9 NoConnection = 3,
10 InvalidPassword = 5,
11 LoggedInElsewhere = 6,
12 InvalidProtocolVer = 7,
13 InvalidParam = 8,
14 FileNotFound = 9,
15 Busy = 10,
16 InvalidState = 11,
17 InvalidName = 12,
18 InvalidEmail = 13,
19 DuplicateName = 14,
20 AccessDenied = 15,
21 Timeout = 16,
22 Banned = 17,
23 AccountNotFound = 18,
24 InvalidSteamID = 19,
25 ServiceUnavailable = 20,
26 NotLoggedOn = 21,
27 Pending = 22,
28 EncryptionFailure = 23,
29 InsufficientPrivilege = 24,
30 LimitExceeded = 25,
31 Revoked = 26,
32 Expired = 27,
33 AlreadyRedeemed = 28,
34 DuplicateRequest = 29,
35 AlreadyOwned = 30,
36 IPNotFound = 31,
37 PersistFailed = 32,
38 LockingFailed = 33,
39 LogonSessionReplaced = 34,
40 ConnectFailed = 35,
41 HandshakeFailed = 36,
42 IOFailure = 37,
43 RemoteDisconnect = 38,
44 ShoppingCartNotFound = 39,
45 Blocked = 40,
46 Ignored = 41,
47 NoMatch = 42,
48 AccountDisabled = 43,
49 ServiceReadOnly = 44,
50 AccountNotFeatured = 45,
51 AdministratorOK = 46,
52 ContentVersion = 47,
53 TryAnotherCM = 48,
54 PasswordRequiredToKickSession = 49,
55 AlreadyLoggedInElsewhere = 50,
56 Suspended = 51,
57 Cancelled = 52,
58 DataCorruption = 53,
59 DiskFull = 54,
60 RemoteCallFailed = 55,
61 PasswordUnset = 56,
62 ExternalAccountUnlinked = 57,
63 PSNTicketInvalid = 58,
64 ExternalAccountAlreadyLinked = 59,
65 RemoteFileConflict = 60,
66 IllegalPassword = 61,
67 SameAsPreviousValue = 62,
68 AccountLogonDenied = 63,
69 CannotUseOldPassword = 64,
70 InvalidLoginAuthCode = 65,
71 AccountLogonDeniedNoMail = 66,
72 HardwareNotCapableOfIPT = 67,
73 IPTInitError = 68,
74 ParentalControlRestricted = 69,
75 FacebookQueryError = 70,
76 ExpiredLoginAuthCode = 71,
77 IPLoginRestrictionFailed = 72,
78 AccountLockedDown = 73,
79 AccountLogonDeniedVerifiedEmailRequired = 74,
80 NoMatchingURL = 75,
81 BadResponse = 76,
82 RequirePasswordReEntry = 77,
83 ValueOutOfRange = 78,
84 UnexpectedError = 79,
85 Disabled = 80,
86 InvalidCEGSubmission = 81,
87 RestrictedDevice = 82,
88 RegionLocked = 83,
89 RateLimitExceeded = 84,
90 AccountLoginDeniedNeedTwoFactor = 85,
91 ItemDeleted = 86,
92 AccountLoginDeniedThrottle = 87,
93 TwoFactorCodeMismatch = 88,
94 TwoFactorActivationCodeMismatch = 89,
95 AccountAssociatedToMultiplePartners = 90,
96 NotModified = 91,
97 NoMobileDevice = 92,
98 TimeNotSynced = 93,
99 SMSCodeFailed = 94,
100 AccountLimitExceeded = 95,
101 AccountActivityLimitExceeded = 96,
102 PhoneActivityLimitExceeded = 97,
103 RefundToWallet = 98,
104 EmailSendFailure = 99,
105 NotSettled = 100,
106 NeedCaptcha = 101,
107 GSLTDenied = 102,
108 GSOwnerDenied = 103,
109 InvalidItemType = 104,
110 IPBanned = 105,
111 GSLTExpired = 106,
112 InsufficientFunds = 107,
113 TooManyPending = 108,
114 NoSiteLicensesFound = 109,
115 WGNetworkSendExceeded = 110,
116 AccountNotFriends = 111,
117 LimitedUserAccount = 112,
118 CantRemoveItem = 113,
119 AccountDeleted = 114,
120 ExistingUserCancelledLicense = 115,
121 CommunityCooldown = 116,
122 NoLauncherSpecified = 117,
123 MustAgreeToSSA = 118,
124 LauncherMigrated = 119,
125 SteamRealmMismatch = 120,
126 InvalidSignature = 121,
127 ParseFailure = 122,
128 NoVerifiedPhone = 123,
129 InsufficientBattery = 124,
130 ChargerRequired = 125,
131 CachedCredentialInvalid = 126,
132 PhoneNumberIsVOIP = 127,
133 NotSupported = 128,
134 FamilySizeLimitExceeded = 129,
135 OfflineAppCacheInvalid = 130,
136 TryLater = 131,
137}
138
139impl EResult {
140 pub fn from_i32(val: i32) -> Option<Self> {
141 match val {
142 x if x == Self::Invalid as i32 => Some(Self::Invalid),
143 x if x == Self::OK as i32 => Some(Self::OK),
144 x if x == Self::Fail as i32 => Some(Self::Fail),
145 x if x == Self::NoConnection as i32 => Some(Self::NoConnection),
146 x if x == Self::InvalidPassword as i32 => Some(Self::InvalidPassword),
147 x if x == Self::LoggedInElsewhere as i32 => Some(Self::LoggedInElsewhere),
148 x if x == Self::InvalidProtocolVer as i32 => Some(Self::InvalidProtocolVer),
149 x if x == Self::InvalidParam as i32 => Some(Self::InvalidParam),
150 x if x == Self::FileNotFound as i32 => Some(Self::FileNotFound),
151 x if x == Self::Busy as i32 => Some(Self::Busy),
152 x if x == Self::InvalidState as i32 => Some(Self::InvalidState),
153 x if x == Self::InvalidName as i32 => Some(Self::InvalidName),
154 x if x == Self::InvalidEmail as i32 => Some(Self::InvalidEmail),
155 x if x == Self::DuplicateName as i32 => Some(Self::DuplicateName),
156 x if x == Self::AccessDenied as i32 => Some(Self::AccessDenied),
157 x if x == Self::Timeout as i32 => Some(Self::Timeout),
158 x if x == Self::Banned as i32 => Some(Self::Banned),
159 x if x == Self::AccountNotFound as i32 => Some(Self::AccountNotFound),
160 x if x == Self::InvalidSteamID as i32 => Some(Self::InvalidSteamID),
161 x if x == Self::ServiceUnavailable as i32 => Some(Self::ServiceUnavailable),
162 x if x == Self::NotLoggedOn as i32 => Some(Self::NotLoggedOn),
163 x if x == Self::Pending as i32 => Some(Self::Pending),
164 x if x == Self::EncryptionFailure as i32 => Some(Self::EncryptionFailure),
165 x if x == Self::InsufficientPrivilege as i32 => Some(Self::InsufficientPrivilege),
166 x if x == Self::LimitExceeded as i32 => Some(Self::LimitExceeded),
167 x if x == Self::Revoked as i32 => Some(Self::Revoked),
168 x if x == Self::Expired as i32 => Some(Self::Expired),
169 x if x == Self::AlreadyRedeemed as i32 => Some(Self::AlreadyRedeemed),
170 x if x == Self::DuplicateRequest as i32 => Some(Self::DuplicateRequest),
171 x if x == Self::AlreadyOwned as i32 => Some(Self::AlreadyOwned),
172 x if x == Self::IPNotFound as i32 => Some(Self::IPNotFound),
173 x if x == Self::PersistFailed as i32 => Some(Self::PersistFailed),
174 x if x == Self::LockingFailed as i32 => Some(Self::LockingFailed),
175 x if x == Self::LogonSessionReplaced as i32 => Some(Self::LogonSessionReplaced),
176 x if x == Self::ConnectFailed as i32 => Some(Self::ConnectFailed),
177 x if x == Self::HandshakeFailed as i32 => Some(Self::HandshakeFailed),
178 x if x == Self::IOFailure as i32 => Some(Self::IOFailure),
179 x if x == Self::RemoteDisconnect as i32 => Some(Self::RemoteDisconnect),
180 x if x == Self::ShoppingCartNotFound as i32 => Some(Self::ShoppingCartNotFound),
181 x if x == Self::Blocked as i32 => Some(Self::Blocked),
182 x if x == Self::Ignored as i32 => Some(Self::Ignored),
183 x if x == Self::NoMatch as i32 => Some(Self::NoMatch),
184 x if x == Self::AccountDisabled as i32 => Some(Self::AccountDisabled),
185 x if x == Self::ServiceReadOnly as i32 => Some(Self::ServiceReadOnly),
186 x if x == Self::AccountNotFeatured as i32 => Some(Self::AccountNotFeatured),
187 x if x == Self::AdministratorOK as i32 => Some(Self::AdministratorOK),
188 x if x == Self::ContentVersion as i32 => Some(Self::ContentVersion),
189 x if x == Self::TryAnotherCM as i32 => Some(Self::TryAnotherCM),
190 x if x == Self::PasswordRequiredToKickSession as i32 => Some(Self::PasswordRequiredToKickSession),
191 x if x == Self::AlreadyLoggedInElsewhere as i32 => Some(Self::AlreadyLoggedInElsewhere),
192 x if x == Self::Suspended as i32 => Some(Self::Suspended),
193 x if x == Self::Cancelled as i32 => Some(Self::Cancelled),
194 x if x == Self::DataCorruption as i32 => Some(Self::DataCorruption),
195 x if x == Self::DiskFull as i32 => Some(Self::DiskFull),
196 x if x == Self::RemoteCallFailed as i32 => Some(Self::RemoteCallFailed),
197 x if x == Self::PasswordUnset as i32 => Some(Self::PasswordUnset),
198 x if x == Self::ExternalAccountUnlinked as i32 => Some(Self::ExternalAccountUnlinked),
199 x if x == Self::PSNTicketInvalid as i32 => Some(Self::PSNTicketInvalid),
200 x if x == Self::ExternalAccountAlreadyLinked as i32 => Some(Self::ExternalAccountAlreadyLinked),
201 x if x == Self::RemoteFileConflict as i32 => Some(Self::RemoteFileConflict),
202 x if x == Self::IllegalPassword as i32 => Some(Self::IllegalPassword),
203 x if x == Self::SameAsPreviousValue as i32 => Some(Self::SameAsPreviousValue),
204 x if x == Self::AccountLogonDenied as i32 => Some(Self::AccountLogonDenied),
205 x if x == Self::CannotUseOldPassword as i32 => Some(Self::CannotUseOldPassword),
206 x if x == Self::InvalidLoginAuthCode as i32 => Some(Self::InvalidLoginAuthCode),
207 x if x == Self::AccountLogonDeniedNoMail as i32 => Some(Self::AccountLogonDeniedNoMail),
208 x if x == Self::HardwareNotCapableOfIPT as i32 => Some(Self::HardwareNotCapableOfIPT),
209 x if x == Self::IPTInitError as i32 => Some(Self::IPTInitError),
210 x if x == Self::ParentalControlRestricted as i32 => Some(Self::ParentalControlRestricted),
211 x if x == Self::FacebookQueryError as i32 => Some(Self::FacebookQueryError),
212 x if x == Self::ExpiredLoginAuthCode as i32 => Some(Self::ExpiredLoginAuthCode),
213 x if x == Self::IPLoginRestrictionFailed as i32 => Some(Self::IPLoginRestrictionFailed),
214 x if x == Self::AccountLockedDown as i32 => Some(Self::AccountLockedDown),
215 x if x == Self::AccountLogonDeniedVerifiedEmailRequired as i32 => Some(Self::AccountLogonDeniedVerifiedEmailRequired),
216 x if x == Self::NoMatchingURL as i32 => Some(Self::NoMatchingURL),
217 x if x == Self::BadResponse as i32 => Some(Self::BadResponse),
218 x if x == Self::RequirePasswordReEntry as i32 => Some(Self::RequirePasswordReEntry),
219 x if x == Self::ValueOutOfRange as i32 => Some(Self::ValueOutOfRange),
220 x if x == Self::UnexpectedError as i32 => Some(Self::UnexpectedError),
221 x if x == Self::Disabled as i32 => Some(Self::Disabled),
222 x if x == Self::InvalidCEGSubmission as i32 => Some(Self::InvalidCEGSubmission),
223 x if x == Self::RestrictedDevice as i32 => Some(Self::RestrictedDevice),
224 x if x == Self::RegionLocked as i32 => Some(Self::RegionLocked),
225 x if x == Self::RateLimitExceeded as i32 => Some(Self::RateLimitExceeded),
226 x if x == Self::AccountLoginDeniedNeedTwoFactor as i32 => Some(Self::AccountLoginDeniedNeedTwoFactor),
227 x if x == Self::ItemDeleted as i32 => Some(Self::ItemDeleted),
228 x if x == Self::AccountLoginDeniedThrottle as i32 => Some(Self::AccountLoginDeniedThrottle),
229 x if x == Self::TwoFactorCodeMismatch as i32 => Some(Self::TwoFactorCodeMismatch),
230 x if x == Self::TwoFactorActivationCodeMismatch as i32 => Some(Self::TwoFactorActivationCodeMismatch),
231 x if x == Self::AccountAssociatedToMultiplePartners as i32 => Some(Self::AccountAssociatedToMultiplePartners),
232 x if x == Self::NotModified as i32 => Some(Self::NotModified),
233 x if x == Self::NoMobileDevice as i32 => Some(Self::NoMobileDevice),
234 x if x == Self::TimeNotSynced as i32 => Some(Self::TimeNotSynced),
235 x if x == Self::SMSCodeFailed as i32 => Some(Self::SMSCodeFailed),
236 x if x == Self::AccountLimitExceeded as i32 => Some(Self::AccountLimitExceeded),
237 x if x == Self::AccountActivityLimitExceeded as i32 => Some(Self::AccountActivityLimitExceeded),
238 x if x == Self::PhoneActivityLimitExceeded as i32 => Some(Self::PhoneActivityLimitExceeded),
239 x if x == Self::RefundToWallet as i32 => Some(Self::RefundToWallet),
240 x if x == Self::EmailSendFailure as i32 => Some(Self::EmailSendFailure),
241 x if x == Self::NotSettled as i32 => Some(Self::NotSettled),
242 x if x == Self::NeedCaptcha as i32 => Some(Self::NeedCaptcha),
243 x if x == Self::GSLTDenied as i32 => Some(Self::GSLTDenied),
244 x if x == Self::GSOwnerDenied as i32 => Some(Self::GSOwnerDenied),
245 x if x == Self::InvalidItemType as i32 => Some(Self::InvalidItemType),
246 x if x == Self::IPBanned as i32 => Some(Self::IPBanned),
247 x if x == Self::GSLTExpired as i32 => Some(Self::GSLTExpired),
248 x if x == Self::InsufficientFunds as i32 => Some(Self::InsufficientFunds),
249 x if x == Self::TooManyPending as i32 => Some(Self::TooManyPending),
250 x if x == Self::NoSiteLicensesFound as i32 => Some(Self::NoSiteLicensesFound),
251 x if x == Self::WGNetworkSendExceeded as i32 => Some(Self::WGNetworkSendExceeded),
252 x if x == Self::AccountNotFriends as i32 => Some(Self::AccountNotFriends),
253 x if x == Self::LimitedUserAccount as i32 => Some(Self::LimitedUserAccount),
254 x if x == Self::CantRemoveItem as i32 => Some(Self::CantRemoveItem),
255 x if x == Self::AccountDeleted as i32 => Some(Self::AccountDeleted),
256 x if x == Self::ExistingUserCancelledLicense as i32 => Some(Self::ExistingUserCancelledLicense),
257 x if x == Self::CommunityCooldown as i32 => Some(Self::CommunityCooldown),
258 x if x == Self::NoLauncherSpecified as i32 => Some(Self::NoLauncherSpecified),
259 x if x == Self::MustAgreeToSSA as i32 => Some(Self::MustAgreeToSSA),
260 x if x == Self::LauncherMigrated as i32 => Some(Self::LauncherMigrated),
261 x if x == Self::SteamRealmMismatch as i32 => Some(Self::SteamRealmMismatch),
262 x if x == Self::InvalidSignature as i32 => Some(Self::InvalidSignature),
263 x if x == Self::ParseFailure as i32 => Some(Self::ParseFailure),
264 x if x == Self::NoVerifiedPhone as i32 => Some(Self::NoVerifiedPhone),
265 x if x == Self::InsufficientBattery as i32 => Some(Self::InsufficientBattery),
266 x if x == Self::ChargerRequired as i32 => Some(Self::ChargerRequired),
267 x if x == Self::CachedCredentialInvalid as i32 => Some(Self::CachedCredentialInvalid),
268 x if x == Self::PhoneNumberIsVOIP as i32 => Some(Self::PhoneNumberIsVOIP),
269 x if x == Self::NotSupported as i32 => Some(Self::NotSupported),
270 x if x == Self::FamilySizeLimitExceeded as i32 => Some(Self::FamilySizeLimitExceeded),
271 x if x == Self::OfflineAppCacheInvalid as i32 => Some(Self::OfflineAppCacheInvalid),
272 x if x == Self::TryLater as i32 => Some(Self::TryLater),
273 _ => None,
274 }
275 }
276}