hank
2017-06-14 a0a84333e64f1e94ae9d0f69545037c60e781842
commit | author | age
a0a843 1 //
H 2 //  TWTRNetworkingConstants.h
3 //  TwitterKit
4 //
5 //  Created by Kang Chen on 11/12/14.
6 //  Copyright (c) 2014 Twitter. All rights reserved.
7 //
8
9 #import <Foundation/Foundation.h>
10
11 FOUNDATION_EXPORT NSString *const TWTRNetworkingErrorDomain;
12 FOUNDATION_EXPORT NSString *const TWTRNetworkingUserAgentHeaderKey;
13 FOUNDATION_EXPORT NSString *const TWTRNetworkingStatusCodeKey;
14
15 #pragma mark - HTTP Headers
16 FOUNDATION_EXPORT NSString *const TWTRContentTypeHeaderField;
17 FOUNDATION_EXPORT NSString *const TWTRContentLengthHeaderField;
18 FOUNDATION_EXPORT NSString *const TWTRContentTypeURLEncoded;
19 FOUNDATION_EXPORT NSString *const TWTRAcceptEncodingHeaderField;
20 FOUNDATION_EXPORT NSString *const TWTRAcceptEncodingGzip;
21
22 /**
23  * Internal API error codes
24  * These error codes belong to the `TWTRAPIErrorDomain` error domain.
25  * @see https://cgit.twitter.biz/birdcage/tree/macaw/macaw-core/src/main/scala/com/twitter/macaw/monorail/ApiError.scala
26  */
27 // TODO: Move these to the public header because they can all surface to the developer?
28 typedef NS_ENUM(NSUInteger, TWTRTwitterAPIErrorCode) {
29     /**
30      *  "%s parameter is invalid"
31      */
32     TWTRTwitterAPIErrorInvalidParameter = 44,
33
34     /**
35      * "The email address associated with this account is invalid."
36      */
37     TWTRTwitterAPIErrorInvalidEmailAddress = 56,
38
39     /**
40      *  "Client is not permitted to perform this action"
41      */
42     TWTRTwitterAPIErrorClientNotPrivileged = 87,
43
44     /**
45      *  "Rate limit exceeded"
46      */
47     TWTRTwitterAPIErrorRateLimitExceeded = 88,
48
49     /**
50      *  "Account update failed: %s."
51      */
52     TWTRTwitterAPIErrorAccountUpdateFailure = 120,
53
54     /**
55      *  "Bad Authentication data."
56      */
57     TWTRTwitterAPIErrorCodeBadAuthenticationData = 215,
58
59     /**
60      *  "The login verification request has expired"
61      */
62     TWTRTwitterAPIErrorExpiredLoginVerificationRequest = 235,
63
64     /**
65      *  "The challenge response is incorrect"
66      */
67     TWTRTwitterAPIErrorIncorrectChallengeResponse = 236,
68
69     /**
70      *  "That is not an active login verification request ID"
71      */
72     TWTRTwitterAPIErrorMissingLoginVerificationRequest = 237,
73
74     /**
75      *  "Your signup request looks similar to automated requests from a computer. To protect our users from spam and other malicious activity, we can't create an account for you right now. Please try again later."
76      */
77     TWTRTwitterAPIErrorTieredActionSignupSpammerPhoneVerify = 240,
78
79     /**
80      *  "User is over the limit for login verification. Please try again in an hour."
81      */
82     TWTRTwitterAPIErrorOverLimitLoginVerificationStart = 245,
83
84     /**
85      *  "User is over the limit for login verification attempts. Please try signing in again."
86      */
87     TWTRTwitterAPIErrorOverLimitLoginVerificationAttempt = 246,
88
89     /**
90      *  "The login request is not yet approved."
91      */
92     TWTRTwitterAPIErrorNotYetApprovedLoginVerification = 253,
93
94     /**
95      *  "There was a failure sending the login verification request"
96      */
97     TWTRTwitterAPIErrorFailureSendingLoginVerificationRequest = 266,
98
99     /**
100      *  "User is not an SDK user"
101      */
102     TWTRTwitterAPIErrorUserIsNotSdkUser = 269,
103
104     /**
105      *  "We are unable to verify this phone number."
106      */
107     TWTRTwitterAPIErrorDeviceRegistrationGeneralError = 284,
108
109     /**
110      *  "This phone number is already registered."
111      */
112     TWTRTwitterAPIErrorDeviceAlreadyRegistered = 285,
113
114     /**
115      *  "We cannot send a text message to this phone number because its operator is not supported."
116      */
117     TWTRTwitterAPIErrorDeviceOperatorUnsupported = 286,
118
119     /**
120      *  "Device registration contains incorrect/unformatted input.
121      */
122     TWTRTwitterAPIErrorDeviceRegistrationInvalidInput = 300,
123
124     /**
125      *  "Device registration attempted on pending device."
126      */
127     TWTRTwitterAPIErrorDeviceDeviceRegistrationPending = 301,
128
129     /**
130      *  "Internal operation failed during device registration."
131      */
132     TWTRTwitterAPIErrorDeviceRegistrationOperationFailed = 302,
133
134     /**
135      *  "Phone number normalization failed during device registration"
136      */
137     TWTRTwitterAPIErrorDeviceRegistrationPhoneNormalizationFailed = 303,
138
139     /**
140      *  "Phone number country not detected upon normalization during device registration"
141      */
142     TWTRTwitterAPIErrorDeviceRegistrationPhoneCountryDetectionFailed = 304,
143 };