commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
* |
|
16 |
*/ |
|
17 |
|
a0a843
|
18 |
#import <Foundation/Foundation.h> |
H |
19 |
|
7be7ad
|
20 |
FOUNDATION_EXPORT NSString *const TWTRNetworkingErrorDomain; |
H |
21 |
FOUNDATION_EXPORT NSString *const TWTRNetworkingUserAgentHeaderKey; |
|
22 |
FOUNDATION_EXPORT NSString *const TWTRNetworkingStatusCodeKey; |
a0a843
|
23 |
|
H |
24 |
#pragma mark - HTTP Headers |
7be7ad
|
25 |
FOUNDATION_EXPORT NSString *const TWTRContentTypeHeaderField; |
H |
26 |
FOUNDATION_EXPORT NSString *const TWTRContentLengthHeaderField; |
|
27 |
FOUNDATION_EXPORT NSString *const TWTRContentTypeURLEncoded; |
|
28 |
FOUNDATION_EXPORT NSString *const TWTRAcceptEncodingHeaderField; |
|
29 |
FOUNDATION_EXPORT NSString *const TWTRAcceptEncodingGzip; |
a0a843
|
30 |
|
H |
31 |
/** |
|
32 |
* Internal API error codes |
|
33 |
* These error codes belong to the `TWTRAPIErrorDomain` error domain. |
|
34 |
* @see https://cgit.twitter.biz/birdcage/tree/macaw/macaw-core/src/main/scala/com/twitter/macaw/monorail/ApiError.scala |
|
35 |
*/ |
|
36 |
// TODO: Move these to the public header because they can all surface to the developer? |
|
37 |
typedef NS_ENUM(NSUInteger, TWTRTwitterAPIErrorCode) { |
|
38 |
/** |
|
39 |
* "%s parameter is invalid" |
|
40 |
*/ |
|
41 |
TWTRTwitterAPIErrorInvalidParameter = 44, |
|
42 |
|
|
43 |
/** |
|
44 |
* "The email address associated with this account is invalid." |
|
45 |
*/ |
|
46 |
TWTRTwitterAPIErrorInvalidEmailAddress = 56, |
|
47 |
|
|
48 |
/** |
|
49 |
* "Client is not permitted to perform this action" |
|
50 |
*/ |
|
51 |
TWTRTwitterAPIErrorClientNotPrivileged = 87, |
|
52 |
|
|
53 |
/** |
|
54 |
* "Rate limit exceeded" |
|
55 |
*/ |
|
56 |
TWTRTwitterAPIErrorRateLimitExceeded = 88, |
|
57 |
|
|
58 |
/** |
|
59 |
* "Account update failed: %s." |
|
60 |
*/ |
|
61 |
TWTRTwitterAPIErrorAccountUpdateFailure = 120, |
|
62 |
|
|
63 |
/** |
|
64 |
* "Bad Authentication data." |
|
65 |
*/ |
|
66 |
TWTRTwitterAPIErrorCodeBadAuthenticationData = 215, |
|
67 |
|
|
68 |
/** |
|
69 |
* "The login verification request has expired" |
|
70 |
*/ |
|
71 |
TWTRTwitterAPIErrorExpiredLoginVerificationRequest = 235, |
|
72 |
|
|
73 |
/** |
|
74 |
* "The challenge response is incorrect" |
|
75 |
*/ |
|
76 |
TWTRTwitterAPIErrorIncorrectChallengeResponse = 236, |
|
77 |
|
|
78 |
/** |
|
79 |
* "That is not an active login verification request ID" |
|
80 |
*/ |
|
81 |
TWTRTwitterAPIErrorMissingLoginVerificationRequest = 237, |
|
82 |
|
|
83 |
/** |
|
84 |
* "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." |
|
85 |
*/ |
|
86 |
TWTRTwitterAPIErrorTieredActionSignupSpammerPhoneVerify = 240, |
|
87 |
|
|
88 |
/** |
|
89 |
* "User is over the limit for login verification. Please try again in an hour." |
|
90 |
*/ |
|
91 |
TWTRTwitterAPIErrorOverLimitLoginVerificationStart = 245, |
|
92 |
|
|
93 |
/** |
|
94 |
* "User is over the limit for login verification attempts. Please try signing in again." |
|
95 |
*/ |
|
96 |
TWTRTwitterAPIErrorOverLimitLoginVerificationAttempt = 246, |
|
97 |
|
|
98 |
/** |
|
99 |
* "The login request is not yet approved." |
|
100 |
*/ |
|
101 |
TWTRTwitterAPIErrorNotYetApprovedLoginVerification = 253, |
|
102 |
|
|
103 |
/** |
|
104 |
* "There was a failure sending the login verification request" |
|
105 |
*/ |
|
106 |
TWTRTwitterAPIErrorFailureSendingLoginVerificationRequest = 266, |
|
107 |
|
|
108 |
/** |
|
109 |
* "User is not an SDK user" |
|
110 |
*/ |
|
111 |
TWTRTwitterAPIErrorUserIsNotSdkUser = 269, |
|
112 |
|
|
113 |
/** |
|
114 |
* "We are unable to verify this phone number." |
|
115 |
*/ |
|
116 |
TWTRTwitterAPIErrorDeviceRegistrationGeneralError = 284, |
|
117 |
|
|
118 |
/** |
|
119 |
* "This phone number is already registered." |
|
120 |
*/ |
|
121 |
TWTRTwitterAPIErrorDeviceAlreadyRegistered = 285, |
|
122 |
|
|
123 |
/** |
|
124 |
* "We cannot send a text message to this phone number because its operator is not supported." |
|
125 |
*/ |
|
126 |
TWTRTwitterAPIErrorDeviceOperatorUnsupported = 286, |
|
127 |
|
|
128 |
/** |
|
129 |
* "Device registration contains incorrect/unformatted input. |
|
130 |
*/ |
|
131 |
TWTRTwitterAPIErrorDeviceRegistrationInvalidInput = 300, |
|
132 |
|
|
133 |
/** |
|
134 |
* "Device registration attempted on pending device." |
|
135 |
*/ |
|
136 |
TWTRTwitterAPIErrorDeviceDeviceRegistrationPending = 301, |
|
137 |
|
|
138 |
/** |
|
139 |
* "Internal operation failed during device registration." |
|
140 |
*/ |
|
141 |
TWTRTwitterAPIErrorDeviceRegistrationOperationFailed = 302, |
|
142 |
|
|
143 |
/** |
|
144 |
* "Phone number normalization failed during device registration" |
|
145 |
*/ |
|
146 |
TWTRTwitterAPIErrorDeviceRegistrationPhoneNormalizationFailed = 303, |
|
147 |
|
|
148 |
/** |
|
149 |
* "Phone number country not detected upon normalization during device registration" |
|
150 |
*/ |
|
151 |
TWTRTwitterAPIErrorDeviceRegistrationPhoneCountryDetectionFailed = 304, |
|
152 |
}; |